Variants of this question have been asked several times. How do you call functions from a COM object created with Visual Basic (or anything else for that matter) from C++?
Well, it's not too difficult if you implement MFC and use InvokeHelper(...) and CreateControl(...) functions. However, I'm trying to do it using straight C++ without MFC. The really tough part is I don't have a header file either, so I don't even have an abstact class to work with!
Here's the equivalent of what I'm trying to do in VB:
Dim myobj As VicNet.VicNetCtl
Set myobj = GetObject(,"VicNet.VicNetCtl")
Pretty simple, eh? Create a control called "VicNet.VicNetCtl" and then call a function that it exposes. Now, how do you do it in C++ without MFC or a header file with an abstract class definition?
Here's what I have so far:
void main(int argc,char *argv)
Of course, the first thing that breaks is IID_IDispatch is not declared. So perhaps I should use IID_IUnknown? Also, our pointer myobj doesn't know about Function1(). So how do I call the function?
Maybe I'm missing the obvious, but I can't seem to think right now.