Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: KatzYaakov on January 15, 2019, 12:12:10 PM
-
i want to add the dll for api to my c# project
but cant add
how can i do it?
-
The DLL isn't a COM object or an assembly. It is an old school (non .Net) API DLL. So you cannot add it as a reference like that. You have to use it like you would any WINAPI type DLL.
e.g. this will define mcAxisDeref()
[DllImport("Mach4Core.dll", CallingConvention = CallingConvention.StdCall)]
[return: MarshalAs(UnmanagedType.I4)]
public static extern int mcAxisDeref(
[param: MarshalAs(UnmanagedType.I4)] int mInst,
[param: MarshalAs(UnmanagedType.I4)] int axis);
Steve