Calling a class in C# in a dll from C++.net

  • Thread starter Thread starter Kenric Li
  • Start date Start date
K

Kenric Li

Hello,

May I know how I can call a calss from a dll implemented by C#, from Visual
C++.net? There is no header file that comes with it. But a documentation
with the list of the class methods is available.

Regards,

Kenric
 
Kenric said:
Hello,

May I know how I can call a calss from a dll implemented by C#, from
Visual C++.net? There is no header file that comes with it. But a
documentation with the list of the class methods is available.

Instead of #include-ing a header, you use #using:

#using "c-sharp-assembly.dll"

See the documentation for "Managed Extensions for C++" for the syntax
extensions used to deal with GC classes in C++.

-cd
 
Thanks.

I have tried and I can query the methods in the code. However, when I run
to link to that dll by calling some basic method without any parameters, I
have the following errors:

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in
Unknown Module.

Additional information: File or assembly name MPU-L465, or one of its
dependencies, was not found.

Are there any dependent module I need not include for such call?

regards,

KenricCarl Daniel [VC++ MVP]
<[email protected]>
 
Back
Top