Welcome to Clarion Community Sign in | Join | Faq

Clarion Language and Runtime Library

Started by johannesb at 04-18-2008 1:29 PM. Topic has 0 replies.

Print Search
Sort Posts:    
   04-18-2008, 1:29 PM
johannesb is not online. Last active: 10/19/2008 10:18:42 PM johannesb

Top 50 Posts
Joined on 02-07-2006
Posts 12
Protyping External Delphi DLL in Clarion
Reply Quote
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 
Clarion Communi... » Clarion » Clarion Languag... » Protyping External Delphi DLL in Clarion

Powered by Community Server, by Telligent Systems