?
Solved

Function prototype definition

Posted on 2008-10-15
1
Medium Priority
?
493 Views
Last Modified: 2013-12-14
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

0
Comment
Question by:xtran888
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 19

Accepted Solution

by:
alb66 earned 1000 total points
ID: 22738211
int nRet = (int)::InterlockedCompareExchange((LONG*)pI, (LONG)nNew, (LONG)nOld);
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question