I have coded a console app with MFC
support that activates a vbasic
activeX exe and calls a method on it.
I don't know how to deactivate it,
the program crashes when I do.
Provided below is sample code on
how I activate and call a method on
the object. This works fine.
//create object & get dispatch pointer
hrReturnCode = CoCreateInstance (pClsid, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch,(void FAR* FAR*)&gpHandleInfo.lpDispatch );
//get dispatch id for method
hrReturnCode = gpHandleInfo.lpDispatch->GetIDsOfNames
&szStartLine, 1, LOCALE_SYSTEM_DEFAULT, &dispid);
hrReturnCode = gpHandleInfo.lpDispatch->Invoke (dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &dispparams, NULL, NULL, NULL);
After I invoke the Active X exe, I can
see it in the NT Task Manager.
How do I then deactivate the object I
created ? Deleting the IDispatch pointer seems to crash the program.
If I deactivate the object, the
ActiveX exe should also not appear
in the task manager.
Any sample code would be of great help.