How can I use my VB ActiveX dll from VC++?
Starting with VC++ 5.0, there's a new compiler directive that makes it very easy to do: #import. Combined with COM smart pointers, using VB ActiveX dlls is a snap. Basically, all you have to do this is #import the dll, and the compiler will automatically generate all required definitions from it. Then create objects from the library by using either smart pointers, or CoCreateInstance().
To understand this better, let's look at a simple example: Suppose I have a VB ActiveX DLL with a class called Test, which has a method called TryItOut(). You can create the object and call the method like this:
#import "test.dll" no_namespace named_guids
_TestPtr pTest = 0;
HRESULT hres = pTest.CreateInstance ( __uuidof(Test) );
pTest->TryItOut();