How to create a new document by clicking open?

**** Post for FREE via your newsreader at post.usenet.com ****

Hi

I'm using VC++ 6 and my problem is that I have a program (MDI) that displays
images whenever a user clicks on the open button (on toolbar or menu).
Everything works fine, until the user closes the MDI child window. The way
my program works is that he now needs to click on 'File > New' to open a
blank window, then to click on 'File > Open' to open the image in the newly
created window. The user cannot open an image directly with the 'open'
button if a blank window is not already created.
How can I make the 'File > Open' option do both tasks i.e create a blank
window and display the image inside? (I have already implemented the codes
to display the image).

Any help is welcomed.
Thanks

Scroller



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
                      http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
0
scrolok (1)
5/30/2004 7:15:02 AM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
722 Views

Similar Articles

[PageSpeed] 14

I suspect you are not clear enough in your mind about
what 'open' does. It sounds to me as though your 'open'
code is more like 'import' .

The problem may that you started with an open 'New' file.
You really need to get you app going so than the code in
OnOpenDocument() opens and displays the file.

The 'new' blank file should really only display
an image if you 'import' the image. Open doesn't mean read
into the current document! Probably you should also
supress the automatically generated 'new' file.

Do this in the application's InitInstance().

Something like:
 // Parse command line for standard shell commands, DDE, file open
 CCommandLineInfo cmdInfo;
// add this.....................
 // don't open new file on startup
 cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
//........................to here
 ParseCommandLine(cmdInfo);




"Scroller" <scrolok@hotmail.com> wrote in message
news:40b98a59@post.usenet.com...
> **** Post for FREE via your newsreader at post.usenet.com ****
>
> Hi
>
> I'm using VC++ 6 and my problem is that I have a program (MDI) that
displays
> images whenever a user clicks on the open button (on toolbar or menu).
> Everything works fine, until the user closes the MDI child window. The way
> my program works is that he now needs to click on 'File > New' to open a
> blank window, then to click on 'File > Open' to open the image in the
newly
> created window. The user cannot open an image directly with the 'open'
> button if a blank window is not already created.
> How can I make the 'File > Open' option do both tasks i.e create a blank
> window and display the image inside? (I have already implemented the codes
> to display the image).
>
> Any help is welcomed.
> Thanks
>
> Scroller
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>  *** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
>                       http://www.usenet.com
> Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


0
5/30/2004 9:40:32 AM
Hi Pa

Actually I have an image display application. I have used the MFC wizard to create the application (MDI) and I have already implemented the code to 'read' an image from a file when a user clicks 'File > Open' from the menu. However, I can do this only on an MDI child. If I close the MDI window, I cannot use the code I have written in the projectview class to 'read' the image. I need to click on 'File > New' to be able to use 'File > Open'

Now what I want is to allow the user to use 'File > Open' directly, without having to use 'File > New'

Thx in advanc
Scroller
0
anonymous (74717)
5/31/2004 3:31:02 PM
Reply:

Similar Artilces:

Automatic Appling AR documents
- I'm looking for a routine that can be scheduled to run through all unapplied payments and auto-apply them for all customers within a GP10 Company. Any/all assistance is appreciated. Thanks Jon Jon, I believe the Microsoft Professional Services team has a tool for sale that will do this. Your GP Partner should be able to help you with details and pricing on this. -- Victoria Yudin Dynamics GP MVP Want to use Crystal Reports with GP? http://www.flex-solutions.com/gpreports.html blog: http://www.victoriayudin.com "JColesby" <jcolesby@gmail.com>...

create a roster
How can you create a weekly roster in which functions can be assigned to more than 10 people. The roster should be updatable, so that when holidays and days off are marked on the weekly roster they will be taken account of it future rosters. ...

importing or creating reference footnotes
I am trying to import a word document into publisher and it has reference footnotes within the document. The reference footnotes are not coming into the publisher document with the reference footnotes. Correct, they will not up to Publisher 2003. In Publisher 2003 depending on which version of Word you are using if they will or not. -- "If you don't know where you are going, any road will take you there!" ...

Generating a document from Opportunity
Opportunities for us are the center of the sales cycle. What is the "best practices" solution to create a document that is launched from an Opportunity that pulls in the relevant data of the Company name and address, and stock and custom Opportunity fields? In a perfect world it would automatically post an activity in the Opp's history and attach the said merged document to that activity. Any thoughts or direction, much appreciated. Rich Scott Hi, Richard. I have the same question. I actually wonder what are the "best practices" for creating a document from a...

VLookup in other document
Here is my problem. Please help I have two documents A and B. In document A I have a table existing of codes and descriptions Range A1: B100 Column A contains codes, Column B contains descriptions In document B I want to lookup the description for a given code. I have a cell C10 containing the code and a cell C11 containing a formula =VLOOKUP(A1;'K:\Douane\Regressie\[RTScenario.xls]FxP'!$A$1:$B200;2) Till so far it works !! But I use this formula many times in my excel sheet and in many Excel documents, so if Ithe lokation of document A changes, I have to change all the for...

