C# dll export

  • Thread starter Thread starter Klaus
  • Start date Start date
K

Klaus

Hi there,
I have a C# project which export into a class library (with a multilevel
namespace) then I would like to use this library in a ansi c file - if
neccessary via a cpp file.

I would like to link it explicit using the function LoadLibrary and then
using the function GetProcAddress. The loading of the dll is going fine but
to get the address pointer is not possible...

Can I export my C# function to be used in such a way? I see that you have a
DLLImport attribute do you have a DLLExport possbility?

Best regards,
Klaus Nielsen
 
Hi Klaus,

It is just not possible the way you suggest. You should create your class
library enabled for COM interop by applying the appropriate attributes such
as ComVisible and enabling "Register for COM Interop" in the project
properties. Then you will be able to consume the functionality implemented
in the class library like that of any other COM component on your system.
 
No you can't do this.
Your only option is to author a managed wrapper class using managed
extentions for C++ (ME C++).

Willy.
 
Back
Top