OnFileNew() 
Author Message
 OnFileNew()

Hello again,

is there a way to change (NOT override) the OnFileNew() Funktion? I just
want to send over a pointer to a structure. (contains eg. a port-number,
window title, window size, ...). Or will I have to create and connect
Doc/View/Frame myself?

Thanks

Kai



Fri, 24 Oct 2003 04:56:18 GMT  
 OnFileNew()
I advise against changing the MFC source code in any way.


Quote:
> Hello again,

> is there a way to change (NOT override) the OnFileNew() Funktion? I just
> want to send over a pointer to a structure. (contains eg. a port-number,
> window title, window size, ...). Or will I have to create and connect
> Doc/View/Frame myself?

> Thanks

> Kai



Fri, 24 Oct 2003 11:25:32 GMT  
 OnFileNew()
Be more specific about what you have, and what you want to have.  Like Sam said,
don't mess with changing MFC source.  I'm sure there are half a dozen ways to
get the functionality you want, using MFC as is.


Fri, 24 Oct 2003 12:30:49 GMT  
 OnFileNew()



Quote:
> Be more specific about what you have, and what you want to have.  Like Sam
said,
> don't mess with changing MFC source.  I'm sure there are half a dozen ways
to
> get the functionality you want, using MFC as is.

Ok. I get a command (via TCP/IP) which will call a function that is part of
CMyApp. This Function is supposed to open a new document and the according
view/frame (this is as far as OnNewFile() goes). But now I would like to
change the appearance and content of the new window (it's a MDI, sorry
forgot to mention that) while and after creation to display the data I get
trough the TCP/IP Connection. At least I need to pass over an int value (the
portnumber) to the new doc/view.

Tell me if you need more info's

Kai



Fri, 24 Oct 2003 17:38:41 GMT  
 OnFileNew()
So the important thing is that you DO want to override the MFC processing
instead of "changing" it. You can add to your document a function to set
member variables such as the port number. Actually, it would work to just
make things like port number a public member of the document class, so it is
a matter of style which solution you prefer. You can add to your application
a handler for the ID_FILE_NEW command and in the OnFileNew override that
ClassWizard generates, after the call to CWinApp::OnFileNew, do what you
need to do to pass the additional data to the document. I assume you can
work out the details but if not let us know.


Quote:



> > Be more specific about what you have, and what you want to have.  Like
Sam
> said,
> > don't mess with changing MFC source.  I'm sure there are half a dozen
ways
> to
> > get the functionality you want, using MFC as is.

> Ok. I get a command (via TCP/IP) which will call a function that is part
of
> CMyApp. This Function is supposed to open a new document and the according
> view/frame (this is as far as OnNewFile() goes). But now I would like to
> change the appearance and content of the new window (it's a MDI, sorry
> forgot to mention that) while and after creation to display the data I get
> trough the TCP/IP Connection. At least I need to pass over an int value
(the
> portnumber) to the new doc/view.

> Tell me if you need more info's

> Kai



Sat, 25 Oct 2003 07:44:36 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Using onfilenew

2. OnFileNew()

3. OnFileNew()

4. Error on ProcessFileCommand (OnFileNew)

5. OnFileNew(), OnNewDocument(), ...

6. OnFileNew.

7. Overriding CWinApp::OnFileNew

8. How to exit the app from OnFileNew

9. OnFileNew

10. CWinApp::OnFileNew and different things

11. Where to find CWinApp:OnFileNew() code

12. void CDocManager::OnFileNew()

 

 
Powered by phpBB® Forum Software