|
Well, good luck!
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
[My articles]
|
|
|
|
|
I was trying to figure out your question, or even find a question mark in your post, but I couldn't.
|
|
|
|
|
Can you more explain about your question?
|
|
|
|
|
hey hi, i hav done this by setting mask and creating a regular expression and after that setting the validator.. but it shows the result as 000.000.000.000 but i need that it should be like this ( . . . )
|
|
|
|
|
Hi all ,
i m using this code for hadling keys of keyboard for TreeCtrl.
Here i m use Space key and its working fine.
if i m use VK_RETURN in place ok VK_SPACE fro enter key than its not working,the messagebox not shaw at this time.Please correct me.
CTreeCtrl trCtrl;
void CTest::OnTvnKeydownReportTree(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMTVKEYDOWN pTVKeyDown = reinterpret_cast<LPNMTVKEYDOWN>(pNMHDR);
NMTVKEYDOWN* nmkd = (NMTVKEYDOWN*)pNMHDR;
CString Tree_str;
switch(nmkd->wVKey)
{
case VK_SPACE:
HTREEITEM hItem = trCtrl.GetNextItem(TVI_ROOT, TVGN_CARET );
if (hItem == NULL)
{
AfxMessageBox(_T("There is no selected item);
}
else
{
Tree_str = trCtrl.GetItemText(hItem);
AfxMessageBox(Tree_str);
}
}
*pResult = 0;
}
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hello everyone,
My question is during system shutdown/reboot, will OS shutdown/reboot wait for all process to terminate or not? How could OS identify if a process is terminated or not?
I am suffering a problem when write event log returns 0x80004005 error in my own code when system is reboot (I monitor this reboot in Event View), I think OS should always wait for process to complete (e.g. write event log operation) before stops event log services and reboot? Maybe OS does not wait until my process completed event log write?
thanks in advance,
George
|
|
|
|
|
George_George wrote: My question is during system shutdown/reboot, will OS shutdown/reboot wait for all process to terminate or not?
The OS will ask the applications to shut down, but if they don't after a timeout they'll be killed. Surely you've seen the dialog that informs you of this? A good starting point to find out about this process is the documentation for the WM_QUERYENDSESSION[^] message.
George_George wrote: How could OS identify if a process is terminated or not?
The OS manages processes and such so it's not hard to accept it can tell when a process is done. Anyway, you can use the WaitForSingleObject[^] function to tell is a process is done yourself (amongst other methods).
Steve
|
|
|
|
|
Thanks Steve,
I have a great reading for the links you recommended. Actually, my application does not handle WM_QUERYENDSESSION and WM_ENDSESSION. In my scenario, I do not call any system API to let system reboot, and I just press the reboot button from start menu.
My questions,
1.
If my application does not handle the two message types, OS will wait for only some time before shutdown? It means OS may stop event log services rudely (not waiting for process termination) before I write event log?
2.
The WM messages are for Windows Form application (I read the document that it mentioned it sends the message to each Window)? How about a backend service without any GUI?
3.
If I handle the WM_QUERYENDSESSION message (returns TRUE), and then received the WM_ENDSESSION message from OS, then from OS point of view, it will think when WM_ENDSESSION is sent, it will believe the process is stopped (even if the process may running)?
regards,
George
|
|
|
|
|
George_George wrote: My question is during system shutdown/reboot, will OS shutdown/reboot wait for all process to terminate or not
No exactly wait but after period it kills them for example some time you see a window a it has a button "end now".
|
|
|
|
|
Thanks Hamid!
Previously, I think event log is always ready even if during system reboot/shutdown process, so write event log during system reboot never fails (event log service should be the last service which system should stop before all other processes stop). Now, the correct conclusion should be, OS does not ensure the event log service is always avaliable during system reboot?
regards,
George
|
|
|
|
|
Hi all,
i m using ShellExecute function for open an .exe file in another application, i want to close the opened exe file plz tell me which function is for this.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
In general the only way to close an application is to ask it nicely. Although you could use TerminateProcess[^] doing so could be dangerous as the application could have been in the middle of something important and "killing" it could result in corruption. See here[^] for an article on how to terminate an application "cleanly" in Win32.
Steve
|
|
|
|
|
You can send WM_CLOSE to that program with SendMessage.
|
|
|
|
|
Hi all
I have a CTI application which handles calls to a contact centre . The issue is - the exe keeps consuming more and more memory day after day . For example - at the startup the memory usage is 80 Mb . And after several calls the memory raises to 114 Mb and goes on upto 480 Mb .
My question is
- How to find out the exact piece of code which is responsible for this accumulated usage ?
- This is a VB application which uses several C# and VC++ dlls in the back ground .
Any help please ...?
regards
Kanna
|
|
|
|
|
I understood your problem.It is the problem with the Memory leak.And also with the GDI leaks..
In task manager you just enable the GDI coloum and check weather it is increasing the count.If it is increasing the count then it is a GDI leak also there.It occurs when you dinamically create the object and you r not releasing while end of the function.
Same case witht the GDI also creating pen and brushes and other GDI objects you may not be relaeasing
|
|
|
|
|
Never had any idea you could track GDI objects in the task manager. You've just helped me identify the source of a memory leak in some code I'm working on.
Thank-you pallaka - 5 points!
|
|
|
|
|
Possibly you have to check C++ DLL s for memory leaks.
The problem may arise also by means of interaction (i.e. DLL allocated memory that should be released by the caller).
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
[My articles]
|
|
|
|
|
supergravity wrote: which uses several C#
It can also be the managed heap growing without any garbage collections.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi!
I've developed a project developed under VC++. It was working fine. When I recompiled the project, the application crashed and showed me the error message, "Native has exited with code 1". After that I restarted the system and compiled my project. It worked fine for only once. Then it showed me the same error in the output window. I closed the project and tried to reopen it. It refused to open. It showed,"The application failed to initialize properly(0xc0000005). Click on OK to terminate the application. This error occurs for every VC++ project,I've developed. I'm running under Release mode. Debug has never worked for me. What might be the problem? How can I resolve this?
|
|
|
|
|
It is the problem with the registry.Ypur Visual studio registor may be corrupted.
So simply reinstall your VC++.
It will work fine
|
|
|
|
|
|
Hi All,
I derived a button class from the CButton class and it is working fine.
And I created an array of buttons dynamically the size of array is dynamic.
The issue is that I need to handle the click event of this buttons.
Can any one help me to solve this issue
|
|
|
|
|
Add ON_COMMAND_RANGE[^] macro inside the messagemap. In this macro, specify the first buttons ID as start ID and last buttons ID as end ID.
|
|
|
|
|
See here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
In MSDN6.0 it is
WINSHELLAPI <big>LPITEMIDLIST </big>WINAPI SHBrowseForFolder(<br />
LPBROWSEINFO lpbi<br />
); <br />
But in windows SDK v6.1 documents the prototype of SHBrowseForFolder is
<big>PIDLIST_ABSOLUTE</big> SHBrowseForFolder( LPBROWSEINFO lpbi<br />
);<br />
And I type PIDLIST_ABSOLUTE in index of windows SDK v6.1 documents to find PIDLIST_ABSOLUTE, I can't index it.
Please help me to understand this!
|
|
|
|