Child Window Cannot Receive Messages

i have an application, that follows the View/Doc Architecture, i have a 
Frame Window, a View, and in addition, i define another child winodw of 
CButton , the problem is that the last child window doesnot receive any 
mouse messages/? The default OnBnClicked is never called.

What is wrong??


0
2/7/2006 4:51:57 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
418 Views

Similar Articles

[PageSpeed] 47

I don't see a problem:-
1) Create an SDI doc/view app
2) subclassed CButton and created CMyButton and then
    added the reflect handler =BN_CLICKED.
void CMyButton::OnBnClicked()
{
 AfxMessageBox("test");
}

3) Add member variables in the view of the type
     CMyButton.
     CMyButton m_Button1;
     CMyButton m_Button2;
4) In the OnInitialUpdate override add this code:-
       m_Button.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
   CRect(10,10,100,30), this, 1);
 m_Button1.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
   CRect(300,300,500,330), this, 1);

-- 
Vipin Aravind
"hereafter" <notsamegeek@hotmail.com> wrote in message 
news:esSh7I6KGHA.3164@TK2MSFTNGP11.phx.gbl...
>i have an application, that follows the View/Doc Architecture, i have a 
>Frame Window, a View, and in addition, i define another child winodw of 
>CButton , the problem is that the last child window doesnot receive any 
>mouse messages/? The default OnBnClicked is never called.
>
> What is wrong??
>
> 


0
vipin (697)
2/7/2006 5:45:50 AM
I add the button as a child window of the Frame Window.

Can i have a view winodw size different from The Frame window size (Client 
Area)

"Vipin [MVP]" <Vipin@nospam.com> wrote in message 
news:%23gmsCn6KGHA.1288@TK2MSFTNGP09.phx.gbl...
>I don't see a problem:-
> 1) Create an SDI doc/view app
> 2) subclassed CButton and created CMyButton and then
>    added the reflect handler =BN_CLICKED.
> void CMyButton::OnBnClicked()
> {
> AfxMessageBox("test");
> }
>
> 3) Add member variables in the view of the type
>     CMyButton.
>     CMyButton m_Button1;
>     CMyButton m_Button2;
> 4) In the OnInitialUpdate override add this code:-
>       m_Button.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
>   CRect(10,10,100,30), this, 1);
> m_Button1.Create(_T("My button"), WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,
>   CRect(300,300,500,330), this, 1);
>
> -- 
> Vipin Aravind
> "hereafter" <notsamegeek@hotmail.com> wrote in message 
> news:esSh7I6KGHA.3164@TK2MSFTNGP11.phx.gbl...
>>i have an application, that follows the View/Doc Architecture, i have a 
>>Frame Window, a View, and in addition, i define another child winodw of 
>>CButton , the problem is that the last child window doesnot receive any 
>>mouse messages/? The default OnBnClicked is never called.
>>
>> What is wrong??
>>
>>
>
> 


0
2/7/2006 6:14:50 AM
The framework automatically resizes the view to cover the whole client area 
of the frame. Although you can modify this behaviour, it's easier to add a 
dialog bar to the view and place your buttons on it. Check out the article 
below to point you in the right direction:

http://www.codeproject.com/docking/headertoolbar.asp

"hereafter" <notsamegeek@hotmail.com> wrote in message 
news:OqbSQ36KGHA.3496@TK2MSFTNGP14.phx.gbl...
>I add the button as a child window of the Frame Window.
>
> Can i have a view winodw size different from The Frame window size (Client 
> Area)
>


0
drpazz (112)
2/7/2006 8:56:03 AM
Reply:

Similar Artilces:

Word display a strange message while we open a file for the first time
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Dear all, <br> I have some iMac and user use it to be logged on a server. Network account are created on the server. Also their Home folder and documents are on the server. <br><br>When user opens a file (i think mainly the docx) their get that error message: <br><br>&quot;file&quot; is being used by &quot;another user&quot;. Do you want to make a copy? <br><br>We are all sure that no other user is reading or writing on that file. And this happen only wh...

