Thanks we got an idea. but this doesn't work on class ,string and structures how can this be used for those data types Regards Srini
S
Sriinii
@Sriinii
Posts
-
__gc* equivalent in VC++ 2005 -
How to pass reference parameter to unmanaged dllHi I have a function in unmanaged(VC++) dll which is accepting a refernce parameter
void check(UInt32& c) { c=20; }
I want to call this function from my managed code(C#) so i used the following codeclass Program { [DllImport("samp.dll")] public static extern void check(ref UInt32 c); static void Main(string[] args) { UInt32 s = 0; check(ref s); Console.WriteLine(s.ToString ()); Console.ReadLine(); } }
but it shows me the error"Unable to find an entry point named 'check' in DLL 'samp.dll'." is there any way to call a unmanaged dll's function(which has reference parameter) from managed code without using DLL import?? if yes please send me a sample code. Thanks in advance Srini