I'm stacked in one piece of Delphi (C++ source also exists and both working) code and need some advice.
Code: Select all
;C++
;int CodexEnum(wchar_t*** CodexList, int* CodexCount);
;Delphi
;function CodexEnum(CodexList: PWideChar; CodexCount: PInteger): integer; cdecl; external 'codexdk.dll';
;wchar_t** CodexList;
;int CodexCount;
;CodexInitEnum();
;if (CodexEnum(&CodexList, &CodexCount)==stat_OK)
;for (int i=0; i<CodexCount; i++)
; wprintf(L"Codex: %s\n", CodexList[i]);
; printf("%d Codex(s) found.\n", CodexCount);
;PB
Prototype.l CodexEnum(CodexList.l, CodexCount.l): CodexEnum.CodexEnum = GetFunction(0, "CodexEnum")
Dim CodexList.s(255)
Define CodexCount.i
CodexInitEnum()
if (CodexEnum(@CodexList(), @CodexCount)=#stat_OK)
Debug "CodexCount: "+Str(CodexCount.i)
For i = 0 To CodexCount-1
Debug "List:"+Str(i)+" | "+CodexList(i)
Next
EndIf
Delphi code works and give this list but in purebasic I can't make it work.
ThanQ very much in advance