[MFC][WinNT] How to save user's data when some conditions are met? 
Author Message
 [MFC][WinNT] How to save user's data when some conditions are met?

Hi,

I have a MFC appwizard genereted MDI app. I want to save user's data at the
moment when some conditions are met. I send a message ID_FILE_SAVE_AS from
document either to main frame or view and nothing happens. I don't know why?
When a user choose "Save As" from menu, a CFileDialog is open. Below is
sample of code:

 CApp* pApp = (CApp*)AfxGetApp();
  if (pApp)
 {
      CMainFrame* pMainFrame = (CMainFrame*)pApp->GetMainWnd();
      if (pMainFrame)
      {
           pMainFrame->PostMessage(ID_FILE_SAVE_AS, 0, 0);
      }

Quote:
}

Thanks a lot for any help
Julius


Tue, 26 Apr 2005 10:58:01 GMT  
 [MFC][WinNT] How to save user's data when some conditions are met?

Quote:

> Hi,

> I have a MFC appwizard genereted MDI app. I want to save user's data at the
> moment when some conditions are met. I send a message ID_FILE_SAVE_AS from
> document either to main frame or view and nothing happens. I don't know why?
> When a user choose "Save As" from menu, a CFileDialog is open. Below is
> sample of code:

>  CApp* pApp = (CApp*)AfxGetApp();
>   if (pApp)
>  {
>       CMainFrame* pMainFrame = (CMainFrame*)pApp->GetMainWnd();
>       if (pMainFrame)
>       {
>            pMainFrame->PostMessage(ID_FILE_SAVE_AS, 0, 0);
>       }
> }

> Thanks a lot for any help
> Julius

ID_FILE_SAVE_AS is not a message.  It is a parameter in a WM_COMMAND
message.  Look up WM_COMMAND in the help for the exact parameters
required.

--
Scott McPhillips [VC++ MVP]



Tue, 26 Apr 2005 13:42:03 GMT  
 [MFC][WinNT] How to save user's data when some conditions are met?
Thanks a lot Scott
Julius



Quote:

> > Hi,

> > I have a MFC appwizard genereted MDI app. I want to save user's data at
the
> > moment when some conditions are met. I send a message ID_FILE_SAVE_AS
from
> > document either to main frame or view and nothing happens. I don't know
why?
> > When a user choose "Save As" from menu, a CFileDialog is open. Below is
> > sample of code:

> >  CApp* pApp = (CApp*)AfxGetApp();
> >   if (pApp)
> >  {
> >       CMainFrame* pMainFrame = (CMainFrame*)pApp->GetMainWnd();
> >       if (pMainFrame)
> >       {
> >            pMainFrame->PostMessage(ID_FILE_SAVE_AS, 0, 0);
> >       }
> > }

> > Thanks a lot for any help
> > Julius

> ID_FILE_SAVE_AS is not a message.  It is a parameter in a WM_COMMAND
> message.  Look up WM_COMMAND in the help for the exact parameters
> required.

> --
> Scott McPhillips [VC++ MVP]



Tue, 26 Apr 2005 14:12:31 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to save user's data when some conditions are met?

2. Bay.net user's group meeting

3. Bay.net user's group meeting

4. vc++ developped program worked fine on winNT but can't save on win2000

5. ending a blocing sockets call (am using MFC's CSocket class)

6. data from CEditView won't save properly

7. Mid Atlantic VC++ User Group Meeting Announcement

8. Mid Atlantic VC++ User Group Meeting Announcement

9. Mid Atlantic VC++ User Group Meeting Announcement

10. Mid Atlantic VC++ User Group Meeting Announcement

11. Mid Atlantic VC++ User Group Meeting Announcement

12. Portland Area .NET User Group (PADNUG) Meets 9/24/01

 

 
Powered by phpBB® Forum Software