
Calling VB ActiveX Control from MFC
Quote:
> How does the customer use the interface I have defined (I assume by
> importing the typelib, but where do they go from here and how do they
> implement the code ?)
In the VB IDE, there's a menu item called "Project /References". They
would reference your type library (or DLL) there. To them, it would
show up in the object browser. When they go to define their own
objects, they can say "implements IMyInterface" and the VB IDE
"hooks up" your type library so they can see function signatures, etc.
Quote:
> Also, if the customer defines an Active X VB DLL without using my
> predefined interface, I assume I can just use IDispatch to invoke the
> relevant functions ?
Not necessarily. If your interface is defined as dual (derived from
IDispatch), then yes. Otherwise, you would not be able to use
IDispatch.
Quote:
> I know this is probably not the best place to ask, since it is more VB
> oriented than MFC. Any pointers on using VB components from MFC would
> be appreciated.
Use VARIANT_BOOL instead of BOOL or bool. Use BSTR for string
types. Don't use 'int', use short or long (vb int is 16 bits which causes
IDL
confusion).
Les Matheson