|
anilaabc wrote: it donot sleep for fix interval
What do you mean by that exactly ?
|
|
|
|
|
Sleep() do not sleep for specified interval , it may be more than interval specified ,i tested several time.please tell me a better solution
|
|
|
|
|
anilaabc wrote: sleep for fix interval
Well, Windows is not a real-time operating system. So depending on what kind of accuracy you need, this may or may not be possible in a windows environment.
See here[^] for more info.
Calling ::Sleep() is almost always wrong.
See here[^] for more info.
I suggest you create a waitable timer, ::CreateWaitableTimer() , that your thread can wait on with ::WaitForMultipleObjects() . To get the best accuracy you can use the multimedia timers, ::timeSetEvent() and so on, and set it up to signal an event you've created that you can wait on with ::WaitForMultipleObjects() .
For more info on how to create and shut down the thread properly, and how to wait on synchronization objects inside the thread, see here[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Thanks for your help ,I will try and be back to u
|
|
|
|
|
Hello everybody,
I live in Brazil and I´m heaving problems with on a compilation C++ project. The message is:
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\atlmfc\include\atlbase.h(4575) : error C3861: '_beginthreadex': identifier not found
The header PROCESS.H be present in the main hearder file.
My problem beguns when a change my Visual Studio 5 for Visual Studio 8.
The C++ comand line is:
/GL /I "C:\Samuel\20-SOFTools\Notepad++\SOFTools" /I "..\src\WinControls\AboutDlg" /I "..\..\scintilla\include" /I "..\include" /I "..\src\WinControls" /I "..\src\WinControls\ImageListSet" /I "..\src\WinControls\OpenSaveFileDialog" /I "..\src\WinControls\SplitterContainer" /I "..\src\WinControls\StaticDialog" /I "..\src\WinControls\TabBar" /I "..\src\WinControls\ToolBar" /I "..\src\MISC\Process" /I "..\src\ScitillaComponent" /I "..\src\MISC" /I "..\src\MISC\SysMsg" /I "..\src\WinControls\StatusBar" /I "..\src" /I "..\src\WinControls\StaticDialog\RunDlg" /I "..\src\tinyxml" /I "..\src\WinControls\ColourPicker" /I "..\src\MISC\RegExt" /I "..\src\WinControls\TrayIcon" /I "..\src\WinControls\shortcut" /I "..\src\WinControls\Grid" /I "..\src\WinControls\ContextMenu" /I "..\src\MISC\PluginsManager" /I "..\src\WinControls\Preference" /I "..\src\WinControls\WindowsDlg" /I "..\src\WinControls\TaskList" /I "..\src\WinControls\DockingWnd" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_VC80_UPGRADE=0x0710" /D "_AFXDLL" /D "_ATL_DLL" /D "_MBCS" /FD /EHa /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W0 /c /Zi /clr /Gz /TP /errorReport:prompt
The link comand line is:
/VERBOSE:LIB /OUT:"Debug/notepadPlus_Debug.exe" /VERSION:1.0 /INCREMENTAL /MANIFEST /MANIFESTFILE:"Debug\notepadPlus_Debug.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /TLBID:5 /DEBUG /ASSEMBLYDEBUG /PDB:"Debug/notepadPlus.pdb" /SUBSYSTEM:WINDOWS /LTCG /DYNAMICBASE:NO /FIXED:No /MACHINE:X86 /CLRTHREADATTRIBUTE:MTA /ERRORREPORT:PROMPT comctl32.lib shlwapi.lib shell32.lib
Please, I realy need help. I did everything I know ...
Sorry by poor english
|
|
|
|
|
In the project setting make sure multithreading is enabled.
Steve
|
|
|
|
|
But Steve, i thing is alredy enable. The option /MDd don´t show it ?
Or there is other place to change ?
|
|
|
|
|
Friends, the problem remains.
Someone, can help me ?
|
|
|
|
|
Does this one[^] helps? Its more or less the same issue. Please go through the suggested solutions.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Hi I know that for setting the dialogbox exe exactly at center we have an option in the properties of the dialogbox as "Center" in "morestyles" tab but i want to set that programatically...
Can anyone suggest me the righ approach for doing that????
Thanks in advance....
|
|
|
|
|
|
Just call CWnd::CenterWindow() .
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Find the screen dimensions using GetSystemMetrics() (documentation here) with SM_CYSCREEN and SM_CXSCREEN , then use SetWindowPos() to position the window accordingly
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
In response to WM_INITDIALOG (or in an OnInitDialog() override
in MFC) you could do something like this:
CRect WindowRect;
GetWindowRect(WindowRect);
SetWindowPos(0, (::GetSystemMetrics(SM_CXSCREEN) - WindowRect.Width()) / 2, (::GetSystemMetrics(SM_CYSCREEN) - WindowRect.Height()) / 2, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: In response to WM_INITDIALOG (or in an OnInitDialog() override
in MFC) you could do something like this:
But after OnInitDialog MFC does center the dialog, so IMO we don't need to do it again. In the function _AfxPostInitDialog , a check is done to make sure that the dialog does have the center style enabled, if so a call to CenterWindow is done. But above calls will only take place if the user has not by himself repositioned the dialog.
Code looks like this...
if (!pWnd->CheckAutoCenter())
return;
pWnd->CenterWindow();
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
modified on Wednesday, August 20, 2008 12:16 AM
|
|
|
|
|
Thanks Nibu.
I thought the OP wanted to know a way to actually code it.
The OP also didn't mention MFC as far as I know - that's just the
first code I found to copy/paste, and the method names matched
the equivalent APIs.
I appreciate you pointing that out to me though
Cheers,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
How does Windows Live Messenger hide its frame like that? You press Alt and it shows. Does it SetWindowRgn around itself?
Thank you.
|
|
|
|
|
I assume that the border and caption around the window is simply removed using SetWindowLong() with GWL_STYLE
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
Yeah but hopefully they followed their own advice and used SetWindowLongPtr
led mike
|
|
|
|
|
Is that like the programming version of being politically correct or something?
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
Perspx wrote: Is that like the programming version of being politically correct or something?
No, it's more like the programming version of RTFM.
You walked right into that one.
led mike
|
|
|
|
|
I just tried that, which does work, I would just need to resize the window each time so the contents stay in same location.
What I am seeing with the Windows Live Messenger is that the caption and thickframe is just hidden.
View 1 shows that when the window is captured via ALT-Printscreen, that it is actually the full dimensions of the caption and frame. View 2 shows it with the frame in place. I was just curious how they accomplished this.
Thanks.
modified on Wednesday, August 20, 2008 7:20 AM
|
|
|
|
|
Hi all,
in my mfc dialog box application i am not handling the maximize option for the dialog box ( removed) but when I run the exe from the task manager I can maximize the dialog box....
How can I handle this so that I can give a message to the user saying this feature is not supported instead of maximizing the dialog box..
The problem if maximized is all my controls gets to one corner of the window and I want to avoid this...
please help me out in solving this bug....
Thanks in advance....
|
|
|
|
|
Interesting - I can't get my MFC dialog app to maximize
or minimize from the task manager
Have you tried adding a WM_SYSCOMMAND handler, something like this?
void CMyDialog::OnSysCommand(UINT nID, LPARAM lParam)
{
if((nID & 0xFFF0) == SC_MAXIMIZE)
return;
CDialog::OnSysCommand(nID, lParam);
}
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
The code which u have suggested works fine if we want to handle the maximize button placed for a dialog box...
But in my application i am placing only the minimize button so no way user has a chance to maximize the dialog box......but there is one way through wichi a user can maximize the dialog box...that is using the task manager...when u run the application....go to the task manager then right click the exe running in the task manager u have the options of Minimize and Maximize along with someother options.....
I want to handle that maximize.....
|
|
|
|