Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What's the UINT?

Status
Not open for further replies.

Voker57

Programmer
Feb 2, 2003
22
RU
How to get a value from UINT?
(It also is char[2] in editor)

I'm from Russia :)
 
UINT should be an "unsigned int". I dont know why you are seeing char[2] unless it was #defined somewhere else.

Matt
 
But how can I get the value from it? It returns 56 all the time! Here's the header:
void CTwsView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)


I'm from Russia :)
 
>> It returns 56 all the time!

Which one nChar, nRepCnt or nFlags? And under what conditions?


-pete
[sub]I just can't seem to get back my IntelliSense[/sub]
 
nChar. When I try to change the value it writes "Cannot convert from char[2](It's about nChar)to "Unsigned int" (it is value)"

I'm from Russia :)
 
Since you haven't posted any code I will just guess

[tt]char blah[2];
blah[0] = 'A';
blah[1] = '!';

twsView.OnChar(blah,....);[/tt]

That is so wrong I don't even know where to start. Array of chars and unsigned int are two completely different things.

>> It returns 56 all the time!
How does it return 56 all the time if the code won't even compile????

Please share some of your code with us, and maybe we can help you.

Will
 
Explanations.
onChar is a generated function so I can't change the header.
I am needing to get the value of nChar because it has the code of button just pressed. It compiles okay,but when I try to check the value so:

if (S=nChar)...

it always contains '8' (I can see it in the debugger) and the S=nChar returns 56 while it must be 0 or 1 !!!
Maybe it is buggy compiler...strange history.

I'm from Russia :)
 
Wow, this is so bad [sadeyes]
Code:
UINT nChar = 56;
UINT nX, nY;
nY = 100;

// assign the value of nChar to nX
nX = nChar;
// compare nChar and nY for equality
bool bEqual = ( nChar == nY);

-pete
[sub]I just can't seem to get back my IntelliSense[/sub]
 
>> Are you sure you don't mean (S == nChar)?]
Good idea! I'll try it.

>> Wow, this is so bad...
Yeh that is bad. I can't get the solve at the second forum!
What's the code? I don't need to change its value, just to get it!



I'm from Russia :)
 
Yeah it works!
Thanx to everybody. I have just put == instead of = and it works! What a silly.

I'm from Russia :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top