class BTS200 { [DllImport("GOMDBTS200.dll", EntryPoint = "GOMDBTS200_getHandle")] private static extern int getHandle(string device_Name, ref int _handle); [DllImport("GOMDBTS200.dll", EntryPoint = "GOMDBTS200_showConfig")] private static extern int showConfig(ref int applicationHandle, int controlBits); [DllImport("GOMDBTS200.dll", EntryPoint = "GOMDBTS200_getProcAddresses")] private static extern bool getProcAddresses(ref int p_hLibrary, string p_dllName, int p_count); static private bool hreleaseHandle; static private bool hshowConfig; string deviceName = "BTS200_1234"; int handle = -1; public int init(string dll) { _getHandle(); if (handle == 0) return 0; else { hreleaseHandle = getProcAddresses(ref handle, "GOMDBTS200_releaseHandle", 1); hshowConfig = getProcAddresses(ref handle, "GOMDBTS200_showConfig", 1); } return 0; } public int _getHandle() { getHandle(deviceName, ref handle); return 0; } public int _showConfig() { if (hshowConfig == true) { showConfig(ref handle, 0); } return 0; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)