Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
R

requemao

@requemao
About
Posts
6
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • IE 8, I like it
    R requemao

    Rajesh R Subramanian wrote:

    toxcct wrote: you'd better be very very careful with betas, especially microsofty ones... They've also proved that their post-beta software can be as fatal too. Vista, for example.

    Do they have post-beta software at all? ;P

    The Lounge php visual-studio com

  • VC++ 6.0, MFC: Two different views attached to same document.
    R requemao

    It now works, thanks to you! I appreciate the effort you have put in explaining this to me and giving me accurate pointers. You have taught me quite something, thank you very much. Manuel M.

    C / C++ / MFC c++ question help

  • VC++ 6.0, MFC: Two different views attached to same document.
    R requemao

    Jun Du wrote:

    in CSequApp::OnFileNew(). Add code to retrieve the file name first and then call OpenDocumentFile(fileName);

    I must be overlooking something. Even after reading the whole tech note and browsing trough the member functions of CDocument and CWinApp, I still haven't found out how to retrieve the file name (which is required by the OpenDocumentFile() function). Can you please point me to the function I need? Manuel M.

    C / C++ / MFC c++ question help

  • VC++ 6.0, MFC: Two different views attached to same document.
    R requemao

    Jun Du wrote:

    1. Your app overrides OpenDocumentFile() so that it displays any views beside the default.

    Yes, this is done. When I open an existing document (and ONLY then), both views appear and work correctly. It is done this way (just like the sample): CDocument* CSequApp::OpenDocumentFile(LPCTSTR lpszFileName) { CSequDoc* pDoc = (CSequDoc*) CWinApp::OpenDocumentFile(lpszFileName); if (pDoc == NULL) return NULL; CFrameWnd* pNewFrame = m_pEditorTemplate->CreateNewFrame(pDoc, NULL); if (pNewFrame == NULL) return pDoc; m_pEditorTemplate->InitialUpdateFrame(pNewFrame, pDoc); }

    Jun Du wrote:

    1. Let your app to handle file-new command, and call the overriden OpenDocumentFile() in the command handler.

    At present, I have this in the message map: ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) If I understand you correctly, I should change it to... ON_COMMAND(ID_FILE_NEW, OnFileNew) ...and then define the OnFileNew function: void CSequApp::OnFileNew() { CWinApp::OnFileNew(); ... (some call to OpenDocumentFile()) } Is this right? In that case, what's the code I have to add there? I don't think I'll get it right myself...

    C / C++ / MFC c++ question help

  • VC++ 6.0, MFC: Two different views attached to same document.
    R requemao

    Sorry, I did not explain it correctly: It's not the Checkbook application that I'm working on. I am working on an application of my own, which needs to manage and coordinate two different views. I did not know how to achieve that, so I had a look at several articles on CodeGuru and old topics on microsoft.public.vc.mfc, with little to no success. Finally I found the Checkbook sample and tried to imitate it. I succeeded, except that the second view is only shown when I *open* an existing document, but not when I simply start the program or click File/New. I know I should add some code somewhere, because right now there is only piece of code that spawns the second view, and that is inside CMyApp::OpenDocumentFile(). The question is: where is the appropriate place for that code? (And what is exactly the code, if that's not asking too much).

    C / C++ / MFC c++ question help

  • VC++ 6.0, MFC: Two different views attached to same document.
    R requemao

    Following the CHKBOOK sample in MSDN I finally have two different views associated with the same document, and working simultaneously. The problem is that when I run my program I only get the first view. The second view only appears when I *open* a document from a file, and not when I start a new one. The cause is no wonder, because the piece of code that opens the second view is only inside the OpenDocumentFile() function. That makes sense in the sample, which is designed to work always on a file (either is opens an existing file, or it creates a new one). Q: What code should I add where, for my application to open both views on a *new* document? Furthermore, I have learnt that you can resize a view by calling its parent frame's MoveWindow() function. I would like to size each of my two views to a certain desired size at startup. What is the appropriate place to add this code?

    C / C++ / MFC c++ question help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups