pass a String from Delphi DLL to Oracle...

From: Peter Valencic <peterv_at_in2.si>
Date: 3 Apr 2002 05:51:53 -0800
Message-ID: <16290d4d.0204030551.3e3c2cdd_at_posting.google.com>


Please help:

I have done a DLL in Delphi and I don't know how to pass a String function to Oracle Form Builder..
For Integer functions works fine but if I like to return String It not works.

look at delphi function:



function getStr(): wideString; stdcall;

    Begin

        getStr:='ok';
   end;
exports getStr;


in my Pl language I have declared package body and package spec.. like this:

--spec:

 function getStr return varchar2;

--body:



 function private_getStr(fhandle ora_ffi.funcHandleType) return varchar2;
 pragma interface(C,private_getStr,11265);  

 function getStr
 return varchar2 is
 begin

         return (private_getStr(l_fhandle_4));
 end;



begin
	l_libHandle:=ora_ffi.load_library('e:\perodll\','Project2.dll');
	-- getSTR
	l_fhandle_4:=ora_ffi.register_function
l_libHandle,'getStr',ora_ffi.c_std);
	ora_ffi.register_return(l_fhandle_4,ora_ffi.c_char); // I have try
also ora_ffi.c_char_ptr

end;


What I'am doing wrong?? If I call message(IN2_DLL.getStr) the application exit from Runtime to Form Builder... Received on Wed Apr 03 2002 - 15:51:53 CEST

Original text of this message