How to kill a dialog box frm a class which has created by another

Hi ,

I am new to VC++ MFC programming. Can anybody help me?
My application creates a pop-up dialog which has associated with the class 
called "CTakeBills". This basically displays a dialog box which has only Ok 
button and a disabled close button. There is a setTimer method in 
OnInitDialog() method of this class with a timeout of 250ms but there is no 
method called OnStopTimer or killTimer methods.
I have another class called CCmdProcessor. My requirement is that i need to 
kill that dialog box programatically from this class(CCmdProcessor)which has 
been poped-up/created by another class called CInsertCash

Any help is much appreiciated.

Thanks & Regards,
Karimulla.
0
karim1 (46)
6/30/2008 6:36:01 AM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
379 Views

Similar Articles

[PageSpeed] 30

>I am new to VC++ MFC programming. Can anybody help me?
>My application creates a pop-up dialog which has associated with the class 
>called "CTakeBills". This basically displays a dialog box which has only Ok 
>button and a disabled close button. There is a setTimer method in 
>OnInitDialog() method of this class with a timeout of 250ms but there is no 
>method called OnStopTimer or killTimer methods.

The timer expiry handler will normally be called OnTimer - it's a
handler for the WM_TIMER message.

>I have another class called CCmdProcessor. My requirement is that i need to 
>kill that dialog box programatically from this class(CCmdProcessor)which has 
>been poped-up/created by another class called CInsertCash

Presumably this is a modeless dialog - you need to ensure that each
aspect of your design has access to the pointer to the dialog object
that's been created. There's no magic solution here, you have to get
your design right.

Dave
0
davidl7375 (2060)
6/30/2008 9:06:20 AM
See below...
On Sun, 29 Jun 2008 23:36:01 -0700, karim <karim@discussions.microsoft.com> wrote:

>Hi ,
>
>I am new to VC++ MFC programming. Can anybody help me?
>My application creates a pop-up dialog which has associated with the class 
>called "CTakeBills". This basically displays a dialog box which has only Ok 
>button and a disabled close button. There is a setTimer method in 
>OnInitDialog() method of this class with a timeout of 250ms 
****
A quarter of a second is an awfully short time to expect a user to see anything; note that
the human perception system runs at the level of hundreds of milliseconds to react to
things like dialog boxes
****
>but there is no 
>method called OnStopTimer or killTimer methods.
****
There is no OnStopTimer because that would be a notification sent when a timer is stopped,
and there's no mechanism for this.

There is an OnTimer handler, and CWnd::KillTimer will stop a timer, but unless you are
using a callback timer (which is going to be a mistake), a timer is implicitly killed when
its associated window is destroyed
****
>I have another class called CCmdProcessor. My requirement is that i need to 
>kill that dialog box programatically from this class(CCmdProcessor)which has 
>been poped-up/created by another class called CInsertCash
****
PostMessage(WM_CLOSE) should do it
		joe
****
>
>Any help is much appreiciated.
>
>Thanks & Regards,
>Karimulla.
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
6/30/2008 3:49:00 PM
On Jun 30, 2:36=A0am, karim <ka...@discussions.microsoft.com> wrote:
> Hi ,
>
> I am new to VC++ MFC programming. Can anybody help me?
> My application creates a pop-up dialog which has associated with the class=

> called "CTakeBills". This basically displays a dialog box which has only O=
k
> button and a disabled close button. There is a setTimer method in
> OnInitDialog() method of this class with a timeout of 250ms but there is n=
o
> method called OnStopTimer or killTimer methods.
> I have another class called CCmdProcessor. My requirement is that i need t=
o
> kill that dialog box programatically from this class(CCmdProcessor)which h=
as
> been poped-up/created by another class called CInsertCash
>
> Any help is much appreiciated.
>
> Thanks & Regards,
> Karimulla.

Provide some method in CTakeBills (which creates the dialog) to close
the dialog as well. Also provide access to CTakeBills object to
CCmdProcessor.

--
Ajay
0
ajaykalra (6842)
6/30/2008 5:37:25 PM
Reply:

Similar Artilces:

