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

War diese Antwort hilfreich?

 Artikel drucken

Lesen Sie auch

wordpress jquery

Posted by Seeking Knowledge, 10-16-2012, 08:43 AMHi there, I'm facing a problem with few...

Brand new spam attacks - Seems like an emergency

Posted by ub3r, 03-18-2007, 04:12 PMThis afternoon I noticed a pattern of spam on several...

Need Script for small business.

Posted by brandonsky47, 11-09-2012, 04:20 AMHello, I need a script for my business, either free...

VB question

Posted by hopesfall, 03-10-2010, 12:42 AMI have a string of asterisks "*****" which are in...

EMC / SAN HD Ready

Posted by ti_nhatrang, 04-15-2007, 03:33 AMHi guys, I've purchased AX150/EMC SAN from DELL......