-
May 20th, 2012, 07:59 AM
#1
Ctrl+S no longer recognized
Hi guys,
As of recently my software no longer recognizes the Ctrl+S command for saving a file anymore.
The ::Serialize part of the code is no longer reached.
Not only that, but not even the CDocument::OnFileSave part of the code is prompted when you press Ctrl+S.
There's nothing I can see why this wouldn't work anymore.
The message map seems to be working fine.
Code:
BEGIN_MESSAGE_MAP(CDocument, CCmdTarget)
//{{AFX_MSG_MAP(CDocument)
ON_COMMAND(ID_FILE_CLOSE, OnFileClose)
ON_COMMAND(ID_FILE_SAVE, OnFileSave)
ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
Does anyone have any idea what could be causing this?
And how to fix it?
-
May 20th, 2012, 10:05 AM
#2
Re: Ctrl+S no longer recognized
Normally this works with an accelerator key. Check in the resource editor if the key is still linked to the ID_FILE_SAVE id.
Cheers, D Drmmr
Please put [code][/code] tags around your code to preserve indentation and make it more readable.
As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky
-
May 20th, 2012, 01:35 PM
#3
Re: Ctrl+S no longer recognized
It's there:
Code:
"Q", ID_SELECT_TOP, VIRTKEY, ALT, NOINVERT
"S", ID_FILE_SAVE, VIRTKEY, CONTROL, NOINVERT
"S", ID_DETERMINE_SIZE, VIRTKEY, SHIFT, CONTROL, ALT, NOINVERT
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL, NOINVERT
"V", ID_PASTE_WHOLE, VIRTKEY, CONTROL, ALT, NOINVERT
But for some reason it's not recognized.
I do have an older version of the program where it Ã*s recognized.
But somewhere along the line something has changed ...
I wish I knew what.
Does anyone have any idea what could be causing this?
-
May 20th, 2012, 02:34 PM
#4
Re: Ctrl+S no longer recognized
Originally Posted by rmirani
I do have an older version of the program where it Ã*s recognized.
But somewhere along the line something has changed ...
Are you using version control? If you are then you can narrow down where this changes by checking out different versions until you find two consecutive versions where one works and one doesn't. Then look at what changed between these versions.
And if you aren't using version control, then consider this a good reason to start using it
-
May 21st, 2012, 05:58 AM
#5
Re: Ctrl+S no longer recognized
Ok, I've figured out the cause of the problem ... but now the solution.
Because I need to know when my mouse is leaving the screen, in CMyProgramView I'm applying SetCapture() whenever the capture is lost.
Because of this, all instructions, including Ctrl+S now seem to be routed through my CView, causing it to be ignored for its regular use (at least, that's my guess of what's happening).
What I'm doing now is, in CMyProgramView::OnMouseMove() i'm applying the code
Code:
if(this!=GetCature())SetCapture();
So, once I apply this, what I believe to be standard operation for dealing with mouse events, events like Ctrl+S, Ctrl+O and Ctrl+N are no longer picked up in the regular manner.
Is there any way around this?
-
May 21st, 2012, 07:16 AM
#6
Re: Ctrl+S no longer recognized
If your goal is to determine when the mouse leaves your window, perhaps TrackMouseEvent and WM_MOUSELEAVE would help.
-
May 21st, 2012, 08:26 AM
#7
Re: Ctrl+S no longer recognized
Originally Posted by GCDEF
If your goal is to determine when the mouse leaves your window, perhaps TrackMouseEvent and WM_MOUSELEAVE would help.
Ok, great!
It's working again!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|