have a look at the
PInvoke Interop Assistant [
^] it'll help you.
For the header you provided the toolkit generated this C# code:
[System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.StdCall)]
public delegate void fStatusCB([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string serial, byte status, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string message);
[System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.StdCall)]
public delegate void fIrSentCB([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string serial, byte status);
[System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute(System.Runtime.InteropServices.CallingConvention.StdCall)]
public delegate void fIrReceivedCB([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string serial, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string irCode);
public delegate void fCCFLearnCB([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string serial, int progress, [System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string ccf);
public delegate void fDigitalIOCB([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string serial, byte cmd, byte val);
public partial class NativeMethods {
[System.Runtime.InteropServices.DllImportAttribute("<unknown>", EntryPoint="pir_open")]
public static extern void pir_open(fStatusCB statusCB, fIrSentCB irSentCB, fIrReceivedCB irReceivedCB, fCCFLearnCB CCFLearnCB, fDigitalIOCB digitalIOCB) ;
[System.Runtime.InteropServices.DllImportAttribute("<unknown>", EntryPoint="pir_learnCCF")]
public static extern void pir_learnCCF([System.Runtime.InteropServices.InAttribute()] [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string serial, byte state) ;
}
remember to replease the
"<unknown>"
string with the name of your library file.