|
Yes, you can use CWnd.
- NS -
|
|
|
|
|
Probably the best way to go for that is to create a SDI application and draw on the view directly. I think there is an example in the MSDN about a very simple paint program (you'll have to search for it because I don't remember where it was, I think it was called scribble example).
|
|
|
|
|
U can use Rectangle(CDC, rect).. functions from SDK to draw the images....
|
|
|
|
|
I think it can help you
http://www.codeproject.com/miscctrl/diagrameditor.asp
- NS -
|
|
|
|
|
can't you use the <A href="">desc</A> tag when posting links ?
|
|
|
|
|
isn't there a version of the MSDN example scribble that do shape drawing ?
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
hi all,
i want to have a Ballon Tool Tip on all the Control of a Dialog. please give your suggestions.
thanks,
uday.
uday kiran
|
|
|
|
|
|
http://www.codeproject.com/miscctrl/balloonhelp.asp
- NS -
|
|
|
|
|
Hi all,
Could anybody suggest me a simple method to make a number always odd?
For eg.
Suppose a = 14. After conversion it should be 13.
If it is 13 it should be remain as same.
Thank you.
- NS -
|
|
|
|
|
Assume you have got the number in an int:
int oddNumber = 14;
oddNumber |= 1;
or, as in your question (14 should be 13):
int oddNumber = 14;
oddNumber--;
oddNumber |= 1;
|
|
|
|
|
Yes I need the second one.
That's nice. Thank you.
- NS -
|
|
|
|
|
Your'e welcome.
probably it can be done like this (not tested):
int oddNumber = 14;
--oddNumber |= 1;
|
|
|
|
|
Yes it is working...
Thank you again.
- NS -
|
|
|
|
|
You are making a big assumption that the -- operator will execute before the |= operation.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
Yes, I have tested it fine.
- NS -
|
|
|
|
|
your code have one failure : negative numbers :
signed char oddNumber = -128;
--oddNumber;
oddNulber |= 1;
|
|
|
|
|
Yes, it's a fact that signed numbers do wrap, eventually.
The original question (and the answer to that specific question) said nothing about negative numbers.
If I remember it right, the question said that 14 should give 13 as output.
There was no rule for handling negative numbers.
Or do I remember it wrong?
If negative numbers doesn't matter, why waste code?
|
|
|
|
|
he didn't talk about negative numbers, but he never exlude them
using int implies that negative values are allowed (otherwise, i think he would have used unsigned ), and odd values can be also either positive or negative...
moreover, writting --oddNumber |= 1; can confuse the reader... that's why i keep militate for the if test solution...
|
|
|
|
|
As long it doesn't confuse the compiler...
|
|
|
|
|
you shouldn't think like that, simply because in your life, not only you won't always be the only one to maintain the code you wrote, but you can also badly understand what you thought beeing obvious when wrote it ; worse when it happens with someone else...
|
|
|
|
|
OK, I agree, such coding requires a good comment line to it, since the function might not be obvious to everyone.
|
|
|
|
|
I know that this code needs good documentation. But I like simple and less processor consuming codes. Further more, in my case there will not be negetive values. So I don't care about the behaviour of this logic with negetive values
- NS -
|
|
|
|
|
if (a%2==0) // number is even
a--; // make it odd
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|