Announcement

Collapse
No announcement yet.

Trouble linking to DLL

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

  • Trouble linking to DLL

    Hi all,

    I'm writing an application on PB5 where I'd like to use Maxim IC's 1wire bus and their USB converter, but i can't seem to link to the library. The error I get is "The procedure entry point TMREADDEFAULTPORT could not be located in the dynamic link librabray IBFS32.DLL"

    My syntax looks like this:

    DECLARE FUNCTION TMReadDefaultPort SDECL LIB "IBFS32.DLL" (PortNum AS INTEGER, PortType AS INTEGER) AS INTEGER

    LOCAL RetValue%, PortNum%, PortType%
    RetValue% = TMReadDefaultPort(PortNum%, PortType%)

    I've tried the three different call types and none worked. Just to verify I used a 3rd party program to verify the function call in IBFS32.DLL and its correct.
    Attached Files

  • #2
    See the ALIAS keyword.
    hellobasic

    Comment


    • #3
      Seems to have worked that Edwin. I used ALIAS as the exact same name.

      THANKS!

      Comment


      • #4
        If it comes up again, here is a useful utilty for you...

        (enhanced UI/ PB/Win 7x conversion by MCM
        Show exports and imports for PB/Win 6x, 7x (original by Torsten Reinow)

        That will give you the ALIAS name required (case IS signficant) for all the functions exported from any PE executable (EXE or DLL).

        I keep a link to this program on my Start/Software Development/Utilities menu.

        MCM
        Michael Mattias
        Tal Systems Inc. (retired)
        Racine WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          >here is a useful utilty for you...

          Oops, this is the PBCC forum, meaning you may not be able to compile that yourself. I'll ZIP up an EXE and attach it today or tomorrow.

          [FOLLOWUP]

          My bad, Mr. Montenigro already did that...
          http://www.powerbasic.com/support/pb...89&postcount=7

          MCM
          Last edited by Michael Mattias; 6 Apr 2009, 10:48 AM. Reason: add followup
          Michael Mattias
          Tal Systems Inc. (retired)
          Racine WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            > I used ALIAS as the exact same name.

            The thing is, the compiled result auto-UCASEs the names of any DECLARE [..] LIB or (in PB/WIN) any EXPORT function. Use ALIAS to force it to use a specific case, or a different name entirely.
            kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

            Comment


            • #7
              You mean disguise the real names of your exported functions?

              Code:
              ...
              DECLARE FUNCTION ReasonCodeLiteral   LIB "RASYS200.DLL"   ALIAS "PPPS_00041" (BYVAL hWnd AS LONG, RC AS ReasonCodeType) AS LONG
              DECLARE FUNCTION RemarkCodeLiteral   LIB "RASYS200.DLL"   ALIAS "PPPS_00043" (remarkCode AS STRING) AS STRING
              ' new function in 3.1:
              DECLARE FUNCTION GetRemarkCodeTables LIB "RASYS200.DLL"   ALIAS "PPPS_00043A" (sRCode() AS STRING, sDescription() AS STRING) AS LONG
              DECLARE FUNCTION BinaryFindStringIndex LIB "RASYS200.DLL" ALIAS "PPPS_00045" (X() AS STRING, SearchFor AS STRING, Index AS LONG) AS LONG
              DECLARE FUNCTION ClaimStatusLiteral  LIB "RASYS200.DLL"   ALIAS "PPPS_00031" (sCode AS STRING) AS STRING
              DECLARE FUNCTION FirstInstanceofProgram LIB "RASYS200.DLL"  ALIAS "FirstInstanceOfProgram" () AS LONG
              DECLARE FUNCTION ClaimHasSeparateInsured LIB "RASYS200.DLL"  ALIAS "PPPS_00602" (C AS ClaimType) AS LONG
              DECLARE FUNCTION InsuredIDString     LIB "RASYS200.DLL"  ALIAS "PPPS_00603"(C AS ClaimType) AS STRING
              DECLARE FUNCTION ClaimTTIdString     LIB "RASYS200.DLL"  ALIAS "PPPS_00609"(C AS ClaimType) AS STRING
              DECLARE FUNCTION SvcLinRendProvLit   LIB "RASYS200.DLL"   ALIAS "PPPS_00605" (S AS svclinType, sLiteral AS STRING) AS LONG
              DECLARE FUNCTION ClaimRendProvLit    LIB "RASYS200.DLL"   ALIAS "PPPS_00607" (C AS ClaimType, sLiteral AS STRING) AS LONG
              ....
              Michael Mattias
              Tal Systems Inc. (retired)
              Racine WI USA
              [email protected]
              http://www.talsystems.com

              Comment

              Working...
              X