Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionC++, RealTime Scheduler in Operating System Pin
Kevin Stlip17-Nov-12 16:10
Kevin Stlip17-Nov-12 16:10 
AnswerRe: C++, RealTime Scheduler in Operating System Pin
Richard MacCutchan17-Nov-12 21:46
mveRichard MacCutchan17-Nov-12 21:46 
Questionporting my device driver 32 bit to windows 7 64 bit Pin
navn199116-Nov-12 22:03
navn199116-Nov-12 22:03 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
jschell17-Nov-12 5:52
jschell17-Nov-12 5:52 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
WebMaster23-Nov-12 4:50
WebMaster23-Nov-12 4:50 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
Software_Developer17-Nov-12 5:52
Software_Developer17-Nov-12 5:52 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
navn199118-Nov-12 21:54
navn199118-Nov-12 21:54 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
Software_Developer19-Nov-12 0:15
Software_Developer19-Nov-12 0:15 
Yea. You must.

Be careful when performing unsigned and signed operations. Consider the following:

ULONG x;
LONG y;
LONG *pVar1;
LONG *pVar2;

pVar2 = pVar1 + y * (x - 1);

The problem arises because x is unsigned, which makes the entire expression unsigned. This works fine unless y is negative.

In this case, y is converted to an unsigned value, the expression is evaluated using 32-bit precision, scaled, and added to pVar1.

On 64-bit Windows, this 32-bit unsigned negative number becomes a large 64-bit positive number, which gives the wrong result.

To fix this problem, declare x as a signed value or explicitly typecast it to LONG in the expression.
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
navn199121-Nov-12 2:40
navn199121-Nov-12 2:40 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
WebMaster23-Nov-12 4:51
WebMaster23-Nov-12 4:51 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
WebMaster23-Nov-12 4:50
WebMaster23-Nov-12 4:50 
QuestionMemory usage Pin
john563215-Nov-12 21:48
john563215-Nov-12 21:48 
AnswerRe: Memory usage Pin
Orjan Westin15-Nov-12 23:23
professionalOrjan Westin15-Nov-12 23:23 
AnswerRe: Memory usage Pin
David Crow16-Nov-12 2:27
David Crow16-Nov-12 2:27 
AnswerRe: Memory usage Pin
Rolf Kristensen16-Nov-12 3:30
Rolf Kristensen16-Nov-12 3:30 
AnswerRe: Memory usage Pin
Arun S J18-Nov-12 18:13
Arun S J18-Nov-12 18:13 
Questioninterp project in 64bit system Pin
Dang Vu Tuan15-Nov-12 21:46
Dang Vu Tuan15-Nov-12 21:46 
AnswerRe: interp project in 64bit system Pin
Richard MacCutchan15-Nov-12 23:57
mveRichard MacCutchan15-Nov-12 23:57 
QuestionSql server Database BackUp Pin
shibashish mohanty15-Nov-12 20:06
shibashish mohanty15-Nov-12 20:06 
AnswerRe: Sql server Database BackUp Pin
Richard MacCutchan15-Nov-12 23:55
mveRichard MacCutchan15-Nov-12 23:55 
AnswerRe: Sql server Database BackUp Pin
André Kraak16-Nov-12 0:48
André Kraak16-Nov-12 0:48 
QuestionNeed help compiling Pin
xLeonx15-Nov-12 8:51
xLeonx15-Nov-12 8:51 
AnswerRe: Need help compiling Pin
jeron115-Nov-12 9:51
jeron115-Nov-12 9:51 
QuestionRe: Need help compiling Pin
David Crow15-Nov-12 10:34
David Crow15-Nov-12 10:34 
QuestionRe: Need help compiling Pin
CPallini15-Nov-12 23:09
mveCPallini15-Nov-12 23:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.