--------------------------------------------------------------------- SearchWin2000.com's Developer Tip --------------------------------------------------------------------- TODAY'S DEVELOPER TIP: Visual Basic add-ins ===================================================================== SPONSORED BY: Oracle ===================================================================== Oracle Portal - Zero to Portal @Web Speed Oracle Portal is the fastest way to provide a personalized web view and manage corporate assets. As part of the Oracle Internet Platform, it provides security, reliability, and scalability. GET STARTED at http://ad.doubleclick.net/clk;2771629;5058249;s?http://ad.doubleclick.net/clk;2528590;5576638;w?http://www.oracle.com/go/?&Src=201777&Act=67. ===================================================================== "Visual Basic add-ins" By Steven Roman The Visual Basic development environment is poorly documented but offers much of the functionality of MS Office applications through the VB Extensibility Model. The creation of add-ins can make the life of VB developers much simpler. This excerpt from Steven Roman's book "Developing Visual Basic Add-ins," provides an overview of the add-in creation process. --------------------------------------------------------------------- The Add-in creation process The process of creating an add-in is actually fairly easy to follow, if we think about the more or less common-sense steps that are required to prepare an add-in for use. This does not include adding functionality (that is, features) to the add-in, which is the major part of add-in creation. To help avoid confusion, note that there is a distinction between the add-in "programmer" (that's us) and the add-in "user," who is also programming in the VB-environment. Registering the add-in As with most Windows applications, we must provide a means for VB to get general information about our add-in. This information includes the kind (DLL or EXE) and location of the add-in's public class. This information is provided by registering the add-in in the system registry. Providing a method for add-in activation An add-in can be activated -- that is, executed (for an EXE) or loaded (for a DLL) -- either during a VB session or when VB is started. The most common way for a user to activate an add-in is by using the Add-In Manager. We must therefore instruct the Add-In Manager to include ours in its list of available add-ins. In VB5, this is done by placing a line in the vbaddin.ini file, which resides in the Windows directory. In VB6, the process is made a bit simpler by using the Add-In Designer. Alternatively, add-ins can be activated programmatically by other add-ins. This is the basis for VB's Add-In Toolbar, which is an add-in whose sole function is to activate other add-ins. As the name implies, the Add-In Toolbar displays a toolbar with buttons for each installed add-in, as well as a button for installing or removing additional add-ins. Connecting the add-in Finally, we must provide VB with a way to give our add-in programmatic access to the VB IDE. After all, this is the whole point of an add-in. This process is properly referred to as "connecting the add-in" (although some may use this term more loosely to refer to the activation process as well). There is a slight difference in the way this is done in VB5 and VB6, but the principle is the same in both cases. Connecting an add-in is by far the most interesting portion of add-in setup. To learn more about "Developing Visual Basic Add-ins," click http://www.digitalguru.com/dgstore/product.asp?isbn=1565925270&ac_id=73 ===================================================================== ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DID YOU LIKE THIS TIP? ===================================================================== Whether you loved it or hated it, why not let us know? Also, feel free to let us know if you are interested in any other Windows development issues. Email your comments to mailto:tips@searchwin2000. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===================================================================== TIP OF THE MONTH CONTEST! ===================================================================== Introducing searchWin2000's Tip Exchange - a place for you and your peers to read and submit technical tips! Submit your own tip at and you'll be eligible to win a Sony VAIO Music Clip 64MB MP3 Player! Go to http://searchwin2000.techtarget.com/tipsPrize/0,289492,sid1_prz538067_cts538060,00.html. Tip categories include Administrator, Developer, and Exchange, Migration and Security. ===================================================================== VISIT OUR DISCUSSION FORUMS! ===================================================================== And don't miss out on searchWin2000's discussion forums! Get in touch with peers, stay up-to-date on the latest technology issues, and get help with your own Win2k woes. Check them out at http://searchwin2000.discussions.techtarget.com/WebX?[EMAIL PROTECTED]^0@/searchwin2000. ===================================================================== To Remove your email address from the distribution list for this specific newsletter "Reply" to this message with REMOVE in the subject line. You will receive an email confirming that you have been removed. To Remove yourself from additional distribution lists or to update your preferences, go to the searchWin2000.com registration page at: http://searchWin2000.techtarget.com/register