Mailbox not created when AD account created
A couple of days ago I noticed that I created a user account but the 'Email Addresses' tab of the user properies did not list any email addresses. Subsequent new user accounts have all experienced the same. I researched the knowledge and tried the recommended solutions to either manaully start the recipient update service or rebuild te recipient update service. Neither recommendation has resulted in a mailbox being created for this particular user or any additional user that I have created since this error first showed up. I performed a Windows update last Thursday and so I bel...

Task Create - Status
I'm trying to make a simple task, when a user owner is assigned a task in CRM, it receives an email letting it know it has one. I have the following below, but it is not generating one when i assign one manually in the CRM. What to do? I've tried both the following: When task is created E-Mail to:[owner];Subject test As well as: When task is created if Task activity status = Open then E-Mail to:[owner];Subject test I've checked the mailserver many times over, and I can send emails manually from the CRM so you can rule that out Tested out ok on our end. Some ideas:...

Excel Open and Close
I have a problem, whereby sometimes after closing Excel and then looking on task manager the excel process is still running. When opening excel again all that appears is the menu icons and the grey surrounding the actual spreadsheet. No actual spreadsheet appears. Needless to say it is also locked up. If I close that spreadsheet, and also end the process for one that is running in task manager, upon opening excel again it is fine. I've tried doing detect and repair, but this doesn't help. It is also intermittent as I guess only 50% of the time closing excel will still leave the process...

Outlook slow to open messages
Hi, I am running WinXP with SP2, IE7 and Office 2003 professional with all updates installed on a 3GB PC fitted with 1Gb RAM. The PC is probably 3 years old now. Since the May updates I have noticed that Outlook 2003 is slow to open messages when moving the selection bar to or from an HTML message. The delay seems to vary day to day so it is reasonable some days and slow on others. At its worst it can take about 30 secs for some messages to open. Outlook itself opens up at the same speed it always has but opening messages has noticeably slowed down. I read one message about deleting ...

Pivot Table update without opening the Excel file.
Hi, I have a spreadsheet saved as an xlt. It has three pivot tables which connect to CSV data files using Microsoft Text Driver. The CSV files are updated overnight by an external application. The Excel file is in \\Server\Viewers The Data files are in \\Server\Data Local users use a shortcut to open the Excel file on \\Server\Viewers which the does an auto-update from the CSV files. The pivot table data is updated. All that has been working perfectly for years, internally. Now I need to send the same excel file to another company by email. I have succeeded in writing a vbscript that creates...

New Store in other country
hi all, we have opened a new store in other foreign country, the problem is this new store will receive stock and sell with his local currancy ( currancy rate 1.2 ). How can we manage this store ( calculate the cost ,reports... etc) in HQ. any help please thanks Get ready for a lot of manual work. The way I handle it is each stoer is in local currency. When I transfer something from location to location, I manually change the costs on the transfer in at the receiving store. "Sad" <Sad@discussions.microsoft.com> wrote in message news:B929754D-D285-42BA-B2D1-03D6D0262902...

Problem opening Forms
I have several Forms that do not open properly... When I open Access, click on the Forms object, and then choose a particular Form, it opens to a blank screen. On the blank screen, I can see the Form when I select design view, however, when I choose Form view, nothing's there. I've done some playing around and have figured out a way to get the Form to display (in Form view). I go to design view and change 'Data Entry' to 'No'. What's also strange is that my switchboard will open the Form (in Form view) every time. It's only when I open the Form without the...

Help Creating XmlNode / XmlAttribute Elegantly
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString" value="server=(local);" /> </appSettings> </configuration> I am using a XmlDocument for my base implementation. I am looking to see if there is a better way to add a new node / attribute than using XmlDocument.InnerXml. I would consider this to be a hack but couldn't really see another way of doing this without definin...

Create external database
Hi all. I need to create an external database (file). On a site I found this code: ------------------------------------------------------ Function CreateLinkedExternalTable(strTargetDB As String, strProviderString As String, strSourceTbl As String, strLinkTblName As String) As String 'strTargetDB = Source Database Name 'strProviderString = Not used, currently hard coded 'strSourceTbl = Source Table name in the database we are linking too. 'strLinkTblName = Table name we would like to see in the Access Database. Dim catDB As ADOX.Catalog Dim tblLink As...

Convert two separate Word documents into one
Anybody know how to merge/convert two separate (one page) Word document into one (two page) document? HELP> In news:B5526982-84F0-4552-A34F-7F72AB3DADDC@microsoft.com, CAOWEN <CAOWEN@discussions.microsoft.com> typed: > Anybody know how to merge/convert two separate (one page) Word > document into one (two page) document? > > HELP> Open one of them. PUt the cursor at the very bottom (CTRL-END keys works well for that). Click Insert File. Save the resulting combined file to a NEW NAME to avoid losing either of the two originals. HTH, Twayne ...

