Solved

Accessing Main Frame

Posted on 2003-11-03
2
134 Views
Last Modified: 2013-11-20
In my program...user preferences are loaded at start up. They are stored in the CApp part of my program because it is an MDI and that seems to make the most sense. Now...when the user opens a document...I want the program to check to see if preferences have been created...and if not...to launch the proper dialog for the user automatically. The normal way this is achieved is when the user clicks on a menu item under File called Options, the dialog opens. The handler for that menu item is in the main frame.

 From the document...how can I programatically get the MainFrames OnFileOptions() function to call so that the dialog automatically comes up for the user is preferences have not been set.
0
Comment
Question by:SGyves
  • 2
2 Comments
 
LVL 16

Expert Comment

by:_nn_
ID: 9674724
Maybe this would be enough :

AfxGetMainWnd->PostMessage(WM_COMMAND, ID_FILE_OPTIONS);

0
 
LVL 16

Accepted Solution

by:
_nn_ earned 350 total points
ID: 9674730
Ahem, sorry.

AfxGetMainWnd()->PostMessage(WM_COMMAND, ID_FILE_OPTIONS);

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
function returning CString in a regular win32 DLL 8 147
move a line in eclipse 3 60
countEvens challenge 2 58
post4 challenge 28 82
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now