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

Byla tato odpověď nápomocná?

 Tisknout tento článek

Také čtěte

Seeking a new host

Posted by Bloory, 08-03-2002, 12:57 PMI'm looking for a host with a maximum cost of around £35...

max_allowed_packet error

Posted by vnsg, 09-15-2007, 12:39 AMOne of my client use VBB 3.6.7 and have error when try to...

how i can stoped nailswebd

Posted by osayd, 06-29-2008, 07:06 PMHi, i need to stoped nailswebd then enable it in my server...

Resolve domains to ip

Posted by alphix, 09-21-2008, 12:33 AMHi, I'm trying to write a script that resolves a...

Database design question: Indexing

Posted by phoqoo, 01-15-2008, 12:38 PMFrom what I've read, indexing columns helps optimize DB...