Click to See Complete Forum and Search --> : How to call a DLL writen by C# in unmanaged VC++


sxshan
November 30th, 2003, 05:02 AM
up

barbiomalefico
December 3rd, 2003, 03:37 AM
A DLL Written in C# is a managed extension DLL. You could call it only in a managed code.
If you have a C++ Native code you should create a part of managed code using #pragma managed before the use of your dll
and #pragma unmanaged after.
The dll must be in the same directory of the exe or must be placed in the GAC.
you should use #using directive to load the DLL (#using "myDll.dll").
You couldn't put a C# class as a member of any of your unmanaged class. but you can allocate a managed class directly in the code of your member functions.

Ciao