Hello May I consult you how did u solved this problem? I have the similar problem [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool _B_B(byte O1, byte O2, byte O3, byte O4, byte O5); private IntPtr hMod; private _B_B funA; if (chk = (hMod = LoadLibrary("my.dll")) != IntPtr.Zero) if (chk = (pFunc = GetProcAddress(hMod, "funA")) != IntPtr.Zero) funA = (_B_B)Marshal.GetDelegateForFunctionPointer(pFunc, typeof(_B_B)); private void button_Click(object sender, EventArgs e) { bool chk = false; byte temp1 = 1, temp2 = 0, temp3 = 15, temp4 = 45, temp5 = 90; try { if (!(chk = funA(temp1, temp2, temp3, temp4, temp5))) MessageBox.Show("set fail!"); } catch (Exception ex) { MessageBox.Show("fail!"); } }
M
Member 13260538
@Member 13260538