I use c++ dll in Unity3D progect. It`s important to use **CharSet = CharSet.Ansi**
[DllImport("Exchange3D", EntryPoint = "GetElementValue", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
private static extern double fnGetElementValue(int nType, int nNumber, string strPointName);
**strPointName** is sent to dll. But dll receives it in incorrect format. In Unity Project!
But I create C# Console Application with the same code and all are working!
Any ideas?
↧