Serving the Quantitative Finance Community

 
User avatar
opti999
Topic Author
Posts: 0
Joined: October 8th, 2003, 1:09 pm

registered component may not always be installed

February 4th, 2008, 1:32 pm

HiIs it possible to write code in VB2005 that uses a 3rd party component if installed and doesn't use it if its not?if I use something like:component1.task1it will work fine if the component is installed and registered but if it isn't then obvioulsy I'll get an error message.Thanks
 
User avatar
opti999
Topic Author
Posts: 0
Joined: October 8th, 2003, 1:09 pm

registered component may not always be installed

February 12th, 2008, 2:37 pm

.. for what its worth, the fact that I've referred to:component1.task1in the code when the component isn't installed, generates a "Type 'component1.task1' is not defined.I thought something like the following may have been available:if component1 defined thencomponent1.task1end if
 
User avatar
dirtydroog
Posts: 0
Joined: July 12th, 2007, 6:32 pm

registered component may not always be installed

February 19th, 2008, 1:34 pm

You might have to call the Windows COM functions yourself to check how they get on, something like CoCreateInstance.These basically look in the registry for your "component1" to see what DLL it resides in, versioning etc, and then loads that DLL (crash course in COM right there)If that succeeds then use your component, if not don't.