Move Outlook data to another computer
Purchased a new laptop. How do i backup and move outlook 2003 from my desktop to my laptop. Take a look here, it may help: http://www.slipstick.com/config/backup.htm --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account will be deleted without reading. After searching google.groups.com and finding no answer, J.J asked: | Purchased a new laptop. How do i backup and move outlook | 2003 from my desktop to my laptop. ...

Max Limit for Values in List Boxes and Combo Boxes in Outlook forms
Folks, a user is setting up a form. She wants to have several combo boxes and list boxes with between 75 and 300 (yes, 300 -- that's not a typo!) possible values in the combo box or list box. Before she starts work on this, she would like to know if there is a limit on the number of possible values for a combo box or a multi-select list box. Is there a limit? Is it defined by the number of characters in the values box, or the number of actual values? What is the limit? Any help here would be appreciated. Thanks. David consulttech2004@hotmail.com ...

How do I create a bulleted list text format inside cell?
I am collecting data and want to format the text inside the "notes" (my title) cell so that it can be more easily read. I would like to make a bulleted list. There are several cells that need this formatting. Is this possible? There is no help for this. You have to do it manually. -- Regards, Tom Ogilvy "DEH" <DEH@discussions.microsoft.com> wrote in message news:DFAEE5CC-0AAD-41D7-9DE1-396187DA2681@microsoft.com... > I am collecting data and want to format the text inside the "notes" (my > title) cell so that it can be more easily read. I would...

OWA
SBS 2003 SP1, Exch 2003 SP2, FBA w/ SSL. If I add/delete a calendar event via OWA, I get a 5.1.7 NDR in my Inbox (pasted below). The calendar item is added/delete, and I see it in OWA or Outlook. I haven't seen any other posts similar to this, nothing on MS support. Any clues? ========== Your message did not reach some or all of the intended recipients. Subject: Sent: 12/21/2006 8:24 AM The following recipient(s) could not be reached: System Attendant on 12/21/2006 8:24 AM The e-mail address could not be found. Perhaps the recipient moved to a different e-mail organization, or t...

Excel should default to autoformat for chart text boxes
Excel in (Office 2003 and as far as I can tell all previous versions of Excel) should default to autoformat for chart text boxes - it currently selects "none" for outline and background options ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.micr...

how do I increase drop list font and box size I created
Font is small and you have to scroll through list due to box size If the dropdown was created using Data Validation.............Font size is set at 8pt Dropdown box height cannot be changed. For workarounds like using a ComboBox and using Zoom see Debra Dalgleish's site on DV Lists. http://www.contextures.on.ca/tiptech.html Gord Dibben MS Excel MVP On Fri, 4 Apr 2008 11:36:02 -0700, cdietz1 <cdietz1@discussions.microsoft.com> wrote: >Font is small and you have to scroll through list due to box size ...

Applying recurring bill payments to new a newly created auto loan?
I'm using Money 2005 and curious as to how to resolve my problem. I purchased a vehicle 6 months ago and was too lazy to create a new loan and apply the payments in a recurring bill to that balance. I just created a new bill and put my car payment amount and who I pay the loan to as the payee. I want to create a New Auto loan with a balance and interest rate, BUT have the payments i've already made in a recurring bill go to that newly created Loan... Any ideas? Hope that made sense :) Untested procedure assuming Advanced Registers/Advanced Bills: Create the loan and say payme...

