Announcement

Collapse
No announcement yet.

Help with a DECLARE

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

  • Help with a DECLARE

    OK I know this probably sounds like a really dumb question..

    I am trying to use a DLL library that I purchased to write Palm
    DB files. Unfortunatley all of the example code is in Delphi
    and I'm not sure how to translate the DECLARES to something PB
    will use. I do very little Windows programming so any help would
    be greatly appreciated (this is for PB DLL 6).

    Here is what is in the example code for Delphi:


    //------DELPHI 3.0 pdb.dll functions import---------------------------------------------------
    function PDBopen(aFileName, aCreatorID, aDatabaseTYPE, aPDBName : Pchar) : Integer ;stdcall; external 'PdbBuilder.dll';
    function PDBaddNumField(aFieldName : pchar; aFieldValue : Integer) : Integer;stdcall; external 'PdbBuilder.dll';
    function PDBaddStrField(aFieldName,aFieldValue : pchar) : Integer;stdcall; external 'PdbBuilder.dll';
    function PDBaddRecord : Integer;stdcall; external 'PdbBuilder.dll';
    function PDBbuild : Integer;stdcall; external 'PdbBuilder.dll';
    function PDBclose : Integer;stdcall; external 'PdbBuilder.dll';
    function PDBcDevelopper : Integer;stdcall; external 'PdbBuilder.dll';
    //-------------------------------------------------------------------------

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

  • #2
    Been a while since I worked with Delphi, but off the top of
    my head, it might look something like this. I know there are
    a few other Delphi users here who might be able to correct this
    if it needs it.

    Code:
    Declare Function PDBopen Lib "PdbBuilder.dll" Alias "PDBopen"(aFileName As AsciiZ, aCreatorID As AsciiZ, aDatabaseTYPE As AsciiZ, aPDBName As AsciiZ) As Integer 
    Declare function PDBaddNumField Lib "PdbBuilder.dll" Alias "PDBaddNumField"(aFieldName As AsciiZ, ByVal aFieldValue Integer)As Integer
    Declare function PDBaddStrField Lib "PdbBuilder.dll" Alias "PDBaddStrField"(aFieldName As AscciiZ, aFieldValue As AsciiZ) As Integer
    Declare function PDBaddRecord Lib "PdbBuilder.dll" Alias "PDBaddRecord"() As Integer
    Declare function PDBaddRecord Lib "PdbBuilder.dll" Alias "PDBbuild"() As Integer
    Declare function PDBaddRecord Lib "PdbBuilder.dll" Alias "PDBclose"() As Integer
    Declare function PDBcDevelopper Lib "PdbBuilder.dll" Alias "PDBcDevelopper"() As Integer
    ------------------

    Comment


    • #3
      Delphi 3.0 was a 32-bit version, yes? That will be necessary if you are to use
      the same DLL with PB/DLL 6.0, which is a 32-bit product.

      In 32-bit versions of Delphi, if I recall correctly, "Integer" is a 32-bit value
      and corresponds to a LONG in 32-bit versions of PowerBASIC.

      ------------------
      Tom Hanlin
      PowerBASIC Staff

      Comment


      • #4
        Yup, your right. It's 32 bits.


        Originally posted by Tom Hanlin:
        Delphi 3.0 was a 32-bit version, yes? That will be necessary if you are to use
        the same DLL with PB/DLL 6.0, which is a 32-bit product.

        In 32-bit versions of Delphi, if I recall correctly, "Integer" is a 32-bit value
        and corresponds to a LONG in 32-bit versions of PowerBASIC.



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

        Comment


        • #5
          Thanks, this worked perfectly.. however the tool turned out to be less than I expected! Oh well. Back to the drawing board!


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

          Comment

          Working...
          X