SunQuest
 
       Visual Basic
  Home arrow Visual Basic arrow Page 5 - A Real-Time ActiveX News Control
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM developerWorks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC

A Real-Time ActiveX News Control
By: Mitchell Harper
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 7
    2001-12-22

    Table of Contents:
  • A Real-Time ActiveX News Control
  • Creating the ActiveX control
  • Obtaining our news with XMLHTTP
  • Displaying the link
  • Compiling and using our new ActiveX control
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    A Real-Time ActiveX News Control - Compiling and using our new ActiveX control


    (Page 5 of 6 )

    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:

    Adding our ActiveX control to a new project is eas

    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":

    Our ActiveX control is now available from the cont

    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:

    My implementation of our new ActiveX control

    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:

    Our new ActiveX control in Internet Explorer

    More Visual Basic Articles
    More By Mitchell Harper


     

    VISUAL BASIC ARTICLES

    - Developing an XML Web Service Using Visual S...
    - Creating an HTML File List with VB
    - Fun with Email: VB6, CDO, MAPI, and a Remote...
    - Extranet/Intranet Dictionary Cracker in VB
    - Finding Default App Icons With Visual Basic
    - Registry Fever With Visual Basic
    - Implementing An ADO Data Control With VB6
    - Printing With Visual Basic
    - MSMQ Part 1/2: Architecture and Simple Imple...
    - Magnifying The Desktop With Visual Basic
    - Sending Email With MAPI Components in Visual...
    - Two Person Chat With The Winsock Control And...
    - A Real-Time ActiveX News Control
    - Accessing the Windows API in Visual Basic







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway