Re: ORA_FFI newbie question

From: Bill Messick <bmessick_at_clark.net>
Date: 1997/02/05
Message-ID: <5da5hm$j2m_at_clark.net>#1/1


better5150_at_aol.com (BEtter5150) writes:

>I built a VERY simple DLL using MS Visual C++ 4.0.
>It contains 2 functions. One simply returns 1
>and the other Sleeps for a given amount of time.
 

>I am trying to call the first function from within Forms 4.5
>using the ORA_FFI built-in package. I followed the example
>code given in DLL.FMB for using foreign functions and that
>given in Ch. 6 of Procedure Builder Developer's Guide: Calling
>Functions in Dynamic Libraries.
 

>For some reason, when I try to
>ORA_FFI.LOAD_LIBRARY('c:\windows\system','mydll.dll')
>I get an unhandled exception ORA-304500. I can find no
>reference to this error code in the documentation. It won't even let
>me get to the next line of code where I check to see if
>the LOAD_LIBRARY function returned NULL.
 

>Am I doing something wrong here?
 

>Thanks for any help!

>Barry Etter
>Oracle Programmer/Analyst
>Unifi, Inc.

Oracle Support sent me a fax about this. Unfortunately, I didn't save the front page with the document number. There are two things to try. First, put this exception handler in the program unit where you call LOAD_LIBRARY: exception
  when others then
    for i in 1..Tool_err.NErrors loop

      message(Tool_Err.Message);
      Tool_Err.Pop;

    end loop;
end;

The 304500 code is a generic message, the real one is further down the message stack, which the exception handler will pop.

The other part of the solution is to not follow the examples for using ORA_FFI, but to use instead the FFIGEN form (in \orawin\forms45\demos\foreign) to generate a package with the necessary interface code. This worked for me, but I never took the time to find the differences between the generated code and the example code.

Hope this helps

Bill Messick Received on Wed Feb 05 1997 - 00:00:00 CET

Original text of this message