Help with Combo-box
Hey everyone, hopefully someone's run across a problem similar to this and their is a (simple :) solution). Basically I have a simple combo-box that is displayed in a dialog. Now, the problem is that I have around 7200 entries that I want to appear in that box as valid selections...well thus far I haven't been able to get that many entries as a possibility (the combo-box simply refuses to allow me to enter that many fields of data). :( Okay, I tried googling this (thought maybe there was a readily defined maximum on combo-box data size) but I couldn't find anything that wou...

pre-select new record in combo box
Hi, I have a form (frmActivity) with a combo box (cboStore) that gets its data from a table (Store). If there is a new store which dose not show in the combo box I have a command button on the same form that open a popup window for entering the name of the new store. In the 'on close' event of the popup I requeary the combo box (cboStore) on the main form so that the new store will appear. What I would really like is to have the new store already selected in the combo box when the popup is closed. Is this possible and if so how? Thanks, Phil Try after the requery of the ...

lookup and match from another excel file
Curious if someone can help. I have a dispatch log that I made for m company, I would like to set up a payroll system that will automaticl pull all rows that meet a certain name and date range. and put it o another new sheet for that weeks payroll if anyone has some ideas le me know, I can post an example of my dispatch log if needed. Thanks Sorry Sort of newb to this. Actually here is the file, I have macros on it for sorting Attachment filename: new daily log.xls Download attachment: http://www.excelforum.com/attachment.php?postid=63792 -- Message posted from ht...

Create MDI Child inside a thread?
I have attempted this through a CWinThread derived class but have been unable to get the window creation to work correctly. This is what I have so far: BOOL CSecurityFrameThread::InitInstance() { CRuntimeClass *pRT = RUNTIME_CLASS( CSecurityFrame ); CFrameWnd *pFrame = (CFrameWnd *)pRT->CreateObject(); CCreateContext ct; ct.m_pCurrentDoc = NULL; ct.m_pCurrentFrame = (CFrameWnd *)m_pParent; ct.m_pLastView = NULL; ct.m_pNewDocTemplate = NULL; BOOL bSuccess = pFrame->LoadFrame(IDR_TRUSSVIEWER, WS_VISIBLE | WS_OVERLAPPEDWINDOW | WS_CHILD...

Technique used to rotate text labels when creating a PDF file from Access
This might be of help to some people. I have been producing some PDF reports lately directly from Access using the basic techniques found here: http://groups.google.com/group/comp.databases.ms-access/msg/a49f0ddea9315902 The rotation technique I use below can only be used when Access creates the PDF file directly or when Access uses some PDF creation tool that allows the developer to insert additional PDF commands. I don't think that the Access 2007 PDF Add-in from Microsoft allows such customization. Even if you can find an appropriate place to put the PDF commands within...

why can't I edit a document I created two days ago with same Word
Started using Windows 7 about two weeks ago. Now I can't edit files I just created within the last week using the Word 2007. Why? Hi, I am really sorry that you are experiencing that. I am not quite sure yet thatI fully understand your problem but from what I see it seems taht you are trying to modify a read only file. Make sure taht when you save in word you are not saving the document as "read only." Let me know if this helps and if you have any additional info I would be glad to help you . -- Vicente Tulliano "veteranpoet" wrote: > ...

CImageList for CListCtrl in a modeless dialog
Hello, i'm using an CImageList in a derived CListCtrl. In a modal dialog containing the CListCtrl everything works fine, the images get displaied. Using a modeless dialog the images/toolvar icons didn't get displaied correctly (only in release version, in debug versions it work fine). What's missing or wrong? Any hints are welcome! Cheers Andy --- Member variable of a derived CListCtrl class DLLEXPORT CListMaik : public CListCtrl { ..... private: CImageList m_cImageIcons; } Function Creating image list icons from toolbar IDR_LISTICONS void CListMaik::CreateListIcons(void...

Toolbox wizard to create Command Button
Access 2003 Windows XP Professional I used the Control Wizard on the Toolbox to create a Command Button to close the form. When I try to use it it will not run and returns this error message - The expression On Click you entered as the event property setting produced the following error: Expected: list separator or ). * The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]. * There may have been an error evaluating the function, event, or macro. Any ideas why? I'm at a loss. Check to see if you haven't changed the name ...

Creating an AD account don't make the mailbox in exch2K3
Hi, I don't understand what's happening. When I create a new account in AD, it no longer creates the mailboxes in exchange 2003. It was working a week ago... It asks me if I also want to create a mailbox, I answer YES and ... no mailbox. Please help me, I must create this mailbox quickly since a new employee arrived and my boss doesn't understand why the mail is not set yet. I believe that the mailbox is actually created only after the first message is sent to it or there is a first logon. So if you are looking for it and you do not see it, this may be the cause. Frank &qu...

Outlook 2003: Cursor automatically in To box when
Whenever I create a new message; reply to one; or forward one in Outlook 2003 on a machine I inherited from someone else at work, the blinking text cursor is automatically placed in the To box. I've never seen this happen before in Outlook or any other email app and its quite annoying. I end up having to either retype the beginning of my message again in the body of the email or cut and paste what i've already began to type. Please help, DMarrs@biziteks.com On Wed, 28 Jul 2004 14:16:12 -0700, <DMarrs@biziteks.com> wrote: >Whenever I create a new message; reply to one...

Anyone Else Use Database Query to Query Another Sheet in the Same Excel Workbook?
Wow! I tried this out, and it seems to work beautifully. It's odd, though, that I haven't seen this technique mentioned in any of the several Excel references that I've looked at. Basically, I have a workbook with several worksheets...one worksheet contains a large list with all the records. I wanted to set up the other worksheets to have certain functions...I wanted them to use only certain columns from the main list, and to contain only certain records from the main list that met specified conditions. This is the best solution I have found so far - i.e., creating database q...

Moving comment box leader arrow head
Can I move the position of the head of a comment arrow from one corner of the cell it references to another corner? When I display the comment box/arrow for printing it looks as if it is refering to the cell on the right, since the comment arrow points to the upper-right corner of the cell, instead of the upper-left. Francisco ...

Outlook Client on CRM 1.2 Server Box for Demos
Hi, Did a CRM 1.2 install on Windows 2003 Server and all is working well. I have been seeing things on this newsgroup that say I should be able to install the Outlook client as well on this machine although it is an unsupported configuration. This is for demo's only. I am running it under Virtual PC. I would like to not have to have 2 Virtual PC images running just to show the Outlook integration to CRM. When I try to install the Outlook client I get a message at the start saying that the Outlook client is already installed. It is not. Suggestions anyone? Alan ...

How to declare a pointer to a member function of a class?
Hi to all, How can I declare a pointer to a method of a class? I'm trying to do the following but the compiler doesn't like it and gives me the following error: ***** error C2440: '=' : cannot convert from 'void (__thiscall CMyDlg::*)(class CString &)' to 'void (__cdecl *)(class CString &)' There is no context in which this conversion is possible ***** What would be the right way to declare the function pointer? void CMyDlg::funct1(CString &s) { s = "Funct One"; } void CMyDlg::funct2(CString &s) { s = "F...

VS2003
Hello, I have a dialog resource and have created CDialog and a CFormView classes for this dialog. If I right-click a control in my dialog I can create a variable for the control, but how do I specify which class the variable belongs to, ie. my CDialog or CFormView class? I don't see how I can tell the add variable class wizard to which class the variable should be added. I'm converting a Dialog based app to a doc-view type app and am experimenting with CFormView, which is why I have CFormView and CDialog classes referencing the same dialog resource. Thanks for any help. -R...

Text box and formatting?
I am working on class schedule and have one text box which spans a few pages. Pages are double columns. I have a header for each class and paragraph given for class description. On the last page, last column, one description appears at the top with empty space for the rest of the column. I would like to change the formatting of the text in the whole text-box so that most of the last column is used. I can select the text in the text box which expands over the few pages and play with the font size, but that would mean that all the text would be the same size. Is there a way that text...

message classes
Is it possible to change the message class of a message via inbox rule so that it could change from something (such as "Report.IPM.Note.DR") to just IPM.Note. I am trying to use inbox rules to move. redirect or forward these "delivery receipts" and nothing seems to work while unattended (not logged into mailbox). So I'd like to somehow change the message class then send it. any ideas? ...

rules created in Outlook 2003
I have a client who uses a lot of rules within Outlook 2003 to sort her mail. She is now getting this error when she attempts to create a new rule: "One or more rules could not be uplodaed to Exchange server and have been deactivated. This could be because some of the parameters are not supported or there is insufficient space to store all of your rules." Anyone have any ideas on how I can allow her to create more rules? Thanks. Hi, See this, e2k/e2k3 have the rules limit: http://support.microsoft.com/default.aspx?scid=kb;en-us;147298&Product=exch2k There"s...