The DLL Cann't using exe server?Blocked in CoCreateInstance() 
Author Message
 The DLL Cann't using exe server?Blocked in CoCreateInstance()

Hi:
  I completed a ATL server that's type is executable.I writed a DEMO
test it ,and it worked correctly. But the server does't work when I use
it in a DLL.The struct chat is below:
      ____________________
     |  application (exe) |
     |____________________|
              |
      ____________________
     |      DLL     (dll) |
     | (CoCreateInstance) |
     |____________________|
              |
      ____________________
     | ATL Server (exe)   |
     |____________________|

It was  blocked when DLL call function CoCreateInstance().
What can I do   make it ? I would be appreciate it greatly.

Thanks in advance!

haung yixin



Sat, 05 Feb 2005 15:42:40 GMT  
 The DLL Cann't using exe server?Blocked in CoCreateInstance()
Define "blocked" and "doesn't work". Do you get error HRESULT from
CoCreateInstance? What is it?
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Hi:
>   I completed a ATL server that's type is executable.I writed a DEMO
> test it ,and it worked correctly. But the server does't work when I
use
> it in a DLL.The struct chat is below:
>       ____________________
>      |  application (exe) |
>      |____________________|
>               |
>       ____________________
>      |      DLL     (dll) |
>      | (CoCreateInstance) |
>      |____________________|
>               |
>       ____________________
>      | ATL Server (exe)   |
>      |____________________|

> It was  blocked when DLL call function CoCreateInstance().
> What can I do   make it ? I would be appreciate it greatly.

> Thanks in advance!

> haung yixin



Sat, 05 Feb 2005 22:02:50 GMT  
 The DLL Cann't using exe server?Blocked in CoCreateInstance()
Thanks!
"block" means deadlock."doesn't work" means that it was deadlock when I use
CoCreateInstance in DllMain.I Cann't get error HRESULT beacause it's
deadlock.

Thanks!
YX.haung


Quote:
> Define "blocked" and "doesn't work". Do you get error HRESULT from
> CoCreateInstance? What is it?
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



> > Hi:
> >   I completed a ATL server that's type is executable.I writed a DEMO
> > test it ,and it worked correctly. But the server does't work when I
> use
> > it in a DLL.The struct chat is below:
> >       ____________________
> >      |  application (exe) |
> >      |____________________|
> >               |
> >       ____________________
> >      |      DLL     (dll) |
> >      | (CoCreateInstance) |
> >      |____________________|
> >               |
> >       ____________________
> >      | ATL Server (exe)   |
> >      |____________________|

> > It was  blocked when DLL call function CoCreateInstance().
> > What can I do   make it ? I would be appreciate it greatly.

> > Thanks in advance!

> > haung yixin



Sun, 06 Feb 2005 10:36:30 GMT  
 The DLL Cann't using exe server?Blocked in CoCreateInstance()
Do you, by any chance, call CoCreateInstance from DllMain? Don't do
that. Doing anything that can create new threads or load new DLLs from
DllMain is a sure recipe for a deadlock. Have a dedicated Init function
in the DLL and require the EXE to call it, or do it when first COM
object in a DLL is created (assuming the DLL is a COM server), or
something like that.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> Thanks!
> "block" means deadlock."doesn't work" means that it was deadlock when
I use
> CoCreateInstance in DllMain.I Cann't get error HRESULT beacause it's
> deadlock.

> Thanks!
> YX.haung


> > Define "blocked" and "doesn't work". Do you get error HRESULT from
> > CoCreateInstance? What is it?
> > --
> > With best wishes,
> >     Igor Tandetnik

> > "For every complex problem, there is a solution that is simple,
neat,
> > and wrong." H.L. Mencken



> > > Hi:
> > >   I completed a ATL server that's type is executable.I writed a
DEMO
> > > test it ,and it worked correctly. But the server does't work when
I
> > use
> > > it in a DLL.The struct chat is below:
> > >       ____________________
> > >      |  application (exe) |
> > >      |____________________|
> > >               |
> > >       ____________________
> > >      |      DLL     (dll) |
> > >      | (CoCreateInstance) |
> > >      |____________________|
> > >               |
> > >       ____________________
> > >      | ATL Server (exe)   |
> > >      |____________________|

> > > It was  blocked when DLL call function CoCreateInstance().
> > > What can I do   make it ? I would be appreciate it greatly.

> > > Thanks in advance!

> > > haung yixin



Sun, 06 Feb 2005 21:56:27 GMT  
 The DLL Cann't using exe server?Blocked in CoCreateInstance()

Thank you for your help!



Quote:
> Do you, by any chance, call CoCreateInstance from DllMain? Don't do
> that. Doing anything that can create new threads or load new DLLs from
> DllMain is a sure recipe for a deadlock. Have a dedicated Init function
> in the DLL and require the EXE to call it, or do it when first COM
> object in a DLL is created (assuming the DLL is a COM server), or
> something like that.
> --
> With best wishes,
>     Igor Tandetnik

> "For every complex problem, there is a solution that is simple, neat,
> and wrong." H.L. Mencken



> > Thanks!
> > "block" means deadlock."doesn't work" means that it was deadlock when
> I use
> > CoCreateInstance in DllMain.I Cann't get error HRESULT beacause it's
> > deadlock.

> > Thanks!
> > YX.haung


> > > Define "blocked" and "doesn't work". Do you get error HRESULT from
> > > CoCreateInstance? What is it?
> > > --
> > > With best wishes,
> > >     Igor Tandetnik

> > > "For every complex problem, there is a solution that is simple,
> neat,
> > > and wrong." H.L. Mencken



> > > > Hi:
> > > >   I completed a ATL server that's type is executable.I writed a
> DEMO
> > > > test it ,and it worked correctly. But the server does't work when
> I
> > > use
> > > > it in a DLL.The struct chat is below:
> > > >       ____________________
> > > >      |  application (exe) |
> > > >      |____________________|
> > > >               |
> > > >       ____________________
> > > >      |      DLL     (dll) |
> > > >      | (CoCreateInstance) |
> > > >      |____________________|
> > > >               |
> > > >       ____________________
> > > >      | ATL Server (exe)   |
> > > >      |____________________|

> > > > It was  blocked when DLL call function CoCreateInstance().
> > > > What can I do   make it ? I would be appreciate it greatly.

> > > > Thanks in advance!

> > > > haung yixin



Mon, 07 Feb 2005 09:21:36 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Cann't use EXE Server in DLL?Block in CoCreateInstance().

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

3. Using AFX EXT DLL ATL objects in ATL EXE server

4. using MFC Extension DLL from ATL server(exe)

5. CoCreateInstance hangs when running ATL Sever DLL in MTX.exe

6. Passing Data Between Exe's using Dll

7. exe that uses no runtime dll's ?

8. Using an EXE which uses a DLL - as a DLL itself

9. 'using' statement in block

10. CASyncSocket - My server won't un-block

11. Cann't Get VC's IntelliSence Function

12. 2 16bit EXE's using same 16bit DLL - How does the DLL know the second EXE was started and attached to the DLL ?

 

 
Powered by phpBB® Forum Software