I would like to use GetObject in vb/vb script to access a running instance of my com object
So I spent a huge amount of time trying to get a dialog based MFC .exe generate by the MFC Appwizard to register it self in the running object table (ROT). I have found many samples that work with MDI / SDI but not Dialog based MFC projects.
Here is a post for SDI http://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.vc.mfc&mid=1b88790b-4ff4-4546-a54e-ed5c43b784c
I tried the following
DWORD dwCookie=0
HRESULT hr=RegisterActiveObject(GetControllingUnknown()
MyApp_CLSID, ACTIVEOBJECT_WEAK, &dwCookie)
In the Dialog base application the GetControllingUnknown() function seems to fail
Also
RegisterActiveObject(GetInterface(&IID_IUnknown)
CCalcDlg::guid, NULL, & dwCookie)
The GetInterface(&IID_Iunknown) does not seem to work properly
At this point I decide there must be something simple that I am missing