-
Error during marshaling in C# project to access KONA card SDK
Hi,
We are using marshaling to call AJA Kona card’s SDK C++ functions to C#.Net
For marshaling we used the code to call functions are as below,
const string _dllLocation = @”E:\UdayWork\WpfTestCPPDLL\WpfTestCPPDLL\bin\Debug\classesDLL_64d.dll”;
[DllImport(_dllLocation, EntryPoint = “?GetDisplayName@CNTV2Card@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ”, SetLastError = true, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
public static extern string GetDisplayName();
From main app, we are accessing as,
string str = GetDisplayName();
getting error as
An exception of type ‘System.AccessViolationException’ occurred in WpfTestCPPDLL.exe and wasn’t handled before a managed/native boundaryAdditional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt
Please let us know, how to call functions from DllImport?
Regards
Uday
Sorry, there were no replies found.