Announcement

Collapse
No announcement yet.

CDECL / SDECL

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

  • CDECL / SDECL

    Hi, all --

    I built wrappers to call COM-functions (STDMETHOD).
    Because no. of parameters is different, I wrote separately, for example,
    for 3 oarameters
    Code:
       Declare Function tCOM_Method3 (ByVal pInterface As Dword, _
          ByVal p1 As Dword, ByVal p2 As Dword, ByVal p3 As Dword) As Dword
       Function COM_Method3 (ByVal pInterface As Dword Ptr, ByVal Offset As Dword, _
          ByVal p1 As Dword, ByVal p2 As Dword, ByVal p3 As Dword) As Dword
           Dim pp As Dword Ptr
           Dim lResult As Dword
           pp = @pInterface + Offset
           Call Dword @pp Using tCOM_Method3(pInterface, p1, p2, p3) To lResult
           Function = lResult
       End Function
    4 parameters
    Code:
       Declare Function tCOM_Method4 (ByVal pInterface As Dword, _
          ByVal p1 As Dword, ByVal p2 As Dword, ByVal p3 As Dword, ByVal p4 As Dword) As Dword
       Function COM_Method4 (ByVal pInterface As Dword Ptr, ByVal Offset As Dword, _
          ByVal p1 As Dword, ByVal p2 As Dword, ByVal p3 As Dword, ByVal p4 As Dword) As Dword
           Dim pp As Dword Ptr
           Dim lResult As Dword
           pp = @pInterface + Offset
           Call Dword @pp Using tCOM_Method4(pInterface, p1, p2, p3, p4) To lResult
           Function = lResult
       End Function
    Not a serious problem, but looks very stupid. Any ideas ?

    ------------------
    E-MAIL: [email protected]
Working...
X