|
By doing so you would be eliminating one of the features of a modeless dialog in this context - why not just show the progress on the underlying dialog and save yourself the trouble?
Anyway, you can handle WM_MOVE on the modeless dialog, and constrain its movement to the bounds of the parent window. This will not really clip the modeless dialog, but that too is not such a good idea because you would be allowing the user to effectively hide the modeless window, again eliminating one of the basic features of a modeless dialog.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I cannot show it in underlying window because it contains big area which is useless when not working and there is not enough room in parent window for this.
I'm handling parent movement exactly as you've wrote but it allows to move it for example above right edge of parent and then move parent together with progress to right edge of desktop so progress will be hidden. I don't want to handle all such situations including minimizing window, etc.
There must be some easier sulution and I want to know it
For example WinRar shows progress this way and it looks good
rrrado
|
|
|
|
|
please don't ... me think it goes against good normal Microsoft's UI behaviour ..
BUT ... you could do something different ...
if your progress dialog is modeless and does not really show information ( apart from the progree ); add a status bar to your dialog application and and display the progress in there insted on a popup modeless dialog.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
When selecting an item in a listview I can only highlight the first item, not the entire row. Where´s the problem ?
int nItem = m_Liste.GetNextSelectedItem(pos);
m_Liste.SetItemState( nItem, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
m_Liste.EnsureVisible( nItem, FALSE);
|
|
|
|
|
Check LVS_EX_FULLROWSELECT extended style
rrrado
|
|
|
|
|
Set the LVS_EX_FULLROWSELECT extended style.
I Dream of Absolute Zero
|
|
|
|
|
Thanks for you response, but it didn´t help:
int nItem = m_Liste.GetNextSelectedItem(pos);
m_Liste.SetItemState( nItem, LVS_EX_FULLROWSELECT,
LVS_EX_FULLROWSELECT | LVIS_FOCUSED);
m_Liste.EnsureVisible( nItem, FALSE);
|
|
|
|
|
When your ListView control is first created or attached to (like in CDialog::OnInitDialog(...) ):
m_Liste.SetExtendedStyle( LVS_EX_FULLROWSELECT );
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
All right, I´ve got it. Thanks a lot.
m_Liste.SetExtendedStyle( LVS_EX_FULLROWSELECT);
POSITION pos;
pos = m_Liste.GetFirstSelectedItemPosition();
if( pos == NULL)
{
*pResult = 0;
return;
}
else
{
// Use the following to display an entire row as selected
// should you need to do so.
int nItem = m_Liste.GetNextSelectedItem(pos);
m_Liste.SetItemState( nItem, LVS_EX_FULLROWSELECT,
LVS_EX_FULLROWSELECT | LVIS_FOCUSED);
m_Liste.EnsureVisible( nItem, FALSE);
}
|
|
|
|
|
Anyone know of an easy to use timer for MFC. Just want to check the time it takes to execute two function calls.
Thanks
|
|
|
|
|
|
|
'Ya know, I never understood the use of difftime(...) in this context - time(...) uses a resolution of (whole) seconds, but difftime(...) returns a floating point value...? Has anyone ever really got a fractional value returned from that function?
Anyway, if the function being timed takes less than a second, I would think that using time(...) would be the wrong way to time it.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
James R. Twine wrote: Has anyone ever really got a fractional value returned from that function?
It's not for fractional numbers, it's the range. Remember that a time_t is (usually) a typedef'd long (not unsigned). It's possible to get a difference between two values that overflows the range of a long, necessitating a larger data type - a double . Since the typedef can change, you can't just use an unsigned long for the return value - it may give different answers if a larger data type is used for time_t . The only practical solution is to use the largest datatype possible.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
That is an excellent point that I did not consider. I have been away from 8/16-bit development for too long a time, I guess (and man, I used to LOVE Turbo C...!
Thanks for that!
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
The quick-n-dirty way is to call GetTickCount() before and after and compare the difference. However, the resolution of that function is not usually 1ms. For example, it is possible to call the function before and after a method that takes 5ms and get back a difference of 0ms one time and 15ms the next.
If you need better accuracy, I would suggest a multimedia timer or something similar.
it MIGHT help to call Sleep() right before calling into the function if you think the function executes is less than a quantum, to try to avoid a context switch while the function is executing.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
If you're doing it in the development environment, use the profiler.
If you can get it to work (I remember having some "issues"), it is much easier and more accurate than using GetTickCount, etc.
Of course, in production software this is not available.
|
|
|
|
|
Hi all:
Is there any clues to solve the ordinary differential equations in C++??? Expecially for stiff equations. If there is any code available??
Thanks in advance
Asura
|
|
|
|
|
You can purchase "Numerical recipes in C", second edition, Cambridge University press. It contains C code for the most common ODE solvers (runge kunta 4 and 5 order, Ridchardson, Rosenbrock, Adams-Bashforth, and provide solid background on the math and tricks behind. Those methods covers borh normal and stiff ODE.
Unfortunatly, they give no code for Gear like methods, wich, to my understanding, are becoming very popular to solve stiff ODE.
The other drawback is the the C coding style. I have no issue doing maths in pure C in a C++ program, as it allow more time efficient code, but the C style in the book is not very nice and readable. I advice to use it as a canvas then rewrite things yourself.
There are other sources for C or C++ ODE solvers on the net. Most are in FORTRAN, not alwways well documented, and reverse engenering to get it in C or C++ is tough.
Take a look at www.gnu.org/software/gsl, it's a mathematical librairy in the GNU project and contains sources for many ODE.
I'm looking myself for a good C or C++ GEAR code, so if you find any, let me know
|
|
|
|
|
Pls dont send me any link i have gone through them ,
I have an MFC Application .
My problem is simple that i have a document from which
in need to print . but when i print the font size change
gets small which is also visisble in the printpriview .
is there any simple way by which i can have the same
printout as it is visible in the frame window
thanx
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
In your view's OnPrepareDC() method, play around with SetMapMode() , SetWindowOrg() , SetViewportOrg() , SetWindowExt() , and SetViewportExt() . I might have left a sample in the code for this article.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
How are you creating your font for printing?
You can use CreatPointFont(), passing in the printer DC which will account for the higher DPI of the printer as compared to the screen. Or you could use CreateFontIndirect() and calculating the LOGFONT.lfHeight variable depending on the DPI of the printer
logfont.lfHeight = -MulDiv(PointSize, PrinterDC.GetDeviceCaps(LOGPIXELSY), 72);
MyCFont.CreateFontIndirect(&logfont); I can't recall where I got the MulDiv formula from, but I am sure it is in MSDN somewhere.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
I'm having the same problem.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
How can i progrmatically determine the existing drives/patitions?
|
|
|
|
|
With GetLogicalDrives(VOID) and associated APIs
~RaGE();
|
|
|
|