mosaicer
asked on
Opening a file passed on command line
How do I go about automatically opening a file that was passed on
the command line?
I have a menu item File->Open with ID_FILE_OPEN but don't know
how to simulate a user having clicked on this. I'm trying
to write some code in the Application InitInstance.
Can I send some sort of a message and have my routine for
ID_FILE_OPEN execute? (The routine sits in my document class)
Is there a way to directly call my OnFileOpen routine from my
application class?
Maybe there's a better way to accomplish what I'm trying to do?
the command line?
I have a menu item File->Open with ID_FILE_OPEN but don't know
how to simulate a user having clicked on this. I'm trying
to write some code in the Application InitInstance.
Can I send some sort of a message and have my routine for
ID_FILE_OPEN execute? (The routine sits in my document class)
Is there a way to directly call my OnFileOpen routine from my
application class?
Maybe there's a better way to accomplish what I'm trying to do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm having problems implementing this
solution as I'm unable to call
beginning() from my application
class. Something about an
illegal call to a static member
function.
solution as I'm unable to call
beginning() from my application
class. Something about an
illegal call to a static member
function.
Sorry, I forgot to put in that part.
Map a message to the message OnInitialUpdate() in your CView class;
In that function add this.
void CMyView::OnInitialUpdate() {
CMyDocument* doc=(CMyDocument*)
GetDocument();
doc->beginning();
}
Sorry for not getting this in the answer.
Good Luck!
tvanceplus
Map a message to the message OnInitialUpdate() in your CView class;
In that function add this.
void CMyView::OnInitialUpdate()
CMyDocument* doc=(CMyDocument*)
GetDocument();
doc->beginning();
}
Sorry for not getting this in the answer.
Good Luck!
tvanceplus
ASKER
Thank you very much! This was
the last thing I had to do to finish
up this project. Yay!
the last thing I had to do to finish
up this project. Yay!
ASKER