[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Function prototype definition

Posted on 2008-10-15
1
Medium Priority
?
497 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

649 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