Difficulty With C++ Dll in C# Unity 3D Uses
I am having trouble marshalling data between a C# Unity 2D application and an existing C++ DLL.
// ============================================================================
// "General Output" Function (GPO)
// ============================================================================
bool _GetFPGAOCount(unsigned char *ucCount);
bool _SetFPGAOIdx(unsigned long uIdx, bool bFlag);
bool _SetFPGAOAll(bool bFlag);
bool _SetFPGAOutput(unsigned long ulData1,unsigned long ulData2);
bool _GetFPGAOIdx(unsigned long uIdx, bool *bFlag);
bool _GetFPGAOutput(unsigned long* ulData1,unsigned long* ulData2);
// ============================================================================
// "General Input" Function (GPI)
// ============================================================================
bool _GetFPGAICount(unsigned char *ucCount);
bool _GetFPGAIIdx(unsigned long uIdx, bool *bFlag);
bool _GetFPGAInput(unsigned long* ulData1,unsigned long* ulData2);
// Set debounce time
bool _SetFPGAIHWDebTime(unsigned long uIdxGroup, unsigned long time);
My Unity C# Example
[DllImport(pluginName, EntryPoint = "_SetFPGAOAll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
private static extern bool SetFPGAOAll(bool bFlag);
public void OnBnClickedButtonSetAll()
{
SetFPGAOAll(true);
}
Please need any help for converting
Read more here: Source link