Re: Problemas with ORA_FFI

From: Duncan Mills <drmills_at_uk.oracle.com>
Date: Thu, 27 Jan 2000 18:49:53 -0000
Message-ID: <86q3ok$qj7$1_at_inet16.us.oracle.com>


Without seeing the C function prototype it's a bit of a guess, but the chances are the fourth parameter is declared as char* right (or LPSTR whatever),
You have declared the PL/SQL package implimentation as IN OUT VARCHAR2 which is correct, but when you register the parameter you've used ORA_FFI.C_CHAR -Wrong it should be C_CHAR_PTR

--
Regards
Duncan Mills
Oracle Enterprise Internet Tools - Product Management
Felipe Diniz <fdiniz_at_sendas.com.br> wrote in message
news:08f6992b.d25a2b70_at_usw-ex0110-076.remarq.com...

> Hi,
>
> I'm trying to work with a C foreign function in Forms 4.5
> (win95), and i always get GPF on
> DE15W32.DLL. I've tried everything i could think of, but
> none worked. Could someone give me a help?
>
> Below is the code, and after it the GPF:
>
> package body cheque is
> arq_dll varchar2(15) := 'dllname.dll';
> lib_handle ora_ffi.libhandletype;
>
> function ff_ler_cheque(ff_handle in ora_ffi.funchandletype,
> timele in out pls_integer,
> tambuff in pls_integer, lpappbuff in out varchar2)
> return pls_integer;
> pragma interface(c, ff_ler_cheque, 11265);
>
> function ler_cheque(lpappbuff in out varchar2) return
> pls_integer is
> func_ler_cheque_handle ora_ffi.funchandletype;
> w_lpappbuff varchar2(1024) := lpappbuff;
> w_timele pls_integer := 10;
> w_tambuff pls_integer := 0;
> retorno pls_integer;
>
> begin
> func_ler_cheque_handle := ora_ffi.register_function
> (lib_handle,'functionname');
>
> if (ora_ffi.is_null_ptr(func_ler_cheque_handle)) then
> message(ââ,¬ËoError: ora_ffi.register_function ler_chequeââ,¬â"¢);
> raise form_trigger_failure;
> end if;
>
> ora_ffi.register_return(func_ler_cheque_handle,
> ora_ffi.c_long);
> ora_ffi.register_parameter(func_ler_cheque_handle,
> ora_ffi.c_long);
> ora_ffi.register_parameter(func_ler_cheque_handle,
> ora_ffi.c_long);
> ora_ffi.register_parameter(func_ler_cheque_handle,
> ora_ffi.c_char);
>
> retorno := ff_ler_cheque(func_ler_cheque_handle, w_timele,
> w_tambuff,w_lpappbuff);
>
> lpappbuff := w_lpappbuff;
>
> return(retorno);
>
> end;
>
> begin
>
> lib_handle := ora_ffi.load_library(null, arq_dll);
>
> if (ora_ffi.is_null_ptr(lib_handle)) then
> message('Error: ora_ffi.load_library cheque');
> end if;
>
> end;
>
>
> The GPF returned is:
>
> F45DBG32 - invalid page fault on DE15W32.DLL _at_
> 0137:00a20249.
>
>
>
> Any help would be aprreciated.
>
> Thanks,
>
>
> Felipe Diniz
>
>
> * Sent from AltaVista http://www.altavista.com Where you can also find
related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
Received on Thu Jan 27 2000 - 19:49:53 CET

Original text of this message