Hallo,
ich versuche, bisher leider ohne Erfolg, eine DLL einzubinden und deren Methoden zu übernehmen.
Die DLL hängt unten an.
Der akuelle Versuch:
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47:
| using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices;
namespace USBBoardTest { public partial class Form1 : Form {
[DllImport("K8055D_C.dll")] public static extern int OpenDevice(long CardAddress);
[DllImport("K8055D_C.dll")] public static extern void CloseDevice();
[DllImport("K8055D_C.dll")] public static extern void SetDigitalChannel(long Channel);
[DllImport("K8055D_C.dll")] public static extern void ClearDigitalChannel(long Channel);
public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { OpenDevice(0); }
private void button2_Click(object sender, EventArgs e) { CloseDevice(); }
private void button3_Click(object sender, EventArgs e) { SetDigitalChannel(1); }
private void button4_Click(object sender, EventArgs e) { ClearDigitalChannel(1); } } } |
Und der Fehler:
Wär echt klasse, wenn mir da wer helfen könnte.
Ich vermute das es einen Konfik der Datentypen ist, weiß aber nicht, wie ich in die DLL reinschauen kann und anschließend das Problem bei mir im Projekt beheben kann.
Es gibt
hier auch noch eine Projektseite des Boards und der DLL.
Moderiert von
Christian S.: Inline-Anhang auch inline eingefügt 