Link to home
Start Free TrialLog in
Avatar of xtran888
xtran888

asked on

Function prototype definition

The funciton is defined as:

LONG WINAPI InterlockedCompareExchange (
    __inout LONG volatile *Destination,
    __in    LONG Exchange,
    __in    LONG Comperand
    );

In Visual 6.0, I use it as:
      int nRet = (int)::InterlockedCompareExchange((PVOID*)pI, (PVOID)nNew, (PVOID)nOld);

Compiler has no complain.

In Visual 2005, Compiler complains as such:

1>d:\develop\3.0\commonlibs\base\asm.h(47) : error C2664: 'InterlockedCompareExchange' : cannot convert parameter 1 from 'PVOID *' to 'volatile LONG *'

What should I do?

Thanks,
XT

ASKER CERTIFIED SOLUTION
Avatar of alb66
alb66
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial