473,396 Members | 1,996 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,396 software developers and data experts.

Managed / Unmamaged C++

I'm trying to write a managed DLL that will wrap communications between
managed and unmanaged c++. All of the unmanaged code is lined to a static
lib. That lib contains tons of stuff like STL (which is my biggest
concern ) and other standard C lib stuff. I want to link that static lib
into the managed DLL. Is that possible?

So far I've been in linker hell and I can't think straight anymore...

Thanks,
Marcin
Jul 19 '05 #1
1 1629
In general, yes.

Managed C++ comes with a technology called IJW that basically allows you to
call any code compiled in a static lib (or in a DLL with an import lib)
without any other thunking code. There are namespace issues between the
types in Win32 and .NET, but these can be solved by careful though of how
you use using namespace. There are also issues because managed C++ does not
allow you to declare empty types, for example:

struct _HIMAGELIST;
typedef _HIMAGELIST* HIMAGELIST;

this is take from commctrl.h and is fine as unmanged C++, but it will
generate an exception at runtime because _HIMAGELIST does not have a body.
(The solution is just to declare struct _HIMAGELIST{};).

There are other issues, but it is possible to solve them.

Richard
--
my email ev******@zicf.bet is encrypted with ROT13 (www.rot13.org)
"Marcin Wieczorek" <mw********@gappowered.com> wrote in message
news:uR**************@TK2MSFTNGP09.phx.gbl...
I'm trying to write a managed DLL that will wrap communications between
managed and unmanaged c++. All of the unmanaged code is lined to a static
lib. That lib contains tons of stuff like STL (which is my biggest
concern ) and other standard C lib stuff. I want to link that static lib
into the managed DLL. Is that possible?

So far I've been in linker hell and I can't think straight anymore...

Thanks,
Marcin

Jul 21 '05 #2

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

Similar topics

1
by: Bob Rock | last post by:
Hello, in the last few days I've made my first few attempts at creating mixed C++ managed-unmanaged assemblies and looking aftwerwards with ILDASM at what is visible in those assemblies from a...
2
by: asanford | last post by:
We use StackWalk(StackWalk64) from dbghelp.dll to walk our callstacksas needed, using the various Sym* methods (SymGetSymFromAddr, SymGetLineFromAddr) to resolve source file, function name, and...
0
by: Dgdege | last post by:
Hi all, I want to wrapp an exiting API written in C++ to .NET using managed C++ extensions. I want my managed C++ class library to link with the unmanaged dll. So I don't use PInvoke for...
4
by: William F. Kinsley | last post by:
My understanding is that when I re-compile a existing MFC application with the /clr switch, that the code generated is managed(with some exceptions) but that the data isn't, i.e. not garbage...
1
by: Marcin Wieczorek | last post by:
I'm trying to write a managed DLL that will wrap communications between managed and unmanaged c++. All of the unmanaged code is lined to a static lib. That lib contains tons of stuff like STL...
9
by: Amit Dedhia | last post by:
Hi All I have a VC++ 2005 MFC application with all classes defined as unmanaged classes. I want to write my application data in xml format. Since ADO.NET has buit in functions available for...
12
by: DaTurk | last post by:
Hi, I have a rather interesting problem. I have a unmanged c++ class which needs to communicate information to managed c++ via callbacks, with a layer of c# on top of the managed c++ ultimatley...
3
by: Klaus | last post by:
Hi, I have an existing VC 6 MFC application which communicates asynchronly with a VC 2005 managed code dll. I use an unmanaged base class with virtual functions to access methods in the MFC...
8
by: Varangian | last post by:
Hello, was wondering of how to dispose of managed resources? or referencing every member of a class to null will release resources...? http://www.marcclifton.com/tabid/79/Default.aspx...
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?
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
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
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...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.