Announcement

Collapse
No announcement yet.

DLL problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DLL problem

    I'm trying to wrap a bunch of functions from my app into a
    DLL. I can compile my DLL and my main app (sans original
    functions which were ported to the DLL). I've got a function
    in my DLL declared as:

    Code:
    SUB MyFormat( BYVAL StringPtr AS BYTE PTR, BYVAL Value&) EXPORT
    In my main app, I've got a DECLARE for it like so:

    Code:
    DECLARE SUB MyFormat LIB "ipsl1.DLL" ALIAS "MyFormat" ( BYVAL StringPtr AS BYTE PTR, BYVAL Value&)
    When I try to execute the main app, I get two error messages.
    The first is "A device attached to the system is not functioning."
    The second is "<YourApp> is linked to missing export <DLL>:MyFormat."
    <> = paraphrased

    What am I doing wrong?



    ------------------
    Bernard Ertl
    Bernard Ertl
    InterPlan Systems

  • #2
    In you dll try this instead ...

    SUB MyFormat Alias "MyFormat" ( BYVAL StringPtr AS BYTE PTR, BYVAL Value&) EXPORT

    ------------------
    dickinson.basicguru.com
    Don Dickinson
    www.greatwebdivide.com

    Comment


    • #3
      The first is "A device attached to the system is not functioning."
      No idea sorry - make sure everything is plugged in <grin>
      The second is "<YourApp> is linked to missing export <DLL>:MyFormat."
      Shouldnt your declare for "MyFormat" be "MYFORMAT"? (as DLL function names are case sensitive, and PB compilers always compile exported functions to uppercase for some reason)
      eg. DECLARE SUB MYFORMAT LIB "ipsl1.DLL" ALIAS "MYFORMAT" ( BYVAL StringPtr AS BYTE PTR, BYVAL Value&)

      Best regards,
      Wayne


      ------------------
      -

      Comment


      • #4
        Actually, if you change the function name to be all upper-case in the dll, you won't need the alias - that's the other (less preferred in my opinion) way to do it.
        --Don

        ------------------
        dickinson.basicguru.com
        Don Dickinson
        www.greatwebdivide.com

        Comment


        • #5
          Thanks Don,

          That appears to have solved the problem.



          ------------------
          Bernard Ertl
          Bernard Ertl
          InterPlan Systems

          Comment

          Working...
          X