mfc >> Adding support for GetObject in a MFC exe

by Q2xpbnQ » Mon, 24 Nov 2003 01:01:05 GMT

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



Similar Threads

1. add MFC support to ATL exe project in VS 2003

2. How to add MFC support to an ATL EXE(Service) project in Visual C++

3. How to Add MFC Support to "ATL Service (EXE)"

4. C# GetObject Support

Hi

I can't find a sample or sample project for implementing the GetObject 
support for a c# project with ComVisible=true

thank you for your help

tobias

5. Supporting VB6 CreateObject v. GetObject from VC++ 6

6. MFC Support to ATL EXE..VC++ 7.0

Guys,
Can somebody provide me some insights into adding MFC Support in ATL
EXE
1) What issues are involved
2) How safe is to use Free Threading

Any help would be greatly appreciated.


Thanks

7. Link Error LNK 2005 , ATL COM EXE project with MFC Support

8. MFC Support for ATL EXE com server

Hello,

How to add MFC Support for ATL EXE com server in VC++ .NET 
2003? It's simple for DLL. Just check box on ATL Wizard 
form. How to add it for EXE com server in VC++ .NET 2003? 

Thanks for the help,

Leonid