Re: Problem with the foreign function interface of ORACLE FORMS

From: David Sopsick <dsopsick_at_mitre.org>
Date: Fri, 11 Dec 1998 11:09:57 -0500
Message-ID: <367143D5.D0FEB983_at_mitre.org>


I believe Developer has a problem with the way it handles memory for parameters passed to a DLL in that it only allocates enough memory to handle the current size of the parameter; not the declared size. If the DLL passes back more characters in a VARCHAR than the variable had on input to the routine, then you get corruption. Try initializing all IN/OUT parameters that are VARCHAR to the full declared size.

Example:

   x VARCHAR2(5) := 'a';
   y VARCHAR2(5) := 'aaaaa';

If both are passed as in/out params to a DLL, the DLL better return only one character in X. It can return upto five characters in Y.

Dave Sopsick

Holger.Wierschin_at_bim-consulting.de wrote:
>
> Hi folks,
>
> I have a problem with the foreign function interface of ORACLE FORMS
> for
> 3GL routines in a dynamic link library. My current ORACLE FORMS
> version
> is 4.5.7.15.6 .
>
> I use a DLL with some C-functions included in my forms application via
> ORA_FFI-package.
> Sometimes but not every time I get a general protection fault of the
> F45DBG32.exe during the
> execution of a DLL-function. The general protection fault comes with
> following informations:
>
> F45DBG32.exe
> general protection fault (0xc0000005), adress: 0x77f7cc66
>
> If there is someone who knows this problem or who can give me a
> workaround
> please let me know. Perhaps there are conflicts in memory usage
> between the
> C-function and the forms-debugger. What can I do to solve this
> problem?
>
> Best regards
>
> Holger Wierschin
Received on Fri Dec 11 1998 - 17:09:57 CET

Original text of this message