Re: oracle forms ffi problem invoking a c++ dll

From: Arti Potnis <artpot78_at_yahoo.com>
Date: 8 Aug 2004 22:59:20 -0700
Message-ID: <ece8ea46.0408082159.362095d5_at_posting.google.com>


Frank Piron <empty_at_zero.nil> wrote in message news:<opsca4ifttm0et4w_at_news.online.de>...
> Hi,
>
> Am 6 Aug 2004 03:18:38 -0700 schrieb Arti Potnis <artpot78_at_yahoo.com>:
>
> > Hi,
>
> ...
>
> >
> > 3)The Form has an associated PL/SQL Library, "LIB_002", which has a
> > package "FORMSAMPLE". This package has a function "WRITEFILE" which
> > invokes the dispatcher function "dispatcher_writefile" which in turn
> > makes a call to the function writefile() present in the dll.
>
> > 4)The Form has a Command Button. On clicking this button a trigger is
> > invoked. This trigger has a call to the FORMSAMPLE.WRITEFILE function
> > in the library "LIB_002". When I try to compile this trigger I am
> > getting the above mentioned error.
>
> Check and try the following:
>
> 1)
> Check if you have only o n e version of LIB_002.pll on your HD
>
> 2)
> Check if FORMSAMPLE.WRITEFILE compiles. If necessary compile the
> Libray with <CTRL> + k. S a v e the library.
>
> 3)
> Detach and reattach the library.


Hi,

Thanks for your reply

I tried all your suggestions but am still getting the same error.

There is only one version of LIB_002 on my HD. Tried to compile FORMSAMPLE.WRITEFILE, but am getting the error. "Error 201 at line .. col ..
identifier FORMSAMPLE.WRITEFILE needs to be declared" Tried detaching and reattaching the library, this didn't help. pls find below the entire code for reference.  



contents of LIB_002
PACKAGE FormSample IS
  FUNCTION writefile RETURN PLS_INTEGER; END;
PACKAGE BODY FormSample IS
  lh_UsingFFI ORA_FFI.LIBHANDLETYPE;
  fh_writefile ORA_FFI.FUNCHANDLETYPE;   

  FUNCTION despatcher_writefile
  RETURN PLS_INTEGER;
  PRAGMA INTERFACE(C, despatcher_writefile, 11265);   

  FUNCTION writefile RETURN PLS_INTEGER IS   retval PLS_INTEGER;
  BEGIN
   retval := despatcher_writefile();
   RETURN (retval);
  END;      BEGIN

   lh_UsingFFI := ORA_FFI.FIND_LIBRARY('UsingFFI.dll');
   lh_UsingFFI := ORA_FFI.LOAD_LIBRARY (NULL,'UsingFFI.dll');
   fh_writefile := ORA_FFI.REGISTER_FUNCTION (lh_UsingFFI,
'writefile', ORA_FFI.C_STD);

   ORA_FFI.REGISTER_RETURN (fh_writefile, ORA_FFI.C_INT); END FormSample;  

contents of the smart trigger associated with when_button_pressed in the form
DECLARE
x PLS_INTEGER;
BEGIN
 x := FORMSAMPLE.WRITEFILE; /*---error is at this line*/  IF x = 0 THEN
 MESSAGE ('Did not work :(');
 ELSE
 MESSAGE ('It worked... yippiee :)');
 END IF;
END;  



[Quoted] After compiling the library LIB_002, I observed that there is no FORMSAMPLE package created in the database under the user which I used to connect thru form builder. could this be the reason?If yes, how do I get the package created?

Thanks
Arti Received on Mon Aug 09 2004 - 07:59:20 CEST

Original text of this message