Fixing a window with caption bar
Hello, I want to fix a window position, but keep the caption bar. I came across this topic: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=b43bcb3052357a85&rnum=5 Can anyone help me and explain (or even give an example if possible) on how to I override the WM_WINDOWPOSCHANGING Notification? I just don't know how to do it. Thanks. To override WM_WINDOWPOSCHANGING: If you are using the Class Wizard, go the the "Class Info" tab. Under the "Advanced" section, change the message filter to Child Wind or Window. Then you will see the WM_WINDOWPASC...

splitter window
hi all I am using splitter window in my project. Is there any body know very good article about splitter window. thanks in advance with regards Harish Hello http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfcnotes_tn029.as list of spliter window articles http://codeguru.earthweb.com/splitter/index.shtm http://www.developer.com/net/cplus/article.php/63027 With Regards R.Selvam hi thanx with regards Harish "R. Selvam" <selvamselvam@hotmail.com> wrote in message news:A130C1FB-C0D6-4F40-A0C9-62EA66F18AEF@microsoft.com... > Hello, ...

incorrect report from parent/child subform.
All, On page 1 of a tabcontrol there are project data fields (table project), on the second page there is subform with project related documents (table documents). This subform has a parent/childlink (projectID) which is in the project table and in the documents table. On the 3rd tabpage I have some buttons for reports. I use the below code to preview the report. which should only give the related documents form the project. However it give the correct project data but not the related documents... Private Sub Command134_Click() 'generate print preview. DoCmd.OpenQuery &...

Distribution group: message not delivered to all recepients
This is a multi-part message in MIME format. ------=_NextPart_000_002E_01C5DFC4.DD8CBF60 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello there, We have Exchange 2003 on Win2003 server. Since a few days ago some = distribution groups do not deliver email sent to them to all members. = Sya, if distribution group contains 10 members about 6 of them receive = emails sent to the group.=20 The error log on the server displays message : Permanent failure reported by policy group provider for 'CN=3DRecipient = Policies,CN=3DCompany,CN...

how to receive my emails to my personal folder (ie lianne) in inbo
Before I start I am computer illiterate, so please humour me. I am using microsoft outlook. I used to receive my emails in my named folder in inbox, my partners went to inbox. I some how deleted my folder, which I have retrieved but now my emails go to inbox, how do I put it right. If I do receive a reply and some one can help me, please bear in mind that technical terms mean nothing. Thankyou Lianne Hi, I am also pretty clueless but here goes. You go to 'tools', 'message rules', 'mail', and from the list on the right, click 'new'. In box 1 you can sele...

Remove child domain after child domain DC has failed
Active Directory: Domain Functional Level: 2008 Forest Functional Level: 2003 I used to have a dev domain, which was a child domain of our production domain (dev.domain_name.local). This dev domain had a single domain controller and that domain controller has died. Now I would like to remove that dev child domain from my production domain to get rid of the event log errors on my production domain controllers. Has anyone seen an article on how to remove a child domain from active directory when there is no DC to demote? -- thanks, Jeff Winters, Rimrock Corpor...

New Message with a specific account
I have 4 or 5 email accounts setup in my outlook 2003 and sometimes I want to create message for different account, right now the only way to do this is to create a new message using the default then in the new message window change the account to the one I want. Can I create a 5 buttons in the toolbar one for each account that will create a new message with the specified account? Thanks. No. You need to use the buttons provided. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outl...

Send receive operation failed
I have an error that comes up when i hit send/receive. It says 'operation failed'. There is nothing else with the message, just an ok button. I have tried microsoft knowledge base article http://support.microsoft.com/default.aspx?scid=kb;en- us;312354 but that doesn't help, it fixes the error that says 'The operation failed. An object could not be found.' but not mine, i tried it and it didn't work. I am using windows 2000 and office xp. This error has only been happening recently. Can anyone help me? Thanks, Matt ...

