|
|
if u want it to be on top alwayz....then u can find that option in the dialog properties(check the modal option).....
if u want it to be dynamic(that is made on top when the user clicks that option).....
try using this command.....
this->SetWindowPos(&CWnd::wndTopMost ,rect1.left,rect1.top,rect1.right-rect1.left,rect1.bottom-rect1.top, SWP_SHOWWINDOW);
well i hope that helpz.....
happy programmin.....
cheerz.....
|
|
|
|
|
max_gundam15 wrote:
How to make my dialog box always display on top?
On top of what, all other windows in your application (this is a modal dialog), or all windows in general (this is a system model and is used only in extreme cases)?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Hi everybody,
i've been having a strange behavior of the sscanf() function, which i replaced then by atof() (that works fine now).
i would like to repport this here to see if anyone has already encountered this before, and if any explaination was posted...
here is a sample of the code :
CString strVersion = <font color=#808080>"2.05"</font>;
<font color=#0000FF>double</font> dVersion = 0;
<font color=#008000>
sscanf(strVersion, <font color=#808080>"%f"</font>, &dVersion); <font color=#008000>
dVersion = atof(strVersion); <font color=#008000>
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
As indicated by the "%f", dVersion should be declared as a float and not as a double .
|
|
|
|
|
false.
%f is for both floats ans doubles
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
You can either change dVersion to a float (not recommended), or change the format specifier to use "%lf" instead. In either case, the third parameter being passed to sscanf() must be a pointer to dVersion .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
DavidCrow wrote:
In either case, the third parameter being passed to sscanf() must be a pointer to dVersion.
yes, sorry, i forgot it while writing my post...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
Wouldn't that be akin to driving a brad with a sledge hammer?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Why? lexical_cast is intended exactly for such scenarios. All he needs to do is to include a header file and then to use it like:
double dVersion = lexical_cast<double>("2.5");
Much easier than sscanf and atof, isn't it? Not to mention that it throws in case of error, unlike atof which returns 0
|
|
|
|
|
How is
double dVersion = lexical_cast("2.5"); any easier than
double dVersion = atof("2.5"); The former requires at least another header file while the latter does not.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
For one thing, there is only one lexical_cast and for each type of conversion (string to float, string to int, int to float...) you have a different version of ..to.. function.
But, even more important, atof is simply broken. Consider:
int i = atoi (argv[1]);
if (i == 0)
{
}
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
The concern was which statement easier to use in a specific context, not which was better adept at error handling or which was more robust.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i don't want to "do myself a favor", for the only reason that i don need it.
my problem is very simple, but i can't figure it out by myself for now...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi Everybody,
In my application, i want to erase the particular rectangle area in the client area. I tried using "InvalidateRect()" function. But finally i got the result as erasing of whole screen. Please give some suggestions regarding that.
Actually when we call InvalidateRect function, it invokes the OnPaint() method. In OnPaint() method how can we get the rect region that specified in InvalidateRect() ?
Regards,
Prakash.
A Journey of thousand miles must begin with a single step.
|
|
|
|
|
.....well.....
hmmm.....
when u give the InvalidateRect command.....it implies invalidate the whole area.....since
InvalidateRect()----------->meanz....Invalidate(TRUE);
try using.....
Invalidate(FALSE); //THIS ONLY UPDATES THE CHANGES.....NOT THE WHOLE SCREEN.....
hope that helpz.....
happy programmin.....
cheerz.....
|
|
|
|
|
i hope to display messageBox in the way of "always on top", that is - HWND_TOPMOST.
do you know how to do that?
if no, is there another easy-to-use dialog similar to MessageBox which can be displayed "always on top"?
thx
includeh10
|
|
|
|
|
You can make a messagebox stay on top by adding the attribute MB_SYSTEMMODAL.
Short example :
LPCTSTR lpszText = "my message text ....";
UINT nType = MB_OK | MB_SYSTEMMODAL;
UINT nIDHelp = 0;
int iResult = AfxMessageBox( lpszText, nType, nIDHelp );
|
|
|
|
|
System-modal message boxes should be used sparingly (e.g., use them to notify the user of serious, potentially damaging errors that require immediate attention) because all applications are suspended until the user responds.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
I want to implement RSA coding in my programm, but it deals with VERY BIG INTEGERS, so i want to find any library to work with that big integers...
|
|
|
|
|
What are "VERY BIG INTEGERS?" Is 264 not large enough?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
No, it will not be enough, i want to use big integers not 32 bits, or 64 , i want to use 100MB integer, so....
|
|
|
|
|
What does 100MB integer mean?
I have seen classes that deal with 128bit integers but that is as far as I have seen them. Basically they are based on two 64bit integers.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fruity and sweet. I'm jelly, what am I? Muse on it further, I shall return! - David Walliams (Little Britain)
|
|
|
|
|
Antony M Kancidrowski wrote:
What does 100MB integer mean?
Whew, for a minute there I thought a new number was being invented. Glad I'm not the only one that needed clarification.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|