Document-ID:        31362.1
Subject:            Common Errors in ORA_FFI
Author:             DKLEIN
Last Modified:      17 Jan 96 


PDE-DFF004 error even when function exists.
-------------------------------------------

The error

PDE-DFF004 Can't find function {functionname} in library {libraryname}

is generated at runtime in connection with the ORA_FFI package even when
the function does indeed exist, but a non-printing character has slipped in
with the function name. For example, the line  

fh_GetModuleHandle := ORA_FFI.REGISTER_FUNCTION(lh_KRNL386,
'GetModuleHandle',ora_ffi.PASCAL_STD);

is fine at runtime, but not 

fh_GetModuleHandle := ORA_FFI.REGISTER_FUNCTION(lh_KRNL386,'GetModuleHandle
',ora_ffi.PASCAL_STD);

because there is a carriage return at the end of the VARCHAR2 second
parameter to ORA_FFI.REGISTER_FUNCTION. REGISTER_FUNCTION looks for a
function named "GetModuleHandle{CarriageReturn}" not "GetModuleHandle".

Beware the seemingly innocent wordwrap which conceals a carriage return!

This error can also occur if a function has not been exported in the DLL
code.

PDE DFF003 Cannot open library {*.DLL} even when DLL exists
-----------------------------------------------------------
Situation: ORA_FFI calls to a DLL which does a LoadLibrary to another DLL,
and that does a LoadLibrary to another, and that does to another, etc. etc.

All these DLLs have to be in either: \windows\system, the current working
directory, or the DOS search PATH - if the very last one can not be found
as it's not in one of the above, then Forms will report that the first DLL
could not be found (PDE DFF003 error).

Again Watch out for line wrap in the middle of the ora_ffi.load_library() call.