Hallo zusammen,
ich habe eine DLL in C++, die eine Struktur enthält und diese an VB übergeben soll.
DLL-Code:
struct EDGE {
double a;
double b;
} edge1;
EDGE _stdcall transfer(double Zahl1, double Zahl2)
{
edge1.a = Zahl1 + 1;
edge1.b = Zahl2 + 3;
return edge1;
}
Das Beispiel ist sehr einfach, aber mir geht es wirklich nur darum zu verstehen, wie ich aus C++ eine Struktur übergeben kann.
Der VB-Code sieht folgendermaßen aus:
Public Structure myStruct
Dim x As Double
Dim y As Double
End Structure
Public Declare Function transfer Lib "Strukturuebergabe.dll" (ByVal Zahl1 As Double _
, ByVal Zahl2 As Double) As myStruct
sub irgendwas()
Dim Kante As myStruct
Kante = transfer(10, 15)
MsgBox(Kante.x)
end sub
Kann mir da irgendjemand bei helfen? Bin für jede Anregung dankbar.
Grüße,
Stevie
ich habe eine DLL in C++, die eine Struktur enthält und diese an VB übergeben soll.
DLL-Code:
struct EDGE {
double a;
double b;
} edge1;
EDGE _stdcall transfer(double Zahl1, double Zahl2)
{
edge1.a = Zahl1 + 1;
edge1.b = Zahl2 + 3;
return edge1;
}
Das Beispiel ist sehr einfach, aber mir geht es wirklich nur darum zu verstehen, wie ich aus C++ eine Struktur übergeben kann.
Der VB-Code sieht folgendermaßen aus:
Public Structure myStruct
Dim x As Double
Dim y As Double
End Structure
Public Declare Function transfer Lib "Strukturuebergabe.dll" (ByVal Zahl1 As Double _
, ByVal Zahl2 As Double) As myStruct
sub irgendwas()
Dim Kante As myStruct
Kante = transfer(10, 15)
MsgBox(Kante.x)
end sub
Kann mir da irgendjemand bei helfen? Bin für jede Anregung dankbar.
Grüße,
Stevie
Zuletzt bearbeitet: