473,472 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Mixed DLL Loading Problem??

Hello,

I have a native DLL (written in C) which is supposed to call a managed DLL
(was written in C#, and an entry point was injected modifying the ildasm'd
code).

The exectuable calls the native DLL but the native DLL fails to load the
managed DLL. The paper that addresses the 'mixed DLL problem' below does not
offer any understandable workaround.
http://msdn.microsoft.com/library/de...ingProblem.asp

Does anybody who has came across this have a better understanding of the
possible resolutions of the mixed dll problem? I am very close to totally
abondaning working with mixed DLLs (wasting hundreds of manhours).

Regards,
Mali
Mar 7 '06 #1
3 2748

"Mali Guven" <gu*****@hotmail.com> wrote in message
news:du**********@eeyore.INS.cwru.edu...
| Hello,
|
| I have a native DLL (written in C) which is supposed to call a managed DLL
| (was written in C#, and an entry point was injected modifying the ildasm'd
| code).
|
| The exectuable calls the native DLL but the native DLL fails to load the
| managed DLL. The paper that addresses the 'mixed DLL problem' below does
not
| offer any understandable workaround.
|
http://msdn.microsoft.com/library/de...ingProblem.asp
|
| Does anybody who has came across this have a better understanding of the
| possible resolutions of the mixed dll problem? I am very close to totally
| abondaning working with mixed DLLs (wasting hundreds of manhours).
|
| Regards,
| Mali
|
|

If I understand you correctly, you are calling a managed function from pure
unmanaged C code, right?
If that's the case, this has nothing to do with the mixed mode issue, "mixed
mode" means a single DLL that contains both managed(IL) and native code. You
are calling an "entry point" in a C# managed assembly, that you have created
by tweaking the IL and re-assembling, I guess you know that this is not a
supported scenario and extremely error prone. All you can do is use a
supported interop mechanism, that is, a real "mixed mode DLL", that calls
into C#, without resorting to a dirty hack, or use COM interop.

Willy.
Mar 7 '06 #2

Thanks for the clarification. I will see what it would take to switch to the
real *mixed mode* (a DLL with both native and managed code). In my case, COM
interop is not an option due to speed concerns.

Mali
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:OX**************@TK2MSFTNGP14.phx.gbl...

"Mali Guven" <gu*****@hotmail.com> wrote in message
news:du**********@eeyore.INS.cwru.edu...
| Hello,
|
| I have a native DLL (written in C) which is supposed to call a managed DLL | (was written in C#, and an entry point was injected modifying the ildasm'd | code).
|
| The exectuable calls the native DLL but the native DLL fails to load the
| managed DLL. The paper that addresses the 'mixed DLL problem' below does
not
| offer any understandable workaround.
|
http://msdn.microsoft.com/library/de...ingProblem.asp |
| Does anybody who has came across this have a better understanding of the
| possible resolutions of the mixed dll problem? I am very close to totally | abondaning working with mixed DLLs (wasting hundreds of manhours).
|
| Regards,
| Mali
|
|

If I understand you correctly, you are calling a managed function from pure unmanaged C code, right?
If that's the case, this has nothing to do with the mixed mode issue, "mixed mode" means a single DLL that contains both managed(IL) and native code. You are calling an "entry point" in a C# managed assembly, that you have created by tweaking the IL and re-assembling, I guess you know that this is not a
supported scenario and extremely error prone. All you can do is use a
supported interop mechanism, that is, a real "mixed mode DLL", that calls
into C#, without resorting to a dirty hack, or use COM interop.

Willy.

Mar 7 '06 #3
Speed should not be a concern, COM interop can just be as fast as any other
interop mechanism (when done correctly). Whenever you transition from
unmanaged to unmanaged and back you'll incur some overhead, if this is not
wanted, you should not use managed code (or unmanaged for that matter).

Willy.
"Mali Guven" <gu*****@hotmail.com> wrote in message
news:du**********@eeyore.INS.cwru.edu...
|
| Thanks for the clarification. I will see what it would take to switch to
the
| real *mixed mode* (a DLL with both native and managed code). In my case,
COM
| interop is not an option due to speed concerns.
|
| Mali
|
|
| "Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
| news:OX**************@TK2MSFTNGP14.phx.gbl...
| >
| > "Mali Guven" <gu*****@hotmail.com> wrote in message
| > news:du**********@eeyore.INS.cwru.edu...
| > | Hello,
| > |
| > | I have a native DLL (written in C) which is supposed to call a managed
| DLL
| > | (was written in C#, and an entry point was injected modifying the
| ildasm'd
| > | code).
| > |
| > | The exectuable calls the native DLL but the native DLL fails to load
the
| > | managed DLL. The paper that addresses the 'mixed DLL problem' below
does
| > not
| > | offer any understandable workaround.
| > |
| >
|
http://msdn.microsoft.com/library/de...ingProblem.asp
| > |
| > | Does anybody who has came across this have a better understanding of
the
| > | possible resolutions of the mixed dll problem? I am very close to
| totally
| > | abondaning working with mixed DLLs (wasting hundreds of manhours).
| > |
| > | Regards,
| > | Mali
| > |
| > |
| >
| > If I understand you correctly, you are calling a managed function from
| pure
| > unmanaged C code, right?
| > If that's the case, this has nothing to do with the mixed mode issue,
| "mixed
| > mode" means a single DLL that contains both managed(IL) and native code.
| You
| > are calling an "entry point" in a C# managed assembly, that you have
| created
| > by tweaking the IL and re-assembling, I guess you know that this is not
a
| > supported scenario and extremely error prone. All you can do is use a
| > supported interop mechanism, that is, a real "mixed mode DLL", that
calls
| > into C#, without resorting to a dirty hack, or use COM interop.
| >
| > Willy.
| >
| >
|
|
Mar 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike Kamzyuk | last post by:
Hello all. Basically, I need to call a mixed-mode dll's function (which uses managed code) from a native or mixed-mode dll function (which does not use managed code). I'm wondering if this could...
8
by: Ted Miller | last post by:
Hi folks, I'm looking at moving a large base of C++ code to .Net under tight time constraints. The code runs in mission-critical environments, and I am extremely concerned about the loader lock...
8
by: Nadav | last post by:
Hi, I am writing a performence critical application, this require me to stick to unmanaged C++ as performance is much better using unmanaged C++ ( about 33% better ), Still, I am trying to avoid...
7
by: Staale L. Hansen | last post by:
We have an application which uses some mixed-mode code to expose a .NET 1.1 managed API. Only the necessary files are compiled with /clr. We want to be able to load the application without .NET...
5
by: bonk | last post by:
I have a plain unmanaged exe (no /CLR) that is supposed to to use classes from a mixed mode dll (dll that uses .NET internally). That dll only needs to expose unmanaged interfaces (classes and/or...
0
by: AG | last post by:
Hi, I have implemented the ASP.Net Ihttphandler interface. Handler references the mixed dll (both managed/unmanaged code) that contains core C++ classes wrapped under managed c++ wrappers....
7
by: Kevin Frey | last post by:
Using .NET 1.1. We have a mixed-mode assembly written in Managed C++ that we are using from an ASP.NET application that has been coded using C#. The mixed-mode assembly has its own...
0
by: emu | last post by:
Hi All, I have an unmanaged C++ application that references a mixed mode image DLL (mixed managed and unmanaged). Under .NET 1.1 we could trust the dll (the mixed mode dll) by running the...
1
by: aircraft | last post by:
Hi folks, I'm trying to load a mixed mode dll from a native c++ application using loadLibrary. If I run the application from the local drive it works without any problem, byt il I run it from the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.