471,075 Members | 737 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,075 software developers and data experts.

Mixed assemblies and C#

I recently came accross an article that stated that there were
unresolved issued with calling native (i.e. "unmanaged" C++) from
managed C++.

Does anyone know what the precise details of this issue is, and if there
have been any fixes/workarounds yet?. I am using C# (VC7.1) for my
frontend, but all my logic is tied up in Win32 C (and some C++) dlls.

If I understand the issue correctly, so long as I compile the native
C/C++ Dlls with VC6 (not VC7.1), I should not have an issue, and I will
be able to wrte managed C++ wrappers around my C/C++ API without any
problems - is this a correct assesment of the issue?

Feb 28 '06 #1
2 1382
On Tue, 28 Feb 2006 10:57:01 +0000 (UTC), Ubergeek wrote:
I recently came accross an article that stated that there were
unresolved issued with calling native (i.e. "unmanaged" C++) from
managed C++.

Does anyone know what the precise details of this issue is, and if there
have been any fixes/workarounds yet?. I am using C# (VC7.1) for my
frontend, but all my logic is tied up in Win32 C (and some C++) dlls.


This issue relates to DLL containing both native C++ code and managed C++
code. You can find all the details here:
http://msdn.microsoft.com/library/de...ingProblem.asp

I don't know if this problem has been solved in .NET 2 but provided that
you are aware of it, the solution is relatively simple (and you don't
necessarily need to compile with VS 6). See the "Preparing with Current
Tools" section at the end of the article.
Feb 28 '06 #2

"Ubergeek" <fa*********@hacker.com> wrote in message
news:du**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com...
|I recently came accross an article that stated that there were
| unresolved issued with calling native (i.e. "unmanaged" C++) from
| managed C++.
|

Don't know what article you are refering to, but most of the issues with
mixed assemblies relate to the "OS loader lock" issue [1]. These issues are
taken care of in VC8.0 (vs2005).

[1]
http://msdn.microsoft.com/visualc/de...ingProblem.asp

| Does anyone know what the precise details of this issue is, and if there
| have been any fixes/workarounds yet?. I am using C# (VC7.1) for my
| frontend, but all my logic is tied up in Win32 C (and some C++) dlls.
|

http://msdn.microsoft.com/visualc/de...debgb1ldlk.asp
| If I understand the issue correctly, so long as I compile the native
| C/C++ Dlls with VC6 (not VC7.1), I should not have an issue, and I will
| be able to wrte managed C++ wrappers around my C/C++ API without any
| problems - is this a correct assesment of the issue?

I see no reason why you should compile your native C++ code with VC6 and
your managed code with VC7.1, compile all your code using 7.1 (or better
8.0). Anyway, you should read the articles pointed to by the links in order
to understand what mixed mode DLL's and EXE's really are, but when using
VC7.1 to build your managed wrappers, you are almost certain to generate
mixed mode assemblies, so you need to know how to handle mixed mode issues
in managed C++, by reading this:
http://support.microsoft.com/?id=814472

Willy.
Feb 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Bern McCarty | last post: by
3 posts views Thread by Steve McLellan | last post: by
1 post views Thread by Colin Desmond | last post: by
8 posts views Thread by Edward Diener | last post: by
6 posts views Thread by AG | last post: by
5 posts views Thread by =?Utf-8?B?aWduaGVucnk=?= | last post: by
reply views Thread by leo001 | last post: by

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.