recall last opened formview

Visual C++ ver 6 w/ SP6
WinXP SP1

I have a MDI app with five different formviews.  I would like to recall 
the last opened formviews when the user runs the application. ie. User 
closes the app with formviews 1,3 and 5 open...  Later on the user 
starts up the the app and formviews 1, 3 and 5 open automatically.

Since these are CMultiDocTemplate and not CDocument I haven't been able 
to translate code I've found on the Internet for CDocument example MDI 
for my MDI formview application.

Thanks,
jon
0
jon2595 (2)
12/17/2004 5:51:27 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
1039 Views

Similar Articles

[PageSpeed] 36

What does formview 1,3 and 5 mean? If these relate to an instance of a view
of a specific multidoctemplate, all you need to is persist the name or some
other token which identifies the doctemplate. And when the app opens, read
this data and create views accordingly.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"jon" <jon@comcast.net> wrote in message
news:#NIYJEG5EHA.1204@TK2MSFTNGP10.phx.gbl...
> Visual C++ ver 6 w/ SP6
> WinXP SP1
>
> I have a MDI app with five different formviews.  I would like to recall
> the last opened formviews when the user runs the application. ie. User
> closes the app with formviews 1,3 and 5 open...  Later on the user
> starts up the the app and formviews 1, 3 and 5 open automatically.
>
> Since these are CMultiDocTemplate and not CDocument I haven't been able
> to translate code I've found on the Internet for CDocument example MDI
> for my MDI formview application.
>
> Thanks,
> jon


0
ajaykalra (6842)
12/18/2004 1:42:05 AM
Five different formviews designed for different tasks, each with thier 
own CMDIChildWnd derived class.  They are not the same and only one 
instance of the formview can be opened.

I was thinking of scanning for what formviews are currently opened in 
CMainFrame::OnClose() method and saving that data to the registry.


Ajay Kalra wrote:
> What does formview 1,3 and 5 mean? If these relate to an instance of a view
> of a specific multidoctemplate, all you need to is persist the name or some
> other token which identifies the doctemplate. And when the app opens, read
> this data and create views accordingly.
> 
> --
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com
> 
> 
> "jon" <jon@comcast.net> wrote in message
> news:#NIYJEG5EHA.1204@TK2MSFTNGP10.phx.gbl...
> 
>>Visual C++ ver 6 w/ SP6
>>WinXP SP1
>>
>>I have a MDI app with five different formviews.  I would like to recall
>>the last opened formviews when the user runs the application. ie. User
>>closes the app with formviews 1,3 and 5 open...  Later on the user
>>starts up the the app and formviews 1, 3 and 5 open automatically.
>>
>>Since these are CMultiDocTemplate and not CDocument I haven't been able
>>to translate code I've found on the Internet for CDocument example MDI
>>for my MDI formview application.
>>
>>Thanks,
>>jon
> 
> 
> 
0
jon2595 (2)
12/20/2004 6:57:46 PM
Reply:

Similar Artilces:

Disabling / enabling entire menu and toolbar if child window open and has focus
Greetings, I have an MFC app within which a user can choose to go to the company's web site. If they select this from the menu, a CMDIChildWnd is created containing a CHtmlView. I need to have it so when this window is opened, all the menus are disabled and the toolbar is disabled. Also, when the window loses / gets focus, the menus are disabled / enabled respectively. Is there an easy way of doing this? How might I go about it? Thanks for your help! ~simon You can't disable *all* the menu items typically, because you want File>Exit, Help>About, other Help items, etc. en...

Records will not open
I am experiencing a problem with certain records within CRM that will not open. The system will try and try to open the record (pinging out two processors) until it finally times out. This is only with certain records but not others... Any suggestions? We experienced a similar problem. We created those records again (Leads) and deleted the old ones... all worked fine then "Phillip Sperry" <phillip.sperry@mxsecure.com> wrote in message news:9FeSb.10804$QJ3.6760@fed1read04... > I am experiencing a problem with certain records within CRM that will not > open. The syst...

