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

Was this answer helpful?

 Print this Article

Also Read

Premature data download disconnections from server. Challanging one!

Posted by astounding, 05-06-2007, 07:41 AMHi folks, Recently our network of servers all started...

Domain parking with Win2k3 DNS??

Posted by bloodsport, 08-03-2007, 09:47 AMHi, i have about 8 different domains i'd like to point...

Lots of dedicated server problems.

Posted by erix920, 05-07-2007, 08:26 PMOur current problem is that when we try to start sshd...

DirectAdmin email forwarding not forwarding

Posted by river1, 06-30-2008, 07:20 AMI had email forwarding from a site that I am running on a...

User nobody?

Posted by BrightStar, 01-14-2008, 02:53 PMHi there, I am not quite sure but I read a tutorial...