|
Ok , thank you very much - it is very nice and clear answer.
But i have one more question : in that you article mentioned key strokes.
What are the difference betwen Global HotKeys and KeyStrokes hooks . I mean hook - it is just flagged message about appropriate keystroke in some application or the action - that can grant or deny processing of that key combination ?
(I downloaded your project, but i (win2K) cannot see any events in your app. , and cannot check what hooks is !)
Thank you !
|
|
|
|
|
You probably forgot to press the "Install Hook" button first, I've updated the demo project so that now it installs the hook in the OnInitDialog function automatically. Redownload the demo and try again.
|
|
|
|
|
hook is a system interface in windows system.hook can itercept and capture and treat with the message passed to other application program,and finish the fuction that other common program can not do . hook can itercept all kinds of events and message of system or process.once hook itercept the message ,it will treat .
usually ,such as itercept keyborad message,or mouse message...
|
|
|
|
|
*Why* did the app wizard put both of these #includes in my mainfrm.cpp:
<br />
#include "MainFrm.h"<br />
#include ".\mainfrm.h"<br />
------- 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
|
|
|
|
|
It's one of many benign bugs in the wizard code. If you remove it, then add a handler, it adds it back.
(It also does dorky things like not indent items properly.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Its one of the annoying things it does with the current class header. I have taken to remove the #include "MainFrm.h" one so that it doesn't put it in again!
Ant.
|
|
|
|
|
I've a problem using splitter windows.
The function that replaces views in a pane sets the old view to SW_HIDE status and activates the new view with SW_SHOW. A pointer to the old view is returned by the funtion. The old view isn't activated again in the program. My problem is that the memory allocated by the old view isn't freed during runtime, because no DestroyWindow is called and the view's destructor isn't called. So the program leaks during runtime.
I tried calling pOldView->DestroyWindow in the ReplaceView function. This doesn't work, because after doing this it could be possible, that the old view executes messagehandlers (like OnKillFocus) handlers which causes errors, because the view is destroyed.
A second try was using the returned pointer to the old view after 30 seconds to cleanup and then calling pOldView->DestroyWindow(). This causes an endless loop after some time ( I think this can be seen on WIN NT but not on WIN 2000). I had a look at the MFC Code and think this could be caused by a recursive call within the Implementation of DestroyWindow.
Does anyone know a solution how to get the memory of the unused views freed?
|
|
|
|
|
Hi dear...
I'm also facing same problem...
Please let me know if u find any solution..& I'll also if I find any clue...
OK! Good bye..
---Sumit Kapoor---
|
|
|
|
|
hi!
I migrated an existing vc++ 6.0 application using activeX objects to VC++.Net (7.0) environment.
Initially I had problems with the ActiveX objects since they were not being supported in the recent version,the old code had the activex objects being accessed using the GetDlgItem() function,moreover this made sense since the function in which the objects were used were static.
I however created objects and accessed them using the cDialog ptr.
Things compiled well and the program works,but when I close the application I get a lot of memory leaks which is not acceptable... it says something like oleinit.cpp(i guess it might be something to do with the ActiveX objects).Secondly the application is being run in debug mode,I have to expilicity close the debug mode even after the close the window??
Is there anyway to close the activeX objects or delete them so that the memory used by them is to be freed explicitly..
Why is this happening?? any comments ..please help
thanks
rahul
|
|
|
|
|
I guess I've been using CString for too long because for the life of me I can't remember how to assign a value to a character array (not through initialization). I thought I could do something like
szTerm = " \r\n"; but that just gives me errors. Am I completely off with this and do I have to use strcpy and it's associated functions...? Thanks.
- Aaron
|
|
|
|
|
char szTerm[4] = {0};
szTerm[0] = ' ';
szTerm[1] = '\r';
szTerm[2] = '\n';
Maxwell Chen
|
|
|
|
|
|
(1)char szTerm[4]={'a','b','c'};
(2) char szTerm[4]="abc";
|
|
|
|
|
you can also use strcpy(szterm, " \r\n"); from <string.h>
TOXCCT >>> GEII power
|
|
|
|
|
Thanks for info guys. I guess I have been using CString too long.
- Aaron
|
|
|
|
|
I'm doing some dialogs in Visual Stupido.NET, and I can't seem to find a way to may a simple etched frame. I don't want divider lines, and I don't want captioned group boxes. I want what I used to be able to do in Visual C++ 6.0's resource editor.
Does anyone know if what I want to do is even possible?
So far, I'm not impressed with this new crap from MS...
------- 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
|
|
|
|
|
|
Hi everybody.
I'm writing an Activex, that it interact with the serial com, sending commands.
Thats ok.
But I have two questions:
First, I like to know how to adjust the size of the control when someone put it in a form, (in VB or in a Dialog in C++). 'Cause in OnDraw() I draw a BMP, but I want to fix it to an especific size and disabled sizing. I want to fix the size for the desing time, because the control is not visible at runtime.
Then, how can I show a tip, (a short description), in the Property window, (in the bottom of the window) when a property is selected. Where I should write that description in the Activex project??.
Thank you.
Demian.
|
|
|
|
|
can't you handle the WM_SIZE message and just set it back to whatever your size is?
If it's broken, I probably did it
bdiamond
|
|
|
|
|
Greetings,
I have been using dialog based MFC apps for a while and just noticed that, at least in my applications, the exit codes aren't always 0 (even when things seem to be working correctly otherwise.)
If I run any of my dialog apps from the debugger in VS 6.0, and I then close the app with either System->Close, Alt-F4, or the 'X', I see the following messages:
The thread 0xBF4 has exited with code 2 (0x2).<br />
The program 'C:\Documents and Settings\justin.cooke\My Documents\MyProjects\randomNumGen\Debug\randomNumGen.exe' has exited with code 2 (0x2).
If I instead close it with the OK or Cancel buttons, the exit codes are 0, as expected.
What's going on? Does the 2 code just indicate how the app was closed? I was always under the impression that a code other than 0 indicated an error. I tried to find a list of what these codes mean in MSDN and online, but had no luck.
Thanks,
Justin
|
|
|
|
|
Justin Cooke wrote:
I was always under the impression that a code other than 0 indicated an error.
That's a hold-over from the DOS days. Read the docs for CDialog::EndDialog() .
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
OK. I've already taken a look at that info. I understand any int can be returned. How do I know what 2 means? In this case, I'm guessing it just means OnClose was called, but how do I know for sure? Is there a list of return codes somewhere? When I'm running with the debugger and I see nonzero codes, how can I tell if they indicate errors?
Thanks for your help,
Justin
|
|
|
|
|
Look in winuser.h, about 3/4 of the way down.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
Thread and process exit codes have no inherent meaning, the code is just a DWORD that can be used for any purpose. As the other poster said, not every app will exit with 0; and if you see a nonzero exit code it doesn't imply an error happened.
--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ
----
You cannot truly appreciate Dilbert unless you've read it in the original Klingon.
|
|
|
|
|
OK. Thanks for the info guys. I'll just stop wondering what a nonzero return means, unless I have another reason to suspect a problem.
Thanks Again,
Justin
|
|
|
|