August 31st, 1999, 06:17 AM
I have created a Component in VB i.e. a dll. I have registered it. I have created a new class from Type Library Information in VC++ 6.0. I could get all related declarations of the component in the .h file of the newly created Class. But once when I try to Invoke methods of the Component it is Fails. Can any one helpme. A snippet is Highly appreciated.
Fabi Pantera
August 31st, 1999, 08:04 AM
Did you CoInitialize?
Best regards,
Faby
eahmed
August 31st, 1999, 03:03 PM
Try using the VC++ 6 #import directive. You may have made a mistake while creating your header files and this will handle the details for you by creating a smart pointer that wraps the component. The smart pointer will be defined as the name of your component with a Ptr suffix added to it. Just use #import to create the declarations, then declare the smart pointer, call CoInitialize, then call a method on your component using the -> operator (the smart pointer will create an instance of your component on the first method call), then call SmartPointer.Release() [notice the (.)] to release the component before calling CoUninitialize().