Re: Help!!! Anyone used ORA_FFI ????????
Date: 1997/06/17
Message-ID: <33A72058.606F_at_fyiowa.infi.net>#1/1
Joe wrote:
>
> Hi,
> Anyone out there who has successful experience using ORA_FFI package in
> FORM, please help......
>
> I am trying to use ORA_FFI.LOADLIBRARY to load a unix system lib, libc.a,
> and
> it did not work at all. I also tried to link to my own share lib and it
> failed.
>
> I can't pass the ORA_FFI.LOADLIBRARY.
>
> Any ideas or helps will be appreciated.....
> PS. We are running oracle FORM on AIX 4.2
> Please e-mail to joe.kau_at_nist.gov
>
> Thank youagain.
Using ORA_FFI gave us many headaches! I hope I can help. First off, I see you typing LOADLIBRARY instead of LOAD_LIBRARY. Maybe just a typo? If so, here is an example of an ORA_FFI call we used to a PC DLL written in C. We used the FFIGEN.FMX which you should find under the <oracle_home>\FORMS45\DEMOS\FOREIGN directory. Here you declare all your calls to the library.
If all else fails, after 3 or 4 calls, we got someone in the Languages group at Oracle who was really quite good.
Good Luck.
>>>>>>>>>>>>>>>>>>>>>>>>>>>> PACKAGE BODY OPENEXCHANGE IS lh_OPNX9841 ora_ffi.libHandleType; fh_OE_AddUserVar ora_ffi.funcHandleType; fh_OE_CloseFiles ora_ffi.funcHandleType; fh_OE_CopyErrorMsg ora_ffi.funcHandleType; fh_OE_InitUserDict ora_ffi.funcHandleType; fh_OE_OpenOutFile ora_ffi.funcHandleType;fh_OE_SetVarAnyFromStr ora_ffi.funcHandleType; fh_OE_WriteRecord ora_ffi.funcHandleType;
>>>>>> snip out function declarations >>>>>>>>>>>
BEGIN
BEGIN lh_OPNX9841 := ora_ffi.find_library('OPNX32.DLL'); EXCEPTION WHEN ora_ffi.FFI_ERROR THEN lh_OPNX9841 := ora_ffi.load_library(NULL,'OPNX32.DLL'); END ; fh_OE_AddUserVar := ora_ffi.register_function(lh_OPNX9841,'OE_AddUserVar',ora_ffi.PASCAL_STD); ora_ffi.register_parameter(fh_OE_AddUserVar,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_OE_AddUserVar,ORA_FFI.C_CHAR_PTR); ora_ffi.register_parameter(fh_OE_AddUserVar,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_OE_AddUserVar,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_OE_AddUserVar,ORA_FFI.C_INT); ora_ffi.register_return(fh_OE_AddUserVar,ORA_FFI.C_INT); fh_OE_CloseFiles := ora_ffi.register_function(lh_OPNX9841,'OE_CloseFiles',ora_ffi.PASCAL_STD); ora_ffi.register_return(fh_OE_CloseFiles,ORA_FFI.C_INT); fh_OE_CopyErrorMsg := ora_ffi.register_function(lh_OPNX9841,'OE_CopyErrorMsg',ora_ffi.PASCAL_STD); ora_ffi.register_parameter(fh_OE_CopyErrorMsg,ORA_FFI.C_CHAR_PTR); ora_ffi.register_return(fh_OE_CopyErrorMsg,ORA_FFI.C_INT); fh_OE_InitUserDict := ora_ffi.register_function(lh_OPNX9841,'OE_InitUserDict',ora_ffi.PASCAL_STD); ora_ffi.register_parameter(fh_OE_InitUserDict,ORA_FFI.C_INT); ora_ffi.register_return(fh_OE_InitUserDict,ORA_FFI.C_INT); fh_OE_OpenOutFile := ora_ffi.register_function(lh_OPNX9841,'OE_OpenOutFile',ora_ffi.PASCAL_STD); ora_ffi.register_parameter(fh_OE_OpenOutFile,ORA_FFI.C_INT); ora_ffi.register_parameter(fh_OE_OpenOutFile,ORA_FFI.C_CHAR_PTR); ora_ffi.register_return(fh_OE_OpenOutFile,ORA_FFI.C_INT); fh_OE_SetVarAnyFromStr := ora_ffi.register_function(lh_OPNX9841,'OE_SetVarAnyFromStr',ora_ffi.PASCAL_STD); ora_ffi.register_parameter(fh_OE_SetVarAnyFromStr,ORA_FFI.C_INT);
ora_ffi.register_parameter(fh_OE_SetVarAnyFromStr,ORA_FFI.C_CHAR_PTR);
fh_OE_WriteRecord :=
ora_ffi.register_function(lh_OPNX9841,'OE_WriteRecord',ora_ffi.PASCAL_STD);
ora_ffi.register_return(fh_OE_WriteRecord,ORA_FFI.C_INT);
END OpenExchange; Received on Tue Jun 17 1997 - 00:00:00 CEST