2 Replies Latest reply: Nov 20, 2012 1:33 AM by Motorolo RSS

    Using WEBUTIL_C_API to call C functions [SOLVED]

    Motorolo
      Hello,

      I'm trying to migrate some forms from 6i to 11g and I'm replacing ORA_FFI commands by WEBUTIL_C_API commands to call C functions but when I'm calling to WEBUTIL_C_API.Invoke_Int the form inmediately close. Well... all forms close except the browser.
      Looking for the problem, I notice that if I change my C function header, it works. For example, the header of my C function is like this:

      int _stdcall Ejecutor(BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR);

      If I remove "_stdcall", calling from the form works but I don't know why.

      I would resolve just removing "_stdcall" but I need it because I call this function from a Word document macro too and if I remove this, the call from Word doesn't work.

      Anybody knows how can I resolve this?

      Thanks. Sorry for my English, it isn't good.

      Edited by: Motorolo on 19-nov-2012 23:30
        • 1. Re: Using WEBUTIL_C_API to call C functions
          Michael Ferrante-Oracle
          If you have access to MyOracleSupport, refer to the folliowing note which explains your issue:
          <blockquote>(Doc ID 285331.1) JVM Crash / Exception When Calling PASCAL style Function Via WebUTIL_C_API in Forms </blockquote>
          • 2. Re: Using WEBUTIL_C_API to call C functions
            Motorolo
            Ok, I see. But I didn't find out a alternative solution to this kind of call. I finally modified my C code adding a second function like this:

            int EjecutorForms (BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR) {
            [...]
            Ejecutor(BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR, BSTR);
            [...]
            }

            EjecutorForms will be called from Oracle Forms. Its a bad solution but it works and I don't know another way to resolve it.

            However, thanks a lot Michael, your answer have been helpful.

            Regards.

            Edited by: Motorolo on 19-nov-2012 23:31

            Edited by: Motorolo on 19-nov-2012 23:32