How to call/load .net dll(C#) from c++ code?

Posted by TajByte, 03-22-2007, 04:50 AM
How to call/load .net dll(C#) from c++ code?

Posted by cis4life, 03-24-2007, 02:11 PM
first you will have to add the dll as a ref. in your "Reference" area of VS.Net then, lets say in the dll the namespace is MyNameSpace and the class is MyClass, then you would write MyNameSpace.MyClass myObj = new MyNameSpace.MyClass(); (This can vary if you have an overloaded constructor and so forth) This will create a new MyClass Obj named 'myObj'. Now you can call that objects functions by writing... myObj.MyFunction(); Its kind of hard to explan without seeing the dll, also remember that only 'public' classes, functions, and variable can be used, if you defined them in your code as 'private' you won't have access to them directly. Cedric

Cette réponse était-elle pertinente?

 Imprimer cet article

Consultez aussi

CNAME or A record in DNS Zone?

Posted by olddocks, 01-14-2008, 08:14 AMi have just created a dns ZONE for my domain, but i dont...

Scheduling Software

Posted by raulgonzalez, 01-15-2008, 07:30 PMHello, Does anyone know of an opensource software...

.htaccess to *.com/index.php/example

Posted by shally87, 03-12-2010, 02:36 PMI am using wordpress and currently i have problem with...

iFrame keeps opening a new windows onlick

Posted by bambinou, 11-06-2012, 11:29 AMHello, I am totally lost with this one. I have an...

remote reboot, how?

Posted by selbach, 05-06-2007, 07:59 AMnow, ive been looking at this but cant find out how to do...