Re: pass a String from Delphi DLL to Oracle...

From: (wrong string) é <tdevalle_at_hotmail.com>
Date: Tue, 16 Apr 2002 14:16:00 +0200
Message-ID: <3cbc161e$0$6955$ba620e4c_at_news.skynet.be>


I know there are some problems with string datatype in DLL's with Delphi. Try to user PChar instead.
"Peter Valencic" <peterv_at_in2.si> wrote in message news: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 Tue Apr 16 2002 - 14:16:00 CEST

Original text of this message