OnSetFocus called twice?

Hi, MDI app using CRichEditDoc/View derived classes.

I'm using OnSetFocus() to toggle the state of a BOOL member variable
but when I call OnFileNew() it seems to call OnSetFocus() twice thus
the BOOL seems to stay the same.

When I switch between view it seems to work fine though as
OnSetFocus() is only called once.

Is OnSetFocus() supposed to be called twice?

Adrian.
0
4/20/2004 4:03:13 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
581 Views

Similar Articles

[PageSpeed] 16

adriangibbons@yahoo.co.uk (Adrian Gibbons) wrote in message news:<34a2acd5.0404200803.4a3f9e29@posting.google.com>...
> Hi, MDI app using CRichEditDoc/View derived classes.
> 
> I'm using OnSetFocus() to toggle the state of a BOOL member variable
> but when I call OnFileNew() it seems to call OnSetFocus() twice thus
> the BOOL seems to stay the same.
> 
> When I switch between view it seems to work fine though as
> OnSetFocus() is only called once.
> 
> Is OnSetFocus() supposed to be called twice?
> 

I don't know the answer to your problem, but I can see another
occasion when it may occur. If you swap to another application and
back (as users tend to) then your view hasn't changed, but you're
recieving the focus again.

Maybe you need to re-think what you're trying to achieve.

Paul.
0
paul.ganney1 (118)
4/21/2004 10:35:40 AM
paul.ganney@hey.nhs.uk (Paul S. Ganney) wrote in message:

> I don't know the answer to your problem, but I can see another
> occasion when it may occur. If you swap to another application and
> back (as users tend to) then your view hasn't changed, but you're
> recieving the focus again.
> 
> Maybe you need to re-think what you're trying to achieve.
> 
> Paul.

Okay thanks. This might be pretty simple:

How do I detect when a user changes between views not using OnSetFocus()?

Adrian.
0
4/21/2004 5:29:43 PM
Reply:

Similar Artilces:

Calling type library dll NOT from project directory
Hi, everybody I have to implement some SDK in my MFC project. I've added corresponding library to the project and copied corresponding dll file to my project directory. But this doesn't work because this SDK was created the way that this dll cannot be copied anywhere, but it must be called from the directory where SDK setup put it. Import directive doesn't work I'm getting an error: "Cannot open type library file:..." So is it possible to indicate (spedify) somehow in my project the path to this dll, unless it's residing not in project directory? Thank to ev...

OnSetFocus(), OnKillFocus()
Hi, I have a standard MDI app. My view class is CFormView based. I have a microsoft chart activex control placed on top of the form. In the CFormView class I have a handler for OnSetFocus() and OnKillFocus(). I have this strange behaviour where if I click on another view in my app, the previous view that had focus first gets a kill focus message, then gets a set focus message somehow! It should just get a kill focus and that is it when losing focus. I have no idea why this is happening, but without the control present, the focus problem goes away and the set/kill focus messages are receive...

Phone Call Accepted by = Sender of Phone Call
Hi I have a workflow where a phone call is created when a new lead is entered and assigned to the leads queue. I want to have a workflow which puts the sender of the phone call = name of the person who accepts the phone call. How do i go about this. I am using crm 4.0. The person who makes the phone call could be different to the person who creates the lead therefore i want to capture the person who makes the phone call. I would really appreciate some help. Kind Regards Snow White ...

OnSetFocus called twice?
Hi, MDI app using CRichEditDoc/View derived classes. I'm using OnSetFocus() to toggle the state of a BOOL member variable but when I call OnFileNew() it seems to call OnSetFocus() twice thus the BOOL seems to stay the same. When I switch between view it seems to work fine though as OnSetFocus() is only called once. Is OnSetFocus() supposed to be called twice? Adrian. adriangibbons@yahoo.co.uk (Adrian Gibbons) wrote in message news:<34a2acd5.0404200803.4a3f9e29@posting.google.com>... > Hi, MDI app using CRichEditDoc/View derived classes. > > I'm using OnSetFocus() t...

Calling two dialogs in InitInstance
Hello! I have a dialog based application. In the application InitInstance I have a code like: // This part works!! CguiDlg dlg; m_pMainWnd = &dlg; INT_PTR nResponse = dlg.DoModal(); // This part doesn't CguiDlg dlg2; m_pMainWnd = &dlg2; nResponse = dlg2.DoModal(); Any idea why the second call with a second dialog fails? Thanks! When you call "DoModal" you do not return until the dialog closes. Using your code I expect the first dialog to open. Then when you close the first dialog the second dialog will open. If you want both to open at the...

