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

Помог ли вам данный ответ?

 Распечатать статью

Также читают

Remount back up hard drive

Posted by Peter_Net, 09-15-2007, 07:41 PMHello, I have a second hard disk for cpanel back up...

I was thinking...

Posted by Kevin Teoh, 09-21-2001, 10:05 AMI'd like a reseller account where I can give accounts...

Voxtreme Resellers

Posted by BARNE, 09-05-2002, 02:16 PMI am looking at Voxtreme for setting up a resellers account...

How Change Owner?

Posted by hichkas, 07-17-2007, 07:59 AMHi How i Can Change Owner to User! In VPS? Posted by...

Can't upload via php script

Posted by JohnDoe_Cro, 06-28-2008, 01:58 PMHello all, I am having problems on my server... I...