Announcement

Collapse
No announcement yet.

PB DLL->Delphi3

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

  • PB DLL->Delphi3

    How to import a PB DLL in Delphi3 ?
    Maybe some person can help me ?
    Thank you

    Rolf

  • #2
    You import a PB DLL in Delphi3 just as you would import any other DLL. You start out by creating an import unit that tells Delphi what functions are provided by the DLL. Let's use a simple PowerBASIC DLL for an example:
    Code:
    $COMPILE DLL "AddOne.dll"
    FUNCTION AddOne ALIAS "AddOne" (BYVAL x AS LONG) EXPORT AS LONG
       FUNCTION = x + 1
    END FUNCTION
    The source for your 32-bit Delphi unit will look something like this:
    Code:
    unit AddOne;
    
    interface
    
       function AddOne (x: LongInt): LongInt; stdcall;
    
    implementation
    
       function AddOne; external "AddOne.dll";
    
    end.
    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment

    Working...
    X