I can help you with this but I need to be more clear about what you  are
doing. Also, a shameless plug but my chapter in the Wrox book below has a
lot of info on mixing managed and unmanaged code, and has a step by step
wrapping example. FWIW.

Now, right, you say creating a "Managed DLL wrapper for a DLL (c-style)." As
Jim pointed out, code that exists in a DLL, P/Invoke is the Interop method
of choice. Is this your case - you already have an existing DLL of code that
you want to call? (This is also covered in the chapter)

If you have existing C++ code, that you want to have Interop with other
managed code, then the Interop technique is to write a managed __gc wrapper
class around the C++ code. There are some gotchas that you need to pay
attention to that are beyond the scope of this email.

>assembly(viewed with ILDASM) have my namespace and the ‘std’ namespace
>and a lot of strange definitions, like the functions in the C DLL.
Do you have the std code surrounded with a pragma unmanaged?


>From: Miguel Ángel Chacón <[EMAIL PROTECTED]>
>Reply-To: dotnet discussion <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: [DOTNET] MC++ help: managed/unmanaged DLL
>Date: Wed, 24 Apr 2002 17:21:48 +0200
>
>Hi, i need some help with MC++. I´m creating a managed DLL wrapper for a
>DLL (C-style) in MC++, to use it with C#. I´m mixing managed with
>unmanaged code. There is no problem with the build time. The
>assembly(viewed with ILDASM) have my namespace and the ‘std’ namespace
>and a lot of strange definitions, like the functions in the C DLL. These
>don´t bore me initially. I create a C# windows form app, and add a
>reference to the C++ project. When I run the app, and try to load the
>assembly created in C++, a FileNotFoundException with the name of the
>assembly occurs. I look in the C# project directory and all is correct.
>What I´m doing wrong? Thanks a lot.
>
>
>You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
>subscribe to other DevelopMentor lists at http://discuss.develop.com.




---------------------
Sam Gentile
.NET Consultant
Co-author: Wrox Visual C++ .NET: A primer for C++ developers
BLOG: http://radio.weblogs.com/0105852/
http://www.project-inspiration.com/sgentile/DotNet.htm
http://www.project-inspiration.com/sgentile/
---------------------------




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to