|
A bit more tuned one.
string str1="true";
string str2="false";
bool str;
str = str1 == "true";
Thanks & Regards,
Jijo.
________________________________
http://weseetips.com - Visual C++ technical tips.
|
|
|
|
|
Jijo raj wrote: // The == operator already return bool.
Good point, you're right.
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
|
|
|
|
|
Thanks Pallini.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
like this:
|\ /| 2
| \ / |
| V |
|
|
|
|
|
not really sure I know what you're asking ...
a 'string' is just a sequence of characters - to display/render that string as output you could use a RTF text control or similar - then you might either be able to display a superscript character if there's any char-sets that support it, or use font-size properties, ie a big-font and a little font
you could look at something like http://www.codeproject.com/KB/static/xhtmlstatic.aspx[^]
for example, in which case your string is
"M<SUP> 2 </SUP > "
just had another thought, again, it depends on what you're doing with this string of characters. But you could use "M^2" where the understanding is that '^' means to the power of ..
'g'
|
|
|
|
|
Can I encode it in a CString object?
|
|
|
|
|
Like this: "m²" ?
Use charmap.exe to get the superscript "2".
|
|
|
|
|
Yes, can't encode it in a CString object?
I tried to copy m² to my program, it doesn't work, coz the source file is not unicode, and the project's compilation option is for string is MBCS .
|
|
|
|
|
OK, try this:
CString str = _T("m\xB2");
Edit: I just realised that this only works for CP1252 locale (English, German, French, etc.).
modified on Saturday, May 24, 2008 7:03 AM
|
|
|
|
|
Thanks very much.
It's done, my app is unicode.
|
|
|
|
|
|
I have two strings and I do the following...
string old_path;
string new_path;
rename(old_path_newpath)
Doing this I get the following error. How do I overcome this error.
error C2664: 'rename' : cannot convert parameter 1 from 'class std::basic_string<char,struct std::char_traits<char="">,class std::allocator<char> >' to 'const char *'
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
</char></char,struct>
THANKS
|
|
|
|
|
try :-
rename(old_path.c_str(), new_path.c_str() );
notice the c_str() - that effectively gives you a const char * from the string
Im presuming rename(old_path_newpath) was a typo ..
'g'
|
|
|
|
|
Except this error you can use of SHFileOperation instead rename.
|
|
|
|
|
if he cant figure out how to use a relatively simple API like rename(), do you honestly think he's going to be able to figure out SHFileOperation ?
I dont think so ...
(even I use a wrapper class around SHFileOperation to make it simpler)
'g'
|
|
|
|
|
No my answer was genraly SHFileOperation is better than rename not for solve problem.
|
|
|
|
|
I have both VC++ 3.0 and 5.0.
When I compiled a program wit 6.0 it asked for "MMSYSTEM.LIB".
Does VC++ 6.0 have a "MMSYSTEM.LIB" file? VC++ 3.0 does have the file but it is only for 15 bit applications.
Bob Macklin
Seattle, Wa.
|
|
|
|
|
|
|
With VC++ 5.0 I had to manually point the compiler ti "winmm.lib" when in DEBUG mode. Then the application ran as expected.
But when I ran the compiler in RELEASE mode it bitched because it could not find "MMSYSTEM.LIB". So I copied "WINMM.LIB" to "MMSYSTEM.LIB" and it compiled fine. But the application hung on one of the functions provided by "WINMM.LIB" when executed. The function that hung was "waveInStart()".
So this says the problem is in VC++ 5.0.
I can live with this problem by leaving the app in DEBUG mode.
Thanks for the help.
Bob Macklin
Seattle, Wa.
|
|
|
|
|
You have to point the linker for both configurations (Debug and Release) to "winmm.lib". Copying "WINMM.LIB" to "MMSYSTEM.LIB" does not make sense.
|
|
|
|
|
There is no "mmsystem.lib" shipping with VC6. Maybe you're confusing this with "mmsystem.dll" which is part of Windows?
|
|
|
|
|
I have had this system for 10 years and I have never found out how to modify the link list in the IDE.
|
|
|
|
|
Hello everyone!
It's been a while since I had to bother you guys with such a noob question, but I couldn't find an answer anywhere.
I want to have two MFC dialog windows open at the same time, both usable by the user. I don't mind using threads.
Any hints? Thanks in advance.
Windows Calculator told me I will die at 28.
|
|
|
|
|
You should use Modeless dialog boxes
Mukesh Kumar
Software Engineer
|
|
|
|