Thread: MFC MDI Doc/View Architecture Question

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    27

    MFC MDI Doc/View Architecture Question

    I have a 2012 MSVC++ MFC MDI application which uses a PropertiesWnd.cpp file. It is generated by the wizard when I create the MFC application and ask for it.

    It is a class CPropertiesToolBar : public CMFCToolBar. It uses a CMFCPropertyGridProperty
    control to display propertys info of whatever I choose to define.

    My question is…
    How do I access CMFCPropertyGridProperty inside PropertiesWnd.cpp correctly to set the values of the CMFCPropertyGridProperty from another class in another file in scope ?

    Example:
    Would I do something like this …
    // in my header use
    CMainFrame * pMainWnd;
    pMainWnd = (CMainFrame *)AfxGetMainWnd();

    //Then where I want to do something
    CString * myString;
    myString->Append("My New Data");

    DWORD_PTR dwData;
    dwData = (DWORD_PTR)myString;
    pMainWnd->m_wndProperties.pSelectedModelInfo->SetData(dwData);

    // I’m doing this from a utility class member, I must update the properties
    // based on the mouse selections of the user

    Or should I use some kind of message mapping ?

    What is the best/correct way to do this ? I’ve looked everywhere and can’t find an example of updating the CMFCPropertyGridProperty from another class.

    Thanks,

  2. #2
    Registered User
    Join Date
    May 2010
    Posts
    27
    Ok, I need to use the messaging system. I found an article that said messages should be used in many cases
    because of the Architecture. However, I can't find an example that will work with MSVC 2012. The ones I'm finding are old and will not compile.

    Does anyone know of a modern tutorial that shows how to use user defined messages? I also cant find anything in the samples.

    Thanks for any help,

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Network Services Architecture Question.
    By Geolingo in forum Tech Board
    Replies: 1
    Last Post: 01-27-2006, 12:12 PM
  2. Architecture Question
    By Orborde in forum C++ Programming
    Replies: 1
    Last Post: 06-01-2005, 08:05 AM
  3. Question about document/view app in MFC
    By hpy_gilmore8 in forum Windows Programming
    Replies: 2
    Last Post: 05-06-2004, 07:51 PM
  4. Document/View architecture help :: MFC
    By minesweeper in forum Windows Programming
    Replies: 1
    Last Post: 09-08-2003, 10:22 AM
  5. MFC doc/view question
    By RND in forum Windows Programming
    Replies: 0
    Last Post: 01-12-2002, 01:12 AM