Library tutorials & articles
A Real-Time VB6 ActiveX News Control
- Introduction
- Creating the ActiveX control
- Obtaining our news with XMLHTTP
- Displaying the link
- Compiling and using our new ActiveX control
- Conclusion
Compiling and using our new ActiveX control
Because Visual Basic is such a tightly integrated IDE, all we have to do to compile
and create our ActiveX control is choose File -> Make prjXMLNews.ocx. Visual
Basic will handle the entire library linking and referencing process by itself.
Once the Visual Basic compiler has finished doing its thing, we will be left with
a single file, prjXMLNews.ocx. Visual Basic automatically registers our new ActiveX
control for us, so all that we have to do is add it to our project.
To do this, we fire up a new instance of Visual Basic and create a standard executable.
Using the Project -> Components (or Ctrl+T) menu option, we simply add our
ActiveX object as an available control ns our project, like this:
Click OK and take a look at your side tool bar. You should see a new control.
Move your mouse over the control, and its tooltip text should display "ctrlNews":
Now it's simply a matter of double-clicking on the control to add it to our new
projects main form. Notice how the control actually shows the news items on it?
Resize the control to make sure all of the news items are displayed, and then
run the app.
Moving your mouse over any of the labels will show the hand cursor. Clicking on
one will open the URL of that news item in a new browser window. If you take your
control and play around with it a bit, you can create a neat looking form, like
mine, which is shown below:
Using our new ActiveX control on a web page is easy as well. Make sure you have
your ActiveX control’s source coded loaded in Visual Basic. Now, click on the
Play button. This will launch the ActiveX control in a new web browser window.
View the source of that page, and copy the entire <OBJECT> tag. It should
look something like this: <OBJECT classid="clsid:B6091979-A970-4967-9257-5372182BC3AA">
</OBJECT>
The classid value is a unique identifier which windows stores in the registry,
along with other details of our new ActiveX control, such as its AppId, and ProgId.
Simply paste the <OBJECT> tag into a HTML page and save that HTML page on
your machine. Fire the page up in your web browser, and our new ActiveX control
will be displayed:
Related articles
Related discussion
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
-
Can you describe Above simple VB6 code?
by pramodmca09 (0 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
Good example.
This is the first time played with any xmlhttp feeds, and found the example whet my appetite for more! The code was not quite complete, but if you are familiar with vb then you should be able to fill in the blanks. Once you get it working, you will no doubt see the other possible uses of this technology.
Keep it real.
I've went thru the listing a few times, and it is not working for me at all....
Things I noticed, the For loop he uses has no Next statement
I'm probably overlooking something ....any suggestions?
And after the LoadNews returns a TRUE it has EXIT function, shouldn't that be end?
Thanks!
Edit = typos
hmmm... yes... it seems the author hasn't released the entire VB project for the control. The hand icon will in fact be in your VB installation directory (in something like Shared/Icons/ along with the icons/toolbar bitmaps etc).
I see the images for the article, but not any hand images.
don't you see any images on http://www.developerfusion.com/show/2273/2/ ? Try hitting refresh on your browser....
I went to the article again and found no images?
There was one crucial thing missing from the article.... the images
I have now added them, which might make it a bit easier for future readers 
This was a somwehat confusing but very cool article once you get it working.
What was frustrating was that the article indicated there was support material, but I cannot find any anywhere.
This just made me really read the article and work with the project until I had it working.
Great topic and a useful tool to add to any non-profit individual.
BTW, I wonder what it costs to use for $$ purposes?
This thread is for discussions of A Real-Time VB6 ActiveX News Control.