04-18-2008, 1:29 PM
|
johannesb
Joined on 02-07-2006
Posts 12
|
Protyping External Delphi DLL in Clarion
|
|
|
|
|
Hi
How to solve this?
When returning (C)Strings (i.e. references to strings) I get a wrong result or the application terminates (disappears).
Here is an example:
!inside global map:
MODULE('OziAPI.lib') !OziExplorer (Delphi)
!Delphi: function oziGetExePath(var p:pchar;var DataLength:integer): integer; stdcall; external 'oziapi.dll';
!VB: Declare Function oziGetExePath Lib "oziapi" (ByRef Data As String, ByRef DataLength As Long) As Long
!Doc: function oziGetExePath(var Path:pansichar;var DataLength:integer):integer;stdcall;
oziGetExePath PROCEDURE( *CSTRING Path, *LONG DataLenght ),LONG,RAW,PASCAL,DLL(dll_mode)
END
!WindowManager.Init
oziGetExePath( LOK:OziSti, LOK:OziStiL)
IF LOK:OziStiL > 0
OziSti = LOK:OziSti[1:LOK:OziStiL]
END
The *CSTRING returns address of some garble, the *LONG returns the address to the correct value
Other API commands (without strings) works like a charm but none with strings.
Any clues?
Regards,
Johannes
|
|
|
|
|
Report
|
|
|
|