Unable to Open received PO (change to "change order")
Great Plains will not allow me to change this Purchase Order from Received to Change Order: Here is the message I get: However, if I try to enter a quantity cancelled, I get: How can I re-open this Purchase Order so I can change the price??? Thank you. Unfortunately, the pasted messages did not come through. Once a line item is received, you can change its cost only during invoice matching. The process would be to return the item; add a new row with the correct cost; and receive and invoice the new item. Not an elegant solution, for sure. -- Charles Allen, MVP &quo...

VBA Code to Open File1; Open File2 copy sheets to File1
Using XL 2003 & 97 Need help with the following VBA code: Sub Macro1() Dim myNewWorkbook As String myNewWorkbook = ActiveWorkbook.Name Workbooks.Open Filename:="OldWorkbookFile.xls" Sheets(Array("Formulas", "Department Lables")).Activate Sheets(Array("Formulas", "Department Lables")).Copy _ Before:=Workbooks(myNewWorkbook).Sheets(2) Windows("OldWorkbookFile.xls").Activate ActiveWorkbook.Close Windows(myNewWorkbook).Activate ' ........ End Sub My goal is to have myNewWorkbook active then:...

When opening Excel get File Not Found error
When I open Excel for the first time, I get an error that says "Microsoft Visual Basic" in the title bar and then it says "File Not Found" I am not sure what is causing this. Any ideas? Thanks! Try opening excel in save mode excel.exe /s if you don't get the prompt, then it is probably related to a bad addin you have selected in tools=>addins or a workbook in your xlstart subdirectory. (try moving any files found there). You can then start adding things back until you find the file causing the problem. -- Regards, Tom Ogilvy "Andy" <anonymou...

Excel slow to open workbook when I double-click in Windows
Hi, I am using Excel 2007 on a brand new PC (Intel Core 2 Duo; 2.53 GHz; 3.21 GB RAM; Windows XP Pro). I have installed and started using several applications already and this PC has been very fast and responsive. I am having an issue opening workbooks in Excel. If I open Excel first and then click on the Office button and choos Open, I can open up a workbook very quickly. However, when I double-click on a workbook in Windows (without having Excel open previously), it takes a *very* long time for the workbook to open. I just timed it at exactly one minute. I was wondering if anyone...

