Cannot load Mixed DLL in GUI application 
Author Message
 Cannot load Mixed DLL in GUI application

I created a Mixed DLL that include native code and its managed wrapering
code for using a single DLL in both native and managed applicaitons. I found
the native GUI applications linked with the Mixed DLL can't start. The
native GUI applications will terminate before the WinMain() to be invoked.
No exception message box or other error message will be displayed. I have no
chance to debug it  in VS IDE. But the native console applications and the
managed applicaitons can use it without any problem.

How to make the Mixed DLL can be used by native GUI applicaitons?

Thank in advance.



Sun, 18 Sep 2005 07:30:06 GMT  
 Cannot load Mixed DLL in GUI application

Quote:

> Subject: Cannot load Mixed DLL in GUI application
> Date: Wed, 2 Apr 2003 07:30:06 +0800

> I created a Mixed DLL that include native code and its managed wrapering
> code for using a single DLL in both native and managed applicaitons. I
found
> the native GUI applications linked with the Mixed DLL can't start. The
> native GUI applications will terminate before the WinMain() to be invoked.
> No exception message box or other error message will be displayed. I have
no
> chance to debug it  in VS IDE. But the native console applications and the
> managed applicaitons can use it without any problem.

> How to make the Mixed DLL can be used by native GUI applicaitons?

In general, mixed DLLs can be used by native GUI applications. You might be
running into the "Mixed DLL Loading Problem". Look at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_v...
t/html/vcconMixedDLLLoadingProblem.asp to see if this situation applies to
you.

--
Mark Levine, Microsoft Visual C++ Team
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm



Tue, 20 Sep 2005 03:18:44 GMT  
 Cannot load Mixed DLL in GUI application
Thanks for  your advice. I have modified my source file according to that
article, but no luck. The native GUI applicaitons can yet be initialized
properly. After set breakpoint in C  rumtime source file and traced into it,
I found it is in corwork.dll where the the GUI applicaitons  terminate
silently. It looks like no locks during initializing. Why does the native
console applicaitons consume the same Mixed-mode DLL run without this
problem? What is the difference?

Thanks.

Quote:

> In general, mixed DLLs can be used by native GUI applications. You might
be
> running into the "Mixed DLL Loading Problem". Look at

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_v...
Quote:
> t/html/vcconMixedDLLLoadingProblem.asp to see if this situation applies to
> you.

> --
> Mark Levine, Microsoft Visual C++ Team
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm



Wed, 21 Sep 2005 20:27:11 GMT  
 Cannot load Mixed DLL in GUI application

--------------------

Quote:
>Subject: Re: Cannot load Mixed DLL in GUI application
>Date: Sat, 5 Apr 2003 20:27:11 +0800
>Lines: 28
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

>Newsgroups: microsoft.public.dotnet.languages.vc
>NNTP-Posting-Host: 61.183.66.174
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vc:22083
>X-Tomcat-NG: microsoft.public.dotnet.languages.vc

>Thanks for  your advice. I have modified my source file according to that
>article, but no luck. The native GUI applicaitons can yet be initialized
>properly. After set breakpoint in C  rumtime source file and traced into
it,
>I found it is in corwork.dll where the the GUI applicaitons  terminate
>silently. It looks like no locks during initializing. Why does the native
>console applicaitons consume the same Mixed-mode DLL run without this
>problem? What is the difference?

>Thanks.

>> In general, mixed DLLs can be used by native GUI applications. You might
>be
>> running into the "Mixed DLL Loading Problem". Look at

>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_v...
r
>> t/html/vcconMixedDLLLoadingProblem.asp to see if this situation applies
to
>> you.

>> --
>> Mark Levine, Microsoft Visual C++ Team
>> This posting is provided "AS IS" with no warranties, and confers no
>rights.
>> Use of included script samples are subject to the terms specified at
>> http://www.microsoft.com/info/cpyright.htm

This problem is a convoluted manifestation of the Loader Lock problem
described by the article. The error occurs in the MSVCRT.DLL used by
Windows, it looks like a reentrant call caused by mscoree.dll and MFC7x.DLL
during the startup process.

In any case you can try the following workarounds:
1) Try delayloading the IJW DLL with the exported functions
2) Using LoadLibrary to load the IJW DLL instead of implicit linking

--
Anson Tsao, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.



Sun, 02 Oct 2005 01:46:20 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Cannot load DLL in another DLL program!!

2. Cannot load DLL - after creating my DLL with MSVC 6

3. Cannot load DLL - after creating my DLL with MSVC 6

4. Windows Application GUI when invoked does not load

5. Get my mixed dll to load from the GAC

6. mixed mode DLL causing non-continuable exception during process load

7. Cannot Create and Load a simple DLL!

8. Cannot load dll-functions during run time

9. cannot load EM.DLL

10. UPDATE: DLL cannot load its own string resources

11. Cannot load DLL from FoxPro

12. Cannot load ActiveX Ctrl. in regular DLL

 

 
Powered by phpBB® Forum Software