"dotnetchic" <do********@gmail.com> wrote in message
news:11*********************@g44g2000cwa.googlegro ups.com...
| What I'm trying to do is invoke a c# dll from a c++ application. I
| don't know whether my problem is in the c# or the c++ code.
|
| My c# dll contains a public static function that I'm trying to invoke.
| However, I can't obtain a pointer to the function. Using
| AfxLoadLibrary from the c++ side, the library loads fine, but
| GetProcAddress returns null.
|
| I've been searching through documentation, but came up empty. What am
| I missing?
|
C# (or managed assemblies) cannot be loaded by LoadLibrary and family, what
you can do is build a wrapper library in C++ (mixed mode) that wraps the C#
classes and thunks the calls from C++. Yet another option is to use COM
interop to create and access your C# classes.
Check this:
http://msdn2.microsoft.com/en-us/library/ms177552.aspx for "C++
interop", I would also suggest you to post your questions to a vc NG or one
the vc forums at
http://forums.microsoft.com.
Willy.