Announcement

Collapse
No announcement yet.

Missing Export

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

  • Missing Export

    I am attempting to access functions within a DLL which were designed for VB apps to use.

    The following declaration:

    Declare Function McastFeedVBOpen Lib "mcastfeedapi" Alias "#23" (ByVal bSingleUser As Long) As Long

    causes the diagnostic to appear:

    PBDLLTMP.EXE is linked to missing export MCASTFEEDAPI.DLL:#23

    Is this a VB / PBDLL interface glitch?

    (Although I have VB I am embarrassed to admit that my VB experience is nil as I have never used it. The box is too heavy to lift.)

    TIA

    Bern
    Bern


    http://www.insighttrader.com.au

  • #2
    Bern,

    The "#23" is the "ordinal" function number in the DLL. AFAIK, PB does not support ordinals.

    You'll need to identify the full export name of the function and amend your ALIAS clause in the DECLARE.

    ie, it may be exported from the DLL as McastFeedVBOpen, so change the declare to become:
    Declare Function McastFeedVBOpen Lib "mcastfeedapi" Alias "McastFeedVBOpen" (ByVal bSingleUser As Long) As Long

    Lance
    PowerBASIC Support


    [This message has been edited by Lance Edmonds (edited 02-11-99).]
    Lance
    mailto:lanceedmonds@xtra.co.nz

    Comment


    • #3
      Lance,

      Many thanks. Will give that a try.

      Regards,

      Bern
      Bern


      http://www.insighttrader.com.au

      Comment


      • #4
        Lance,

        Thanks for the tip. I got the real name of the function which was:

        "_McastFeedVBOpen@4". A bit difficult to guess.



        Using PBDLL I am attempting to retrieve a UDT from this DLL where the VB declaration is given as:

        Code:
        TYPE Trade
        
           szSymbol          AS STRING * 20
           dwExchange        AS LONG
           cType             AS BYTE
           lTime             AS LONG
           fPrice            AS SINGLE
           dwVolume          AS LONG
           dwTradeId         AS LONG
           szConditionsCodes AS STRING * 6
        
        END TYPE
        I had to change the first member to ASCIIZ * 20 in my PBDLL declaration so that the first member when extracted is sensible.

        The second member comes across OK as its value is 1.

        cType is fine at 78.

        But the others give silly numbers.

        Tried changing the LONG's to DWORD's without success.


        Do you have any experience in this type of interfacing? I thought that passing of UDT's between VB and PBDLL was fairly seamless apart from the string complications. They provide both a VB interface and a C interface but I got beat trying to accommodate Booleans in the C UDT's.


        Many thanks for your previous assistance,


        Bern


        PS I will really have to try to lift that box someday.
        Bern


        http://www.insighttrader.com.au

        Comment


        • #5
          bern, please review the article titled visual basic udt's and pb/dll in the frequently asked questions forum for an explanation on structure alignment methods.

          http://www.powerbasic.com/support/pb...hread.php?t=28

          lance
          powerbasic support
          Lance
          mailto:lanceedmonds@xtra.co.nz

          Comment


          • #6
            Bern, C "bool" types are 32 bits (LONG in PB).

            AFAIK, VB "bool" types are 16 bits wide.

            Lance
            PowerBASIC Support
            Lance
            mailto:lanceedmonds@xtra.co.nz

            Comment


            • #7
              Lance,

              Many thanks for that. It is already after midnight here. Must be much later for you.

              Appreciate your midnight oil.

              Regards,

              Bern
              Bern


              http://www.insighttrader.com.au

              Comment

              Working...
              X