Hi,
i'm trying to embed a c++ dll in my project. The .h file has almost completely been converted by h2pas except for the imported functions: (snippet)
typedef int (__stdcall *NxCoreCallbackAPIList) (void* pYourParam,const NxCoreAPIDLLFile* pNcTF);
typedef int (__stdcall *NxCoreListAPIDLLs) (unsigned int controlFlags,NxCoreCallbackAPIList stdcallback,void* pUserParam);
what i've rewritten to
type TAPIDLLsListCallback = function (pYourParam: pointer; pNcTF: PNxCoreAPIDLLFile) : cint;
function ListAPIDLLs (controlFlags: cchar; Callback: TAPIDLLsListCallback; pUserParam: cint) : cint; stdcall; external 'api.dll' name 'sNxCoreListAPIDLLs';
The program compiles and starts - so far so good.
if i now call
ListAPIDLLs(0, @OnListAPIDLLs, 0);
function OnListAPIDLLs (pYourParam: pointer; pNcTF: PNxCoreAPIDLLFile) : cint;
begin
ShowMessage(pNcTF^.PathnameStrZ);
OnListAPIDLLs := 0;
end;
i get exactly one result (should be about 20) and the application crashes

Does anyone see something i overlooked?
Also i found the following definition:
struct NxString {
unsigned short Atom; // unique/sequential/nonzero/constant 16 bit number assigned to the String.
char Text[1]; // array is acually [strlen(Text)+1] and directly follows Atom in memory. };
If i get it right, "Text" can be of whatever length?? Is that even replicable in pascal?
h2pas converted it to
NxString = record
Atom : cushort;
Text: array[0..0] of cchar;
end;
but i have no clue if that's ok

Greetings
icey