ODBC--Call failed.
I am running a query. One of the field's I am filtering. If I use a "Not Like" criteria the query runs fine, takes a second. However, if a use a "Like" criteria I get the: ODBC --call failed. [Oracle][ODBC][Ora]ORA-01013:user requested cancel of current operation (#1013) Why would it matter if I use "Like" vs "Not Like"? How can you fix? thank you Obviously, looking at the error, the problem is not with the LIKE or NOT LIKE operators. Rather, it has something to do with your connection to the database. -- Lynn Tra...

Covered Call Options
Hello all, I do I go about dealing with a covered call transaction in Microsoft Money 2007 Premium? Currently what I am doing is inputing the option symbol, and choosing the transaction "Sell to Open" then when I go to expire the option I try to do a Sell to Close. However it does not seem to work? Also what happens if instead of expired I has the position assigned? how would I account for that? Thank you. Shhhh In microsoft.public.money, Shhhh wrote: > >I do I go about dealing with a covered call transaction in Microsoft >Money 2007 Premium? Currently what I am doing is...

Call in?
Do new owners of Office X have to call up Microsoft to register their copy? If yes, what's the number? thanks. Ming <asdf@asdf.com> wrote: > Do new owners of Office X have to call up Microsoft to register their > copy? If yes, what's the number? thanks. Nope. We're not using Windoze :->>> This version does not require activation. Corentin -- - Mac:MS MVP (Francophone) - (MS) MVP: http://support.microsoft.com/default.aspx?ln=FR&scid=fh;FR;mvp Newsgroups produits MS: http://support.microsoft.com/newsgroups/?ln=FR ...

Call center tracking and reporting
Anyone use CRM 4.0 for call tracking? Our Sales/Marketing is set up. Now I need to decide how to most efficiently customize CRM 4.0 for our company's call tracking portion. Can someone send me a link to information? thanks ...

telephone calls
when placing a telephone call using outlook, everything works fine except I can't hear the person i am talking to. They can hear me find. When I use a telephone program not associated with outlook every thing works great. can someone help ...

Workflow -Assembly Call
How does add subtract in the Workflow>> assembly call works. I do understand that ypu can write your own custom workflows, register it and then call them from here, but I am pretty confused with the existing functionality. workflows can call other workflows workflows can also call a method in a .net assembly. ie you could write a piece of code in c# or vb.net and then have the workflow call your code. ======================= John O'Donnell Microsoft CRM MVP http://codegallery.gotdotnet.com/crm "SAM" <SAM@discussions.microsoft.com> wrote in message news:DE...

Async calls to WebService in MFC
Hey guys, I use a webservice over the net which is scripted in VB.Net. This web service receives a username and a password and returns a string structure with multiples infos. If the string is empty, I had the wrong username and/or password. Pretty simple isn't? Ok now the problem is a bit more complex. I'm using an MFC client to connect to these web services, and since they're on the internet, there's a delay between sending the data and receiving an answer. I don't know really how I can tell me client to "wait for the string". The wrapper MFC created for the w...

Invalid procedure call or argument?
Hello All This is a re-post of a problem I posted a while ago, but to which I got no suggestions: hopefully I'll be more lucky this time!? I have the following code in a Private Sub: If InStr([ResponseXML], "element") > 0 Then errorfield = "Invalid " & Mid([ResponseXML], InStr([ResponseXML], "element"), InStr(InStr(InStr([ResponseXML], "element"), [ResponseXML], "'") + 1, [ResponseXML], "'") - InStr([ResponseXML], "element") + 1) Else .... Most of the time this works fine, but for some...

Unable to get DxgkDdiRecommendFunctionalVidPn call in windows 7
I am trying to add an initial vidpn topology by implementing the DxgkDdiRecommendFunctionalVidPn call in the WDDM miniport driver. But starting from windows 7 i am unable to get the DxgkDdiRecommendFunctionalVidPn function call from dxgkrnl.After searching through the MSDN documentation i found out that the function is deprecated starting from windows 7. msdn link: http://msdn.microsoft.com/en-us/library/ee220395.aspx According to msdn "On a computer running Windows 7, the display mode manager (DMM) determines an appropriate VidPN topology to apply using VidPN history d...

Where to call SetWindowPos
In my SDI, can I place the following in CMainFrame::OnCreate( )? Or is there a better place? // ensure window opens on top when called by other applications, esp. the installer SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); Note that wndTopMost really means it is always on top and can never have another app come on top of it. So wndTopMost is often a poor choice. SetWindowPos would not be the best choice here; SetForegroundWindow would be better. joe On Sat, 11 Aug 2007 17:04:00 -0400, "SteveR" <srussell@removethisinnernet.net> wrote: >...

