C++ DLL Problem
-
Matthias_199 -
31. Januar 2011 um 23:02 -
Erledigt
-
-
Also mit VC++ funktioniert zumindest meine Lösung aus #14 mit static
-
Krass autoit findet jetz die func nicht also poste ich mal den moentanen status.
autoitcode:
[autoit]$return = DllCall ( "Project1.dll", "str", "DLLversion")
[/autoit]
If @error Then
MsgBox(0,"","Fehlercode : "&@error)
Else
MsgBox(0,"",$return[0])
EndIfDLL Code:
C
Alles anzeigen#include <stdio.h> #include <conio.h> #include <vcl.h> #include <string> #include <iostream> using namespace std; #pragma argsused int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved) { return 1; } //--------------------------------------------------------------------------- string sDLLversion = "0.0.0.1"; extern const char* DLLversion(void) { return sDLLversion.c_str(); }
DEF Datei
-
-
-
Teste mal ein __declspec(dllexport).
-
und ohne .def-Datei.Wenn das nicht geht, ist vielleicht als Standart __stdcall eingetragen. Dann brobier mal
-
Marthog: __stadcall + DEF-Datei ist meiner Meinung nach die beste Lösung. cdecl geh zwar auch, aber stdcall ist sauberer finde ich.
-