64 bit- Windows XP Professional
I just upgraded my O.S. to Windows XP Professional - 64 bit and have already encountered some problems. Could someone give me some sound professional advice, please! After installing the 64 bit Xp Pro O.S. onto a new hard drive I could not install my anti-virus program (it states it isn't compatible with XP 64 bit). Am I going to get this from many other programs? Next ,I can't get the 64 bit OS to recognize my 56 k modem, the "Found new Hardware Wizard" doesn't recognize the modem. I tried another modem and the OS found it but couldn't find a d...

Unread message count in current view only
I have a Public Folder which contains a custom form and is used by different business regions i.e. UK, Germany, France etc. Each region has its own corresponding folder view that only shows the items for their region. All users have the folder in their Public Folder --> Favourites so they can see the unread item count. The problem is that the unread item count shows the total number of unread messages in the whole folder and we want users to see the total number of unread items in their region specific view only. Is there a way around this? I am running Exchange 2000 Service Pack 3 ...

Creating a parent/child relationship for vendors
Hello, Has anyone ever done a parent/child relationship for vendors in great plains? We have a structure that has multiple subcontractors working for the same vendor and since the number of contractors per vendor is a one to one relationship, we were thinking of creating a parent vendor and have the vendors associated with the contractors be the children. This way when we write up an invoice for the parent vendor, we can include all the child vendors information as well. I'm new to the world of Great Plains. If this is an absurd question, please excuse... Thanks, Med Look at the p...

Viewing Access Code in Windows 2000
I have an Access 2000 Database that was written by a programmer long gone. I when I open the database it starts the access application. I want interrupt the application an view that code and tables. What Key sequence do I use to perform this. I haven't done access in about 6 years so I for got how. Thanks Alt+F11. ************ Anne Troy www.OfficeArticles.com "Larry Bird" <LarryBird@discussions.microsoft.com> wrote in message news:FCB9F9E3-13F5-4FB6-AC38-51B992D1C50F@microsoft.com... >I have an Access 2000 Database that was written by a programmer long g...

Print Layout
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel In Print Layout Mode I always want Word to display one page per window. I don't want this to change when I use a lower zoom ratio. On the PC version of Word, this option is configurable. I cannot find a comparable configuration on the MAC. I always want only one page displayed regardless of the zoom ration that I select. I don't want Word gratuitously giving me more than one page displayed per window just because I select a lower zoom ratio. Thanks, -jim Well... That's the way it works. When pos...

windows explorer hangs when moving files to sharepoint
Hi, one of our sharepoint services users has a problem when using the windows explorer to drag and drop files to Sharepoint. It hangs and the computer should be manually shutted down. The OS is Vista fully updated, office 2007 fully patched. We had some problems in the computer as it had two office installations (2003-2007), but they were solved after uninstalling office 2003 and reinstalling a couple of times office 2007. Any ideas or pointer to where to start looking? Thanks, Isaac ...

Newbie question... Exchange 2003 queued messages
I am trying to set up a new Exchange 2003 server on a Windows 2003 server. I think I have everything set up, but when I send a message to an Internet address, the message goes to an SMTP queue, and remains there with a 'queued' status. The server is behing a firewall, and uses a private IP address. It is set up to forward smtp mail via DNS, not through a smart host. I have set up the firewall (which has a public IP address) to forward smtp out from the server, and forward POP3 and IMap from the outside world to the server. The DNS for the domain is directed to the firewall&...

printing a window
Somebody please help me! How do I print the window that is up when you first open a blank document in Microsoft Publisher? I want to print the actual window with the menu, toolbar, status bar, etc. for some students so they can label the different parts of the window before we start working on publications. Thank you one and all for your help! Cindy Excellent freeware screen capture program. Any choice of options you want http://www.mirekw.com/winfreeware/mwsnap.html -- The simpleist way to print any screen you can see is to press the Print Screen key then paste the result into what...

Windows Mobile 2003/Access Runtimes modules
Is it possible to run Access (Access 2002/2003) runtime modules on a PDA (Windows Mobile 2003). Where Can I get More information about this? The access runtime is not different then the full version, except that you can't modify forms etc. In some versions of the runtime, it was a 150 meg install, and required a re-boot. This is not exactly the kind of software that would install and run on a pda. So, no...there is not a ms-access that runs on a pda. There are a number of good database products for pc's..and quite a few options for syncing with ms-access. Here is some links to get...

Child windows caption is grayed
Hi. I'm writing an ActiveX control that is a MDI application runing in the Web browser. The MDI main frame window is a child of an OLE control window, it has no caption . When I create a MDI child window its cption is grayed. How can I give them the regular look. Thanks in advance. Hi, Gennady Lisiansky wrote: > I'm writing an ActiveX control that is a MDI application > runing in the Web browser. The MDI main frame window is a > child of an OLE control window, it has no caption . When I > create a MDI child window its cption is grayed. > How can I give them the ...

Windows Mail 04-11-10
How can I back up or copy the 'Local Folders' to an external drive? Thanks very much. Windows Vista Mail Newsgroup. In your newsreader: news://msnews.microsoft.com/microsoft.public.windows.vista.mail On the Web: http://www.microsoft.com/communities/newsgroups/en-us/default.aspx?dg=microsoft.public.windows.vista.mail -- Bruce Hagen MS-MVP [Mail] Imperial Beach, CA "melizabeth" <elizabet98_98@yahoo.com> wrote in message news:OdZPjCR2KHA.4752@TK2MSFTNGP02.phx.gbl... > How can I back up or copy the 'Local Folders&#...

Outlook 2007 will receive but not send
Worked fine for the last year or so and today, it stopped sending. Receives fine, just wont send. Says send receive error. emails stay in outbox. Is there any more detail in the error message? Could your provider's SMTP (outgoing mail) server be down or having troubles? "wx4usa" <wx4usa@gmail.com> wrote in message news:963dec5e-6f3d-41b1-8ec2-7e5c06151a13@d36g2000prb.googlegroups.com... > Worked fine for the last year or so and today, it stopped sending. > Receives fine, just wont send. Says send receive error. emails stay in > outbox. ...

Parent vs Child
Is there a way when making an on hand report to just show the Parent for all items instead of it seperating all out in the different "child" items? Hi CT, I'm editor of the Microsoft Business Solutions Community site (www.microsoft.com/businesssolutions/community) and we're having a Microsoft developer from the RMS team answer questions like yours on ITEMS this week. We'll post the answers to the site the week of 9/8 (though if you like, I can fwd the answer to you sooner). Would you like me to pass your question on to Jimmy Wong, the MSFT developer doing this ...

Query for Parent containing only ONE type of child
I am trying to find all offices that contain just ONE type of member. Each office can contain many types of members but I want to find those that have just one type. I need to be able to assign (within the code) the type I'm looking for too. Thx, Warren ORGANIZATION OrgID (pk) OrgName MEMBERS MemID (pk) MemberName OrgID (fk) How do you identify the type of member? -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Warren" <Warren@discussions.microsoft.com> wrote in message news:ADE55ECC-F037-4F07-8DE3-C8A007D257F0@microsof...

cannot send email but can receive email
i am having a problem sending email i am getting the following error : "tcpip connection was unexpectedly terminated by the server error 0x800ccc0f" what is strange to me is that i can still receive email any ideas tks larry ...

Copy all inbound / outbound messages
Can someone tell me how to copy all outgoing mail messages? - without using client rules ? I think I can forward a copy of all incoming mail via Delivery Options under User Account > Properties > Exchange General Tab > Delivery Options > Forward to: & Deliver messages to both ... My VP wants to copy all email communications in/out of the company for his review. Any help would be extremely appreciated. -- Semper Fi ------------ Never retreat. Never surrender. "XADM: How to Enable the "Message Journaling" Function for an Exchange Server Mailbox Store&quo...