why Can\'t create COM Instance After registering COM Server Successfully 
Author Message
 why Can\'t create COM Instance After registering COM Server Successfully

Hi all,
I met a problem when using COM under eVC 4.0,  After
registering simple COM Server ,I Can\'t create COM
Instance  as following:

   HRESULT hr=CoInitializeEx(NULL,COINIT_MULTITHREADED );
   if(!SUCCEEDED(hr))
   {
        MessageBox(TEXT(\"Failed to init COM !\"));
   }
   ITestMePtr Conn1;
   hr=Conn1.CreateInstance(_uuidof( TestMe ));
   if (FAILED(hr))
   {// error happened here
MessageBox(_T(\"Create the COM Server instance failed!
\"));
        return;
    }
It happened on CEPC and CE.Net Emulator.anyone can help
me?

thanks

jack



Sat, 09 Jul 2005 09:08:31 GMT  
 why Can\'t create COM Instance After registering COM Server Successfully

Check the Apartment/Free issue.
In CE.Net there is Apartments in COM, if you use that model you have to
create marshaling code (proxy/stub).
Perform a simple test - define your component as a "Free" COM component and
check if that helps. This is done by modifying the rgs file.

Good luck.


Quote:
> Hi all,
> I met a problem when using COM under eVC 4.0,  After
> registering simple COM Server ,I Can\'t create COM
> Instance  as following:

>    HRESULT hr=CoInitializeEx(NULL,COINIT_MULTITHREADED );
>    if(!SUCCEEDED(hr))
>    {
> MessageBox(TEXT(\"Failed to init COM !\"));
>    }
>    ITestMePtr Conn1;
>    hr=Conn1.CreateInstance(_uuidof( TestMe ));
>    if (FAILED(hr))
>    {// error happened here
> MessageBox(_T(\"Create the COM Server instance failed!
> \"));
> return;
>     }
> It happened on CEPC and CE.Net Emulator.anyone can help
> me?

> thanks

> jack



Tue, 12 Jul 2005 04:18:23 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Create instance of an com object inside a the Com server

2. Creating Instances coclasses in another COM server

3. COM Server Instance Created on Each Instantiation?

4. How to enable and create multiple instances of a COM server in ATL

5. Lifetime of EXE COM server that uses DLL COM server

6. Instancing of COM server

7. Problem w/multiple instances of out of process COM server

8. single com server instance

9. running instance of COM object in ATL/MFC server

10. all COM Server Instances contain the same data

11. Single instance Com server

12. Detecting if a certain COM server is registered via command line

 

 
Powered by phpBB® Forum Software