Hi, ich habe hier 2 funktionen, eine in VBA geschreiben die andere in Visual Studio 2005.
zuerst die in VBA:
[CODE]
Option Compare Database
Private Declare Function GetLicenceCode Lib "KeyGenDLL.dll" (ByVal appID As Integer,ByVal id As String) As String
Private Sub Befehl0_Click()
Dim str As String
str = GetLicenceCode("0", "32324234")
MsgBox (str)
End Sub
[/CODE]
als ausgabewert kommt nichts zurück.
jetzt die in VS2005:
[CODE]
Module Module1
Public Declare Function GetLicenceCode Lib "KeyGenDLL.dll" (ByVal appID As Integer, ByVal id As String) As String
Sub Main()
Dim str As String
str = GetLicenceCode(0, "32324234")
System.Console.WriteLine(str)
End Sub
End Module
[/CODE]
Hier funktionierts und der ausgegebene wert ist gleich dem gewünschten wert.
achja, beide dlls sind genau identisch.
noch vielleicht als anhang dazu, die entsprechende stelle in der dll sieht etwa so aus:
[CODE]
char result[] = "Hello world";
char* _stdcall GetLicenceCode(int appID, char *id)
{
RMDstring(appID, id, res);
return result;
}
[/CODE] |