Announcement

Collapse
No announcement yet.

C calling woes

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

  • C calling woes

    Hi folks,

    Am calling a function in C.

    DWORD functioninc (DWORD PTR count,DWORD id)

    The function (functioninc) returns a DWORD.

    It takes as input the "id" variable, also as a DWORD.

    Now, here's the tricky part: It should also return a DWORD PTR to the variable "count".

    I've tried doing this by specifying it as "BYVAL" or "BYREF" or DWORD PTR in Powerbasic, but no matter what I do, the "count" variable returns zero.

    Anyone have any tips?

    Thanks,
    - Jakob



    [This message has been edited by Jakob Faarvang (edited May 09, 2003).]

  • #2
    It's byref i think.
    You can try ByVal Varptr( nCount)
    This will send the pointer and the call can set the variable.


    ------------------
    http://www.hellobasic.com
    hellobasic

    Comment


    • #3
      Thanks

      - Jakob

      Comment


      • #4
        The standard passing convention in C/C++ is "BYVAL" and the
        standard calling convention is "CDEL" in PB.

        Make sure your function calls in PB match C/C++!!!!

        Cecil

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

        Comment

        Working...
        X