|
Hi -
My application needs to implement a command type window where you type in commands, get listings and that kind of thing. More or less exactly like what the Windows "Command Prompt" cmd.exe, or the JPSoft replacements provide.
Does anybody know of any source that's available that will save me the legwork on this? Either commercial or freeware? I'm on a tight schedule on this app and any help is much appreciated!
thanks,
- robin.
|
|
|
|
|
|
i have tried to draw image on non client area(glass effect) in windows vista aero glass view with GDI+ in MFC (included alpha channel) as suggested in one of previous article. but image gets invisible there because when i write the same code in xp it draws the image in non client area. what could be the reason for it?
|
|
|
|
|
I have a form view and i am fixing a CListCtrl on that view. I have 10 row in that list. On a certain event i want to change the color of the certain entire row. Is this possible? If yes how?
Thank you.
KIRAN PINJARLA
|
|
|
|
|
R u talking about changing the color of all rows of list ctrl or few rows?
Come online at:-
jubinc@skype
|
|
|
|
|
|
I don't remember the name of the article, but there is one very good CListCtrl here in code project that implements simple row, files, cells changing colors and a lot of additional features. Take a look in the sction MFC controls or search articles CListCtrl-related
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
You can derived CListCtrl and use of cusom message to change color of items and background.
|
|
|
|
|
Hello everyone,
When converting from size_t to unsigned int, there will be a warning message,
warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data
I do not know why, since in crtdbg.h, size_t is defined to int, right?
thanks in advance,
George
|
|
|
|
|
Plzz write the statement u've written in u'r source which is generating the warning.
Come online at:-
jubinc@skype
|
|
|
|
|
Hi Don,
I am using fread to read contents from a file and the return value is size_t. Then I need to pass the size_t value to another function which accepts unsigned int as input parameter, and this is why I need to do the type conversion.
Any suggestions to solve this issue? (which types should I convert to? Any possible lost of data?)
regards,
George
|
|
|
|
|
Pragma warning disable! It doesn't hurt when you send a size_t to an int param. You could do like (int)size_tVariableHere, when you pass size_t as an int argument. The "possible loss of data" could be about the sign information. size_t is unsigned, We can be sure size can't be in negative, so you can very well use it. It's not a problem at all.
btw : add this in your header:
pragma warning( disable : C4267 )
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
Hi VuNic,
I find even if I convert to an unsigned int, the warning message is the same. I am using Visual Studio 2003.
Do you know the reason?
regards,
George
|
|
|
|
|
I would like to tell that size_t is an unsigned int. If u convert it into int, then it may have loss of data. But as u r saying, u r sending to a function accepting unsigned int, then there should not be any warning like such.
But as u r passing the return value of fread and u won't read more than 2147483647 bytes at a time, it won't have any problem. Let the warning appear.
Come online at:-
jubinc@skype
|
|
|
|
|
Thanks Don,
I am using Visual Studio 2003. I think there should not be any warning if I convert size_t to unsigned int, but there actually a warning. Strange.
regards,
George
|
|
|
|
|
I know this was already answered but you are obviously not trying to covert it to unsigned int.. You are correct that a size_t is an unsigned int, so technically no conversion is needed. You are trying to convert an unsigned int to an it, which could result in a loss of data if the value exceeds 32,768 (3K).
In any case the ‘warning…’ means exactly what it says.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi John,
I do not know why there will be data lost if I convert size_t to unsigned int. Could you show me an example please?
(I am using 32-bit machine.)
regards,
George
|
|
|
|
|
You had me worried there for a moment – I thought I did not make it clear. No conversion is needed, the warning says you are converting it to an ‘int’ which will result in possible data loss – if and only if the value exceeds 2,147,483,647 (corrected for 32-bit integer).
The warning is not saying that you have a possible loss of data when converting to ‘unsigned int’, it says you are converting it too ‘int’, which is why the warning is occurring.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Hi buddy,
You can try that even if we convert to unsigned int, the warning message is the same in Visual Studio 2003.
Any ideas?
regards,
George
|
|
|
|
|
You are still talking about the warnings? These warnings are meant to be ignored once you know what they are warning about. I've a piece of code that uses STL Map, and when you compile, the compiler takes minutes to stop it's warning process. Where you should only use the pragma-warning-disable.
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
Thanks VuNic,
Do you think convert from size_t to unsigned int will cause data lost on 32-bit platform?
regards,
George
|
|
|
|
|
George_George wrote: Do you think convert from size_t to unsigned int will cause data lost on 32-bit platform?
You will loose if you send signed number. Ok, test it by yourself :
<br />
int nIntNeg = -100;<br />
int nIntPos = 100;<br />
size_t sz;<br />
sz=nIntPos;<br />
cout<<"\n"<<sz;<br />
<br />
sz=nIntNeg;<br />
cout<<"\n"<<sz<<endl;<br />
The point here is not about you will/will-not loose data, but it's to say that you wont get into a situation where a function would return signed number for a size_t type.
Eg:
<br />
std::string st;<br />
st="";<br />
cout<<st.size();<br />
At the worst, st's size can me only 0, can't go below that. So you get the point? size_t s are meant for unsigned data. If you send signed numbers, you WILL loose it.
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
Hi VuNic,
I can understand your points. But I am always using unsigned int. Do you think there will be any data lost if I convert size_t to unsigned int on 32-bit machine?
regards,
George
|
|
|
|
|
|
Hi Roger,
I am using 32-bit only (no 64-bit). I have read the URL from MSDN and there may be warnings when we are using 64-bit platform. But I do not know why in my 32-bit environment, there is still the warning message.
regards,
George
|
|
|
|