Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Location
    Hanoi- Vietnam
    Posts
    27

    Unhappy Unanswered: Call .DLL From Oracle9i Form ?

    Sorry I have a ploblem !

    I have a file .dll and I want to call some functions from this file.
    Can you show me the way to attach and using a .dll from Oracle Form ?.

    Thank a lot !

  2. #2
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    Hi,

    1 - Tell Oracle about the DLL and where it is.
    PHP Code:
    CREATE OR REPLACE LIBRARY REGISTER_PCK AS 'C:\\ORACLE\\ORA81\\MYDLL.DLL'
    And then create a wrapper function
    PHP Code:
    FUNCTION GetCfg RETURN VARCHAR2 IS
       EXTERNAL   LIBRARY REGISTER_PCK
       NAME       
    "GetConfig"
       
    LANGUAGE   C
    "GetConfig" is a function in the DLL. The parameters and options for creating the wrapper function are very specific to what the DLL was coded in (calling convention etc) and the function parameters. Look up the specific syntax on OTN.

    You can then call the PL/SQL GetCfg function as per any other function etc.

    Hth
    Bill

  3. #3
    Join Date
    Sep 2003
    Location
    Hanoi- Vietnam
    Posts
    27

    Angry Ora_Ffi.load_library ???????????

    Thank for your help !

    I tried but not succesfull. I want to use a dll in Form9i. In this dll file have a function with a input string and return a other string. dll file is compiled from VC++.

    I have created a package following:
    /*Specification part*/
    PACKAGE PK_SHA IS
    FUNCTION SHA(str Varchar2) Return Varchar2;
    END;

    /*Package body*/

    PACKAGE BODY PK_SHA IS
    lib_hl Ora_Ffi.Libhandletype;
    func_hl Ora_Ffi.Funchandletype;

    Function F_SHA(fhandle Ora_Ffi.Funchandletype, str Varchar2)Return Varchar2;
    PRAGMA interface(C,F_SHA,11265);

    FUNCTION SHA(str Varchar2) Return Varchar2 IS
    Begin
    Return(F_SHA(func_hl,str));
    End ;

    BEGIN

    lib_hl:=Ora_Ffi.Load_Library('E:\App\HRMS\Libs\',' SHAEncode.Dll');
    func_hl:=Ora_Ffi.Register_Function(lib_hl,'SHA',Or a_Ffi.C_Std);
    Ora_Ffi.Register_Parameter(func_hl,Ora_Ffi.C_CHAR_ PTR);

    END;

    But When I call the function SHA from trigger When-button-Press

    Begin
    :BLOCK3.TXT_OUT:= PK_SHA.SHA('hungdq');
    end;

    I get a error Frm-40735 with a unhanled exception ora-304500.
    When I debug I find that following command caused below error.
    func_hl:=Ora_Ffi.Register_Functio(lib_hl,'SHA',Ora _Ffi.C_Std);

    I do'nt know Why ?
    Help me,please ! I need to solve this ploblem a lot !! Help me!!!!!!!!!!!!!
    Last edited by hungdq; 09-20-03 at 05:27.

  4. #4
    Join Date
    Nov 2002
    Location
    Desk, slightly south of keyboard
    Posts
    697
    Hi,

    That's procedure builder stuff which I'm not familiar with. I'm only familiar with the PL/SQL method..

    Sorry I can't be more help.

    Cheers
    Bill

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •