Announcement

Collapse
No announcement yet.

Currency value passed from PBDLL5 to VB6

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

  • Currency value passed from PBDLL5 to VB6

    When I call my test function in PBDLL5 that converts a string to a currency value, VB6 displays the number differently.

    The sample PBDLL code quite correctly displays "[email protected] = 7484.5".
    In VB, however, fnCVC produces the value "3435973.8368".

    Is there an obvious reason why I don't get the correct number passed back?


    PowerBasic Code:

    FUNCTION fnCVC EXPORT AS CURRENCY
    LOCAL Value$, [email protected]

    [email protected] = 7484.5
    Value$ = MKCUR$([email protected])

    MSGBOX "[email protected] = " + format$(CVCUR(Value$))


    FUNCTION = CVCUR(Value$)
    END FUNCTION


  • #2
    If I am reading the help files correctly, then you should try this.
    In VB currency is actually a Quad Integer that is biased by 10,000 when converted to a string.
    In PB currency is a BCD number.

    Joe Murphy

    Comment


    • #3
      Dave..

      Although I don't have time to check this. Try changing your function in PB to CUR not CURRENCY which is the correct syntax for PB ...

      FUNCTION fnCVC EXPORT AS CUR



      -------------
      Jim..
      [email protected]
      Jim..

      Comment

      Working...
      X