473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1484
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

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...
9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
3
by: Steve McLellan | last post by:
Hi, Sorry for the long post, it's a bit epic (and sums up the last 10 hours of my life, apart from my car's gearbox melting). We've got a mixed C++ assembly that's exhibiting odd behaviour...
1
by: Colin Desmond | last post by:
I have a dll assembly compiler with the /clr flag as it contains ref classes and traditional style C++ classes. I want to write unit tests for the ref classes in that assembly. VS2005 allows me...
8
by: Edward Diener | last post by:
By reuse, I mean a function in an assembly which is called in another assembly. By a mixed-mode function I mean a function whose signature has one or more CLR types and one or more non-CLR...
1
by: bvisscher | last post by:
I posted this recently in microsoft.public.vc.language and was redirected here. I also searched this ng and found some relavant threads. The most relavent I found was: ...
6
by: AG | last post by:
I am working on a web app using both C# and VB. Yes, there is a reason for it. All the code behind is C#. In the web.config I have the following <compilation debug="true">...
5
by: =?Utf-8?B?aWduaGVucnk=?= | last post by:
I have a managed C++ project and two C# projects. All are class library projects. The C++ project links with native C++ static libraries and references to one C# project. The projects structure...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.