|
soongez wrote: TRACE(L"converted %d\n",_tstof(token));
Wait, so you already have your double in a string but you first want to convert to a float and then back to a string... Why don't use the string directly ?
|
|
|
|
|
Thanks the %f worked, but I used _tstof because the other double converters would give me errors such as cannot convert CString to char* because 'line' was a CString and I couldn't change it to char* when using ReadLine. I'm still pretty poor in using pointers etc.
The TRACE is just to test if the output is correct, it will be used somewhere else later in the program.
cheers.
|
|
|
|
|
Hi all,
I have created a dialog box with blue background color. i want to change the background color of message box too in that dialog.How to add background image to a message box?
Thanks,
|
|
|
|
|
AFAIK you cannot do that with standartd message boxes: you've to roll your own version of.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Of course you can !
simply subclass it
|
|
|
|
|
How do you 'subclass' the MessageBox function?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Do you need to handle the WM_CTLCOLORDLG message?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Do you mean message box as in MessageBox(), or message box as in an IDC_STATIC text control?
|
|
|
|
|
Hi
Can Context menu be system modal, so that if any tool tip appears,it should display behind my context menu not above it...
Thanks
|
|
|
|
|
1/ I doubt it.
2/ How long is this menu appearing for? Yikes...
3/ If there was an answer, how long before your competitor says "Can I make my tooltip system modal, so no menu appears on top of it?"
Point 2 is the main one - a menu is a temporary thing.
If you *really* want to do your thing, make a window with lines of text that disappears when you click on one. You don't have to actually use the menu functionality of windows. It will be more work, but tough. You want something way aways from the norm, you have to do it manually.
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
const char* str = "C:\\Documents and Settings\\Test\\TestData";
int i = sizeof(str);
i always 4. why?
|
|
|
|
|
KASR1 wrote: const char* str = "C:\\Documents and Settings\\Test\\TestData";
int i = sizeof(str);
i always 4. why?
Because str is a pointer and with sizeof(str) , you're NOT finding the length of the string that str is pointing to.
If you need the length of the string, use strlen (or yet better use TCHAR and _tcslen )
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
i have replaced with strlen() it works fine.
|
|
|
|
|
Aside of what Rajesh R Subramanian suggested you can also try:
const char str[] = {"C:\\Documents and Settings\\Test\\TestData"};
int i = sizeof(str);
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Code-o-mat wrote: const char str[] = {"C:\\Documents and Settings\\Test\\TestData"};
No need for curly braces here.
|
|
|
|
|
But they don't hurt either.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
str is a char*, and a pointer has always a size of 4 bytes. sizeof returns the size of the pointer in this case, not the content. As Rajesh mentioned, you should use strlen instead.
|
|
|
|
|
You can try:
const char str[] = "C:\\Documents and Settings\\Test\\TestData";
int i = sizeof(str);
The difference is the name of array and the pointer.
|
|
|
|
|
goonyangxiaofang wrote: the difference is the name
funny.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Why funny?
This is the first time I come here.So maybe my answer is wrong or stupid, but please do not laugh at me.
|
|
|
|
|
Because the sentence "The difference is the name of array and the pointer" is actually funny.
Your answer is neither wrong nor stupid: it's just imprecise in a funny way: I'm laughing at it, not at you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi
I want to implement the feature "Show In Groups" (Arrange Icons By -> Show In Groups)in the MSF( Please visit to link http://www.codeproject.com/KB/shell/msf3.aspx? for more details). Please help me how can I implement this feature?
Regards,
-Gurjant
|
|
|
|
|
gurjant singh wrote: I want to implement the feature "Show In Groups" (Arrange Icons By -> Show In Groups)in the MSF
Since you already have the link to the creator of MSF (posted in bold rather than as a link[^], you know where to look.
|
|
|
|
|
Hi to All,
Could anyone please tell me, in which case program can be crush before main. And most importantly, how do we handle that?
thanks in advance
-----------------------------
I am a beginner
|
|
|
|
|
If you have global objects in your program their constructor runs before main gets executed and if these perform something ugly then your program will crash before hitting main. And you handle it by not doing anything that causes your program to crash. What do you mean by "How we handle that"?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|