|
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!
|
|
|
|
|
So what do WINSHELLAPI , LPITEMIDLIST , and PIDLIST_ABSOLUTE expand to?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
PIDLIST_ABSOLUTE define as LPITEMIDLIST too.
Thanks.
|
|
|
|
|
The first one is from the "Platform Builder for Microsoft Windows CE 5.0".
The second one is from the "Windows Shell and Controls" documentation.
Unless you're coding for CE, you should be using the second.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I 've created a program which when minimized goes to the system tray and upon activation it restores... when it restores the icon next to the title in the title bar didnt show up... when the window is displayed for the first time the icon is present but when it is minimized to tray and maximized it disappers...
what is the functionality to redraw the icon...???
i am using API's and not mfc...
Today's Beautiful Moments are
Tomorrow's Beautiful Memories
|
|
|
|
|
Hi guys =) need a little help here...
Shouldn't this work?
class MyClass
{
public:
void method() {}
void (MyClass::*_callback)();
};
int main()
{
MyClass b;
b._callback = &MyClass::method;
(b.*_callback)();
return 0;
}
Fratelli
|
|
|
|
|
No, it shouldn’t work. Replace this:
(b.*_callback)();
with this:
(b.*(b._callback))();
C++ member function pointers are not like delegates in C#. The pointer MyClass::_callback identifies a member function of MyClass which returns void and takes no parameters (and has the calling convention __thiscall ): it doesn’t specify which instance of MyClass . The fact that the pointer is a member of the class is incidental and is probably what’s confusing you.
Steve
|
|
|
|
|
OK, Here's the deal. I have a dialog based MFC application and a large amount of data points (7296 of them actually) and I want to be able to graph these on a line graph on the dialog somewhere. One additional consern, I want to be able to do this from within a thread that is called frequently (every 8 ms).
So here are the questions.
1. Is it possible? LOL.
2. What object type do I need to add to my dialog class to use functions like polyline, which I see in a lot of examples? All of the examples are not using a dialog based app. Can you even use those functions with a dialog app? oops I guess that was two quesitons.
4. Is that a good way to approach this or should I be looking for a library?
5. Any good free libraries you know of that do this?
|
|
|
|