cant open html file in outlook 2007
hi, i am having trouble opening attached html file . error is " cant create html file .press Right click on the mouse and check permission on the file" can any body help :( -- בכבוד רב, מישל ויאנקור Have you tried clearing Microsoft Outlook's secure temp folder? "michel" <vaillancourt.michel@gmail.com> wrote in message news:AF480A87-907E-464C-A8A1-6C208A477950@microsoft.com... > hi, > > i am having trouble opening attached html file . error is " cant create > html > file .press Right click on the mouse and check...

can i see the date the last time a cell was changed?
I am trying to figure out a formulla to make the date appear in one cell everytime anouther cell's data is chaged. Use a worksheet_change event to copy the cell address and put in a date stamp. -- Don Guillett SalesAid Software dguillett1@austin.rr.com "JohnNuTek" <JohnNuTek@discussions.microsoft.com> wrote in message news:5085A544-CBF4-4B81-A244-B03DE9A0E9E6@microsoft.com... >I am trying to figure out a formulla to make the date appear in one cell > everytime anouther cell's data is chaged. There really isn't a worksheet formula to do that. Typicall...

problem opening word 07
When I open word, a dialog box comes up which contains. among other things, the following instructions which I follow up to step 4 then I hit a snag as noted below. >The document contains macros. Macro language support for this application is disabled. Features requiring VBA are not available, Would you like to open this document read-only? Hide Help Open in Help Window • Microsoft Office Access, Microsoft Office Excel, Microsoft Office PowerPoint, or Microsoft Office Word -¬To check your macro security settings, click the Microsoft Office Button, click <program nam...

Open excel sheet twice at same time?
Hi, Probably a question asked all the time, but I often have trouble opening a file after making a desktop shortcut to an excel file. When opening, it gives an error message about opening a file with the same name at the same time (even though I'm not). The error message continues by saying that it doesn't matter if the files are in different folders and suggests renaming one of the files. Any ideas? Thanks. Robert No reason I can think of that would cause Excel to load the file twice irrespective of launching it from a shortcut. Couple of things to check: - The file isn'...

On opening outlook
Hi When i open outlook it always goes to a particular folder in my inbox (its a sub folder, about 5 levels down). How do i set it to 1. just open and go to the inbox 2. or open to the last folder i had open. thanks in advance Andy C Tools-> Options-> tab Other-> button Advanced Options... Here you can specify your default startup folder. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "AC&q...

trying to select the last 3 digits of a field
hello all this is the query im using (I am looking to get the last 3 characters of a field): rep_code: Right(tablename.fieldname,3) And I get this error: IDBC--call failed [Informix][Infomirx ODBC Driver][Informix]A syntax error has occurred. (#-201) Is it something wrong with my query or something outside Access 2003 (since the table I am trying to work with its using an ODBC conexion)? Any ideas??? Thanks ...

Opening a PowerPoint Presentation in a Web Browser
Set an option in a slideshow presentation if a .pps file is accessed by a webpage link (.htm, .html), open in full-screen, read-only. (PPT 2003 had this functionality.) ---------------- 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.microsoft.com/office/communi...

windows should reopen in their previously opened size and position
We use large monitors and some dual-monitor setups. Most of the dialogue windows open up designed for a small resolution setting. For example, the "cards/Accounts" window opens up and only shows 10 accounts in the collapsed view. Almost every time I use that window I have to resize and reposition it, and then as soon as it closes and reopens, it is back to the puny size again. There should be an option to "remember" window sizes and positions. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. T...

Open in the same window??? O.o
Hello, I've recently switched to Office Outlook 2003 from Outlook express because i like office outlook better, i have got everything how i want it except for one thing. When i was with Outlook Express 6 if there was a link in a message and you clicked on it, it would open the browser and then if there was another email that you went to next, then when you clicked on a link in that, it would open the link in the browser that the other link opened in, well currently with office outlook 2003 every link clicked will open a new browser and i cannot find a option to change this... ...

problem with opening a money file <WEIRD>
I have used money 2005 for a year. Couple days ago I had to format my hard drive and install Windows XP a new. I saved my money mny file and the backup to it in the safe place. When I installed MS Money on my new system and tryed to open my mny file it displayed this error: --------------------------------------------------------------------- Money cannot locate 'filename' or cannot open it, possibly because it is a read-only file or you do not have permission to change it or your disk drive is write protected. If you have chosen the correct file and it cannot be accessed, you wi...

Open one form with different queries
Is it possible to open one form using a different query depending on what button the user selects. For example: Sort High/Low Sort Old/New Search MRN Search Account# Search SSN I should also mention that this form has a subform. Got it. Below is what I put behind a button on the form for Sort High/Low and it filters using a query. Dim stHighLow As String stHighLow = "SortHighLow" DoCmd.ApplyFilter stHighLow "Sash" wrote: > Is it possible to open one form using a different query depending on what > button the user selects. For example...

Can't Open Read-Only database
I'm trying to open an mdb file with 2007 and 2003 but can't. I get an error the database is read-only, even though the file attribute isn't. I suspect it's an older version than I have. Am I stuck having to install an old version or is there a workaround? -- Regards from Los Angeles, Emmanuel Microsoft Windows Vista Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.4 GHz 3GB RAM NVidia GeForce 8500 GT 512 MB Hi Emmanuel, Do you know what version the original MDB file was created in? Access 2002(xp) etc... "Emmanuel Garcia" <imanuel.garcia@gmail.com> wrote in mess...

Opening an old Word document, date changed to current date
When I open old Word documents, the date gets automatically changed to the current date and I can't view the date that the document actually had. I am using MS Office 2007, but the old document was created in Word 2003. I can see the date that the file was last modified in the details of the file, but I cant guarantee that the date of the document is the same as the date last modified for the file. Press Alt+F9 to toggle the field code display and edit the DATE field code to read CREATEDATE. Then Alt+F9 to toggle back and F9 to update. The date displayed will be the date th...

Access denied when opening ESR (2003)
When I try to open Exchange System Manager I get the following error: Access is denied Facility:Win32 ID No: c0070005 Exchange System Manager. As a result I can't do anything. Any ideas please? Did you change the HTTP port on your Default Web Site? It should be 80. -- Regards, Menko den Ouden MCP 2003,MCSE 2000, MCSE NT4+I Netherlands "Piet" <Piet@discussions.microsoft.com> wrote in message news:5C110BE2-446B-4F86-9A6C-7FCBB5FC8E7A@microsoft.com... > When I try to open Exchange System Manager I get the following error: > > Access is denied > Facility:Win...

Open a workbook also opens "Book1.xls"
Hi all, I wonder if it is possible to stop Excel from opening a copy of "Book1.xls" everytime a workbook is opened. (I.e. I just want to open the required workbook, not simultaneously open a copy of "Book1.xls" as well). Thanks, Oscar Not sure what you mean. When I double-click on an XLS file in Windows Explorer, book1 doesn't open, only the requested workbook. If you want to start Excel without opening a workbook, try the /E switch. For example: "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" /e HTH, JP On Mar 18, 1:13=A0pm, Oscar W <...

Go to Last in Column
How can I make the the last non empty cell in column "A" active after Sorting? Thank -- Message posted from http://www.ExcelForum.com Hi ActiveSheet.Cells(Rows.count, 1).End(xlUp).select -- Regards Frank Kabel Frankfurt, Germany "Dave Matthews >" <<Dave.Matthews.1b5hdl@excelforum-nospam.com> schrieb im Newsbeitrag news:Dave.Matthews.1b5hdl@excelforum-nospam.com... > How can I make the the last non empty cell in column "A" active > after Sorting? > Thanks > > > --- > Message posted from http://www.ExcelForum.com/ > ...

Last Name Between...And Statements
Hopefully someone can help me with this. I'm trying to create an Access database that will pull a list of people based on the first two letters of their last name. Since this list will vary, depending on the user of the database, I want to use dialogue boxes so that a person can put in their own parameters for the list. For example, say my list is Dn-Km. A dialogue box will pop up, asking for the beginning of the alpha range. Then, once the person clicks on the OK button, a second dialogue box will pop up, asking for the end of the alpha range. So far, I've figured out that you can...

I cannot open other Publisher documents sent to me. Why not?
When someone sends me a file of a Publisher docmant I cannot open it. Any suggestions? I assume you have Publisher. Which version? Which version were the files created in? What specifically is the problem? -- JoAnn Paules MVP Microsoft [Publisher] "rafe" <rafe@discussions.microsoft.com> wrote in message news:26762730-9244-4183-9A9A-D051D53F7C12@microsoft.com... > When someone sends me a file of a Publisher docmant I cannot open it. Any > suggestions? JoAnn Paules wrote: > I assume you have Publisher. JoAnn, JoAnn, JoAnn... What have I told you about assum...

Not able to open attachements in outlook 2007
I have just converted from Outlook Express to Outlook 2007. The oonly problem i have it that I am not able to view, open or save attachements. e.g I can see there is a word doc attached in the preview pane. I double click to open the mail and i can still see the doc. I double click the doc and i get a dialog box saying "you should only open attahcments from a trustowrty source. Attachement : xxxxx.doc from xxxxx - message (html) Would you like to open the file or save it to your computer? there there are 3 buttons open save and cancel When I say open i get the message "the op...