How to create pie chart with %
I have got a problem that I don't if excel could help me to calculate the % within a column and draw a pie chart. My case is I have a column containing a series of numbers. e.g. 1,4,8,1,3,9,11,2,4,5,6,.........etc I want to draw a pie chart that showing 1-3 , 4-6, 7-9, >9 with the corresponding % inside that column. Can anyone tell me how can I make it ? Ray - You need to calculate the frequencies in your data. Let's assume your data is in A1:A12. In B1:B3 enter these numbers, the upper limits on the groupings: 3 6 9 You can enter ">9" into B4 witho...

Open Report
Using MS Access 2003. I have a filter form that opens a report based on the criteria selected. The user can select 4 different reports. 3 work fine. The other one requires the user to press the process report button twice. On the second press, the report opens fine. I debugged for errors upon opening the report and the degger returns a 0 for err.number after the report is opened. Ideas? Thanks. ...

Email address not created when a new user is created
All, This issue recently happened in my company. Upon creating a new user, the policy was set to create the smtp and X400 address automaticaly. Now when we create a user the smtp and x400 addresses are not created, and when attempting to setup the new user in outlook, the address cant be found. We are using exchange 2003 SP1 on Win2k3 servers. On Wed, 13 Jul 2005 06:49:07 -0700, "Bryan" <Bryan@discussions.microsoft.com> wrote: >All, >This issue recently happened in my company. Upon creating a new user, the >policy was set to create the smtp and X400 addres...

how do I copy a range to a new sheet
Now that I this group solved my problem of flagging dates of my club members as "expired", how would I automatically copy all of the members that are expired to a new worksheet so I can use this for a mail merge? I would need to check the condition of the expired column, YES or NO, then copy the yes's name and address columns only to a new page. TIA Why not just add that column and when you use mailmerge, just include the records with that flag set the way you need? If you really want to copy the rows, you could apply Data|Filter|Autofilter and filter to show just those mem...

when form created
I have a form which was created by someone else (not a form template) which is like a questionnaire with empty boxes to be completed. When the boxes are typed in all the margins move to accommodate the words being typed. Is there a way to fix/lock the original form and then just fill in the blank boxes? I suspect this is set up as a table with auto resizing enabled. Displaying table gridlines (Table | Show Gridlines) will help you see what you're dealing with. Then select the table, go to the Table tab of Table Properties, click Options, and clear the check box for "A...

Exchange 2010 MRM, no log files being created
I'm hoping someone can help me with this issue....it has been driving me crazy for days. I have enabled MRM logging on our exchange server, and I can see that some of the policies are working when I run start-managedfolderassistant. We have a retention policy tag on the deleteditems folder, and this does work. The problem is I am not getting any files in the MRM log directory. C:\Program Files\Microsoft\Exchange Server\V14\Logging\Managed Folder Assistant Events 9021 and 9022 are logged in the Application log, but where are the files? Below is the output of my mai...

Outlook notification of new mail.
To clarify, the notification works for new messages to Inbox, but fails to display the icon when the message is automatically moved to a subfolder based on a rule. A quick look in Google seems to to suggest that this is something that has been deliberately changed from Outlook XP. Cheers Paul <paul.francis@agresearch.co.nz> wrote: > To clarify, the notification works for new messages to > Inbox, but fails to display the icon when the message is > automatically moved to a subfolder based on a rule. A > quick look in Google seems to to suggest that this is > somethin...

How do you edit HTML source in a new outlook email message?
Trying to create a new email message by inserting HTML. I don't see a place to edit source for a new message. This is probably a really easy thing to do, I just can't find out where the "edit source" option is, and the help files don't seem to be any help. Thanks, Justin The feature doesn't exist in Microsoft Outlook. "justinvanderpol" <justinvanderpol@discussions.microsoft.com> wrote in message news:1ADC71DF-40BC-4656-98A8-A473EB40E837@microsoft.com... > Trying to create a new email message by inserting HTML. I don't see a > place ...

Creating a Brochure
How do you create a 3-column brochure from scratch for Publisher 2002? I can only find the directions for the 2003 version. Quick help would be appreciated, project is due Monday. Create a three-panel or four-panel folded publication http://office.microsoft.com/en-us/assistance/HP011646681033.aspx Scroll down to the section that says "Build a three-panel or four-panel publications from scratch." -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Derek" <Derek@discussions.microsoft.com> wrote in message news...

Can't open excel documents
When I try to open an excel doc is 'stalls' ... getting stuck on 'virus scan' dialouge at the bottom of the sheet. I can open excel w/o a file and save one, but when I try opening an existing one, Excel simply won't do it and I eventually have to contl.alt.del. it in order to continue. Any ideas? ...