Ben Delphi 2010 iki yöntemle DLL inşa vardır:Çağrı Delphi DLL
function Foo1(a, b: Integer):PChar; export; stdcall;
function Foo2(a, b, c:Integer):PChar; export; stdcall;
exports Foo1, Foo2;
Her biri Result := PChar('Test')
döndürür.
Benim LoadLibrary
ve GetProcAddress
fonksiyonları tarafından başlığındaki
typedef const wchar_t* (*pFUNC1)(int a, int b);
pFUNC1 TestFoo1;
typedef const wchar_t* (*pFUNC2)(int a, int b, int c);
pFUNC2 TestFoo2;
başlatma C++ \ CLI kod
. Kullanım: TestFoo1(0,0)
ve TestFoo2(0,0,0)
;
Her ikisi de Çıkış modunda çalışır.
Ancak Hata Ayıklama modunda Foo2 iptal ediliyor.
Lütfen sorunun ne olduğunu bildirin.
bingo! işe yarıyor. Hafıza kullanım amacı için StrAlloc, StrPCopy, StrDispose kullanıyorum. – RredCat