World Wide Calling! Unlimited Incoming Calls.
New virtual access anywhere technology lets you call anyone, anywhere in the world, from any phone! Access: http://pt.telextreme.com/743499 ...

Call out to detect attaching files
Hi All, Is there a method to write a callout to detect file uploads. i knoe that when i file is uploading it's going to annotation entity. i have written preupdate and postupdate methods to track this. but when i add a file the event doesn't get fired and doesn't indicate the changes. later if i do a change to the note then i'm able to see the changes. can anyone tell me the reason... Thanks, Charith On Aug 7, 2:34 am, Charith <Char...@discussions.microsoft.com> wrote: > Hi All, > > Is there a method to write a callout to detect file uploads. i knoe tha...

How do I do something called "track and change" in Publisher?
How do I do something called "track and change" in Publisher? thepantheistsboots wrote: > How do I do something called "track and change" in Publisher? You don't, there is no such feature. -- Ed Bennett - MVP Microsoft Publisher http://ed.mvps.org ...

OnKeyDown not called for VK_DOWN or VK_RIGHT but is called for others.
In my Dialog App on Win98 VC6 MFC, my OnKey is not called for VK_DOWN or VK_RIGHT but is called for others including VK_UP and VK_LEFT. Here is a portion of the Spy++ Log (I inserted blank lines to separate the key events). What could be causing this strange behavior? TIA Harvey ----- Spy Log: <00034> 0000030C P WM_KEYDOWN nVirtKey:'C' cRepeat:1 ScanCode:2E fExtended:0 fAltDown:0 fRepeat:0 fUp:0 <00035> 0000030C S WM_GETDLGCODE <00036> 0000030C R WM_GETDLGCODE fuDlgCode:0000 <00037> 0000030C P WM_CHAR chCharCode:'c' (99) cRepeat:1 ScanCode:2E fExtended:...

Call to a project from a MFC
Hello all, On the one hand I developped a MFC application (compile and execution ok). On the other hand I developped C++/C/Fortran routines (compile and execution ok). Now I would like to call, from the MFC application (e.g. on a click event), the routines. At first, I had problem with the precompiled header, and I solved it by entering "Project Settings, and not /Yu"stdafx.h" " for all non-MFC files. Now I got the following error : dfor.lib (DFORMAIN.OBJ) : error LNK2001: unresolved external symbol _MAIN__. I had a look at the FAQ and especially at (http://www.m...

LAST CALL to LUKE M
May I, please, have your E-Mai address ? I asked for it right beyond one of your replies, somewhere in this, or previous, page - but got nothing in return. If you don't want me to have it - just let me know - hereunder. Thanks, Micky micky-a<at>tapuz.co.il ...

My app calling API NetMessageBufferSend doesn't work recently!
Hi, I have an API call problem in VC6 to ask you for help. I wrote a LAN application to send pop up message between PCs in LAN as command "net send" does. I called Platform SDK API NetMessageBufferSend in my VC program: ....... success = NetMessageBufferSend( NULL, //pszServerName, wszMsgTo, wszMsgFrom, (LPBYTE)wszMsg, dwLen*2); ....... The wszMsgTo parameter is an unicode string for string such as "192.168.0.x". In fact, it worked fine some days ago while it fails to send message now. The return value "success" is 2273 NERR_NameNotFound. To my s...

Calling a web service from MFC
Hi fellows, How do I call a web service from an MFC application? This is something I'd like to do without bringing .NET into the picture, if possible. Thanks in advanced for any pointers. On Jun 23, 9:20=A0am, "Eddie Paz" <drp...@hotmail.com> wrote: > Hi fellows, > > How do I call a web service from an MFC application? This is something I'= d > like to do without bringing .NET into the picture, if possible. > > Thanks in advanced for any pointers. I don't know of WebServices library for MFC specifically, but I think that A...

call flow
I'm looking for help with illustrating call flow through a large call center. Does anyone have a template I can use or any other help? call center flow tends to be pretty industry/function specific, and everyone wants to sell you their expertise in how it might be done.... try here for a university case study http://www.mark.umd.edu/~clay/OITACD_files/OITACD.htm al "Herbert" <hnmaddox@hotmail.com> wrote in message news:41FCDFF3-BA6C-4553-AC57-5847F38B9A1E@microsoft.com... > I'm looking for help with illustrating call flow through a large call > center. &...

Phone Call
Is there are way to change the Call Initiator on a batch of phone call activities? When Leads are reassigned the activities are reassigned but the Call Initiator field remains set to value of the phone call creator. ...