Hi All,
I am battling with a DLL to access a USB device that is a HID rather than a Com port(!). I know I can talk to the board using the DLL as I can open the device and reset the Digital outputs on the device using the below code
[DllImport("K8055D.dll")]
public static extern void OpenDevice(int CardAddress);
[DllImport("K8055D.dll")]
public static extern void CloseDevice();
However problems abound when I try to set a Digital Channel. Using the below
private void button2_Click(object sender, EventArgs e)
{
SetDigitalChannel(0);
}
the set digital channel I have imported from the DLL with the following
[DllImport("K8055D.dll")]
public static extern int SetDigitalChannel(int ChannelAddress);
The (shudder)VB.Net (/shudder) code for this appear to be
Private Declare Sub SetDigitalChannel Lib "k8055d.dll" (ByVal Channel As Integer)
So it appears that I can import Functions but not subroutines!
Hmm?
What I have tried:
Importing as [DllImport("K8055D.dll")]
public static extern void OpenDevice(int CardAddress); for functions
similar for importing subroutines