解决C#调用DLL托管于非托管匹配的问题。

This commit is contained in:
TAO Cheng
2014-05-15 21:04:52 +08:00
parent e59a15b060
commit a5a196de5b
4 changed files with 61 additions and 8 deletions
@@ -49,13 +49,22 @@ namespace Sys
SSI_STATUS_MACHINE_UNINITIALIZED,
SSI_STATUS_UNKNOWN_ERROR
};
[DllImport("MachineInterfaceDll.dll")]
[DllImport("MachineInterfaceDll.dll",CallingConvention = CallingConvention.Cdecl)]
public static extern SSI_STATUS_MOTION Machine_Startup(bool bOfflineOnly, EHOME_MACHINE_MODE cHomeMachineMode);
[DllImport("MachineInterfaceDll.dll")]
[DllImport("MachineInterfaceDll.dll", EntryPoint = "Machine_Shutdown",
SetLastError = true, CharSet = CharSet.Unicode,
ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern SSI_STATUS_MOTION Machine_Shutdown();
[DllImport("MachineInterfaceDll.dll")]
[DllImport("MachineInterfaceDll.dll", EntryPoint = "Machine_GetDIO",
SetLastError = true, CharSet = CharSet.Unicode,
ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern SSI_STATUS_MOTION Machine_GetDIO(EIO_PORT Channel, ref Byte bDISts);
[DllImport("MachineInterfaceDll.dll")]
[DllImport("MachineInterfaceDll.dll", EntryPoint = "Machine_SetDO",
SetLastError = true, CharSet = CharSet.Unicode,
ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern SSI_STATUS_MOTION Machine_SetDO(EIO_PORT Channel, Byte bDOSts);
}