Hallo,
arbeite mich just in o.g. Materie ein.
Gibts schon IOW-Erfahrungen?
Meine VB5 Sachen laufen wunderbar, sehen nur etwas altbacken aus.
Andere Idee war, VB8-Anwendung rüberzustülpen.
Nun unterstützt VB8 (generell .NET) leider kein DDE mehr.
Clip als Übermittler geht zwar, ist aber etwas billig.
Andere Idee?
Gruß
Detlev
VB.NET 2005 (VB8 / Framework 2.0)
Moderator: Guido Körber
-
- Posts: 543
- Joined: Mon Dec 01, 2003 6:09 pm
Wir werden auf jeden Fall keine COM-Objekte als API kreieren.
VB.net kann doch unmanaged Code aka DLL einbinden. Mit dem iow.bas als Kern sollte sich das doch realisieren lassen.
Ich habe aber keine Erfahrung mit VB.net und auch keine Absicht es je zu lernen. Diese Anbindung muss daher ein User realisieren.
Inwieweit sich VB.net mit Callbacks vertraegt weiss ich nicht. Ob sich also das neue iowkit2 einbinden lassen wird, ist also noch unklar. VB6 jedenfalls funktioniert.
VB.net kann doch unmanaged Code aka DLL einbinden. Mit dem iow.bas als Kern sollte sich das doch realisieren lassen.
Ich habe aber keine Erfahrung mit VB.net und auch keine Absicht es je zu lernen. Diese Anbindung muss daher ein User realisieren.
Inwieweit sich VB.net mit Callbacks vertraegt weiss ich nicht. Ob sich also das neue iowkit2 einbinden lassen wird, ist also noch unklar. VB6 jedenfalls funktioniert.
Danke für die schnelle Nachricht.
Stehe noch völlig am Anfang.
Erster Versuch die bas einzubinden, hat zwar nach einer kleinen Modifikation geklappt. Auch der Aufruf der dll.
Dann kam aber Fehlermeldung:
>>
A call to PInvoke function 'FSS01!FSS01.modIOW::IowKitGetSerialNumber' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
<<
Das MSDN sagt dazu:
>>
The PInvokeStackImbalance managed debugging assistant (MDA) is activated when the CLR detects that the stack depth after a platform invoke call does not match the expected stack depth given the calling convention specified in the DllImportAttribute attribute as well as the declaration of the parameters in the managed signature.
Symptoms
An application encounters an access violation or memory corruption when making or following a platform invoke call.
Cause
The managed signature of the platform invoke call might not match the unmanaged signature of the method being called. This mismatch can be caused by the managed signature not declaring the correct number of parameters or not specifying the appropriate size for the parameters. The MDA can also activate because the calling convention, possibly specified by the DllImportAttribute attribute, does not match the unmanaged calling convention.
Resolution
Review the managed platform invoke signature
<<
Naja, datt wird wohl erstmal nix (?)
Gruß
Detelv
Stehe noch völlig am Anfang.
Erster Versuch die bas einzubinden, hat zwar nach einer kleinen Modifikation geklappt. Auch der Aufruf der dll.
Dann kam aber Fehlermeldung:
>>
A call to PInvoke function 'FSS01!FSS01.modIOW::IowKitGetSerialNumber' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.
<<
Das MSDN sagt dazu:
>>
The PInvokeStackImbalance managed debugging assistant (MDA) is activated when the CLR detects that the stack depth after a platform invoke call does not match the expected stack depth given the calling convention specified in the DllImportAttribute attribute as well as the declaration of the parameters in the managed signature.
Symptoms
An application encounters an access violation or memory corruption when making or following a platform invoke call.
Cause
The managed signature of the platform invoke call might not match the unmanaged signature of the method being called. This mismatch can be caused by the managed signature not declaring the correct number of parameters or not specifying the appropriate size for the parameters. The MDA can also activate because the calling convention, possibly specified by the DllImportAttribute attribute, does not match the unmanaged calling convention.
Resolution
Review the managed platform invoke signature
<<
Naja, datt wird wohl erstmal nix (?)
Gruß
Detelv
-
- Posts: 543
- Joined: Mon Dec 01, 2003 6:09 pm
Hallo,
kann ich zwar machen, aber es handelt sich ja bislang nur um ein paar Zeilen.
Ich habe ein Modul angelegt mit dem Namen modIOW.vb
Dort ist folgender Inhalt drin:
Module modIOW
(Kode der bisherigen iow.bas)
End Module
Attribute VB_Name = "iow"
habe ich erstmal auskommentiert, da VB8 Attribut (in dieser Form) nicht kennt.
Dann habe ich Form1/Button1 gemacht mit Inhalt
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dblDevice As Double
Dim bytSN(18) As Byte
MsgBox(IowKitGetSerialNumber(dblDevice, bytSN(0)))
End Sub
End Class
Das war's schon.
VB8 gibt's umsonst hier:
http://msdn.microsoft.com/vstudio/express/vb/
Ansonsten lese ich gerade diesen Artikel....
Möglicherweise ist die bisherige Funktionsaufruf-Deklarierung zu simpel?
http://www.microsoft.com/germany/msdn/l ... ework.mspx
Melde mich, wenn ich was neues weiß.
Detlev
kann ich zwar machen, aber es handelt sich ja bislang nur um ein paar Zeilen.
Ich habe ein Modul angelegt mit dem Namen modIOW.vb
Dort ist folgender Inhalt drin:
Module modIOW
(Kode der bisherigen iow.bas)
End Module
Attribute VB_Name = "iow"
habe ich erstmal auskommentiert, da VB8 Attribut (in dieser Form) nicht kennt.
Dann habe ich Form1/Button1 gemacht mit Inhalt
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dblDevice As Double
Dim bytSN(18) As Byte
MsgBox(IowKitGetSerialNumber(dblDevice, bytSN(0)))
End Sub
End Class
Das war's schon.
VB8 gibt's umsonst hier:
http://msdn.microsoft.com/vstudio/express/vb/
Ansonsten lese ich gerade diesen Artikel....
Möglicherweise ist die bisherige Funktionsaufruf-Deklarierung zu simpel?
http://www.microsoft.com/germany/msdn/l ... ework.mspx
Melde mich, wenn ich was neues weiß.
Detlev