Announcement

Collapse
No announcement yet.

How to declare function as LPFLOAT?

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

  • How to declare function as LPFLOAT?

    I need to declare and call a DLL and don't know how to declare
    the return type as LPFLOAT (long pointer float). Please help.

    Here is the correct C++ definition:
    LPFLOAT FindAddress_Array( LPFLOAT lpArray[ArrayPosition],INT nSpaceOfs, INT nOfs, DWORD wStartAddr, DWORD wArraySize );

    Here is what I've come up with for PBDLL:
    DECLARE FUNCTION FINDADDRESS_ARRAY LIB "elkit32.dll" (BYREF lpArray AS SINGLE, BYVAL nSpaceOfs AS INTEGER, BYVAL nOfs AS INTEGER, BYVAL wStartAddr AS DWORD, BYVAL wArraySize AS DWORD) AS DWORD

    I think it's all correct, EXCEPT for the Function type as DWORD.
    It's supposed to be a Long Pointer Float (aka Long Pointer Single).
    How do I do this?

    Thank you,
    Doug

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

  • #2
    The DWORD function return should then be a pointer to a float
    which means that you can assign the pointer to a SINGLE PTR
    as in:

    LOCAL dwReturn AS DWORD
    LOCAL sngPtr AS SINGLE PTR

    dwReturn = FindAddress_Array()
    sngPtr = dwReturn

    or more succintly:

    sngPtr = FindAddress_Array()
    IF sngPtr <> %NULL THEN ...

    Have you tried this?

    Cheers

    Florent




    [This message has been edited by Florent Heyworth (edited September 13, 2000).]

    Comment

    Working...
    X