Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2005
    Posts
    17

    Unanswered: Unable to load symbol from DLL

    Hi,

    I want to use I DLL that I've written
    but I've got this message : 'Unable to load symbol from DLL'
    when I try running it with this command :
    exec Kapp_Shell_Package.ExecuterCommande('c:\windows\sy stem32\calc.exe')


    What is the problem ?

    (the Kapp_Shell.DLL is in %OracleHome%\ORA81\Lib)

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >What is the problem ?
    PEBKAC
    You did not correctly follow the procedures for calling an "External Procedure"
    Go to http://asktom.oracle.com & do a keyword search on "External Procedure"
    then follow his example
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2005
    Posts
    17
    My DLL is written in VB and this is the code


    Public Sub ExecuterCommande(byval strCmd as string)
    Dim nRetour as integer
    nRetour= Shell(strCmd)
    End sub

    - I've copied the DLL in %OracleHome%\Bin
    - Registered it in Regsvr32
    - Configured the External Listener in Listener.ora and TnsNames.ora
    - Runned the external listener service
    - Created a oracle package (Valid state)
    - Created the body of this package that referes to the external library (Valid state)

    And now I'm trying to run the function by
    exec Kapp_Shell_Package.executerCommande('c:\winnt\syst em32\calc.exe')

    What is missing

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    I believe in the KISS principle or first make it work, then make it fancy.
    Are you getting to the DLL? (Is the problem in the DB or the OS?)
    I'm a *nix bigot.
    When I am trying to go from the DB to the OS, my first test case is always
    env > /tmp/foo.bar
    If /tmp/foo.bar does not get created, I KNOW I did not make it out to the OS.
    If /tmp/foo.bar does get created, I get to see what environmental variables exist and what are their values.
    The environmental variables & their values determine the success or failure of the OS operations.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Feb 2005
    Posts
    17
    I've tested my DLL with an executable so I'm sure it works.
    I don't know how to test your "env > /tmp/foo.bar"

    What else do you suggest ?

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

    Are you sure your dll function is compiled with a calling convention suitable for extproc? I don't know VB, so I'm surmising some of this.

    _cdecl is the usual calling convention for extproc calls.

    _stdcall is (I think) usual for VB - you'd need to check this though, I don't use VB.

    Hope that atleast points you in some useful direction :-)
    Bill
    Please don't email me directly with questions. I've probably just got home from the pub and cannot guarantee the sanity of my answers. In fact, I can't believe I actually made it home.

  7. #7
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >What else do you suggest ?
    echo "Kilroy was here" > /tmp/foo.bar
    set > /tmp/my.env
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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