Hi all,
My program has a couple of toolbars. I want to have one toolbar float at a
point specfiied at the program start up. I wonder any one can tell me how to
do it? I do not want it dock to the FrameWnd.
Thanks GG
2. storing floating point data with using float or double - CSharp/C#
3. using cin returns a floating point overflow when entering a float
When I use cin in a program to enter a number like 1.1 it returns a floating point overflow, I'm pretty sure it has nothing to do with division by zero at least not in the code I have written, mayby it's in a lib somewhere but that doesn't make sense also I guess. I use borland C++ 5.01 and have the path installed I'm programming an Easywin appl. Since I wasn't able to install the program under XP (mayby someone knows how to do this??) I'm running it in win98se Funny thing is the compiled prog only gives the error running it under win98 under XP it works fine. So if anyone knows a. to install borland c++ under XP, or b. to prevent the floating point overflow in win98 I would be helped a lot
4. CDialog and Status Bars (and Tool bars)
Hi. When creating a status bar message and a tool-tip for a tool-bar button, you set the following string in the 'Prompt' text box : "This is the status bar for tool-bar\nThis is the tool-tip bar for tool-bar" (Note the use of the '\n' as the seperator). So, I assumed you can do the same for a menu item, right? WRONG! I only seemed to get the status bar message working. Is there a way around this? Is it supported, or is there some 'trick' I must do ? Cheers in advance... Brad.
6. Truncating decimal places in a float (possibly OT)
7. float to string to float, with first float == second float
Dear group,
I would like to serialize a float f1 to a string s, then unserialize s back to a float f2 again,
such that:
* s is minimal (use only the precision that is required)
and preferably in decimal notation,
* f1==f2 (exact same value after the roundtrip)
(The first property is for human readers and file size, the second is for data integrity.)
Here is my implementation:
std::string serialize(float f1)
{
std::string s;
for (unsigned int prec=6; prec<10; prec++)
{
std::stringstream ss;
ss.precision(prec);
ss << f1;
s=ss.str();
float f2;
ss >> f2;
if (f2==f1) break;
}
return s;
}
It seems to work very well, and I found that in my application 65% to 90% of the float numbers
serialized this way exit the loop in the first iteration.
However, I was wondering if there is a shorter and/or more elegant way of implementing this,
using either C++ streams, C printf-functions, or any other technique available in C++.
I'd be very grateful for any feedback and advice!
Thank you very much, and best regards,
Carsten
--
Cafu - The Game and Graphics Engine for
multiplayer, cross-platform, real-time 3D Action
Learn more at www.cafu.de
8. Crashing of IDE when custom desiner control is placed in tool box