Re: Problem opening serialized file via Open command associated with file type
- From: "tlillys" <tlillys@xxxxxxx>
- Date: Sun, 16 Mar 2008 06:15:49 -0400
Finally got back to this. The failure is occuring in MyApp.InitInstance().
The call to ProcessShellCommand(cmdInfo) returns 0. I compared the
CCommandLineInfo object after ParseCommandLine is called for the case when
the application is opened normally and when you click on a filetype
associated with the application, and noticed the following differences:
Normal Execution "Open" command
through file registry
m_nShellcommand FileNew FileOpen
m_strFileName empty full path and
name of file I double-clicked on
Use DDE is checked in the dialog used to edit the action for the file type,
but no DDE command is used. Just for the sake of trying, I added Open("%1")
to the DDE command message and got a error dialog that the file couldn't be
found.
Any other words of wisdom?
Ted
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:2jbar39htk0s6bcjm92q8ji066eirgs4h3@xxxxxxxxxx
Well, single-stepping will reveal a lot. You would have to see why it is
causing a
problem. Since it is the first object, it probably happens early enough
in the file that
it is realistic to see what is going wrong. For example, making sure you
are in the right
class for the document. I'm not sure what is going wrong, but I'd start
by doing a lot of
single-stepping and studying backtraces that got me to where I currently
am, and compare
what I see on a successful load to what I see on a failing load.
joe
On Thu, 14 Feb 2008 14:31:12 -0500, "tlillys" <tlillys@xxxxxxx> wrote:
Thanks, Joe - nice trick.Joseph M. Newcomer [MVP]
It's crapping out when it comes to the first CObList object to load when
serializing the Document. Any clues as to why it would have difficulty
loading a CObList object when opening the project file directly (clicking
on
the file in windows explorer)? The file opens fine via "File|Open..."
within the applicaiton.
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:di09r3h3i3fpf61tasd98ib8fs15fnodo4@xxxxxxxxxx
Put a DebugBreakpoint() call, or even a simple ASSERT(FALSE), to see
what
is really going
on. These will allow you to get into the debugger.
joe
On Thu, 14 Feb 2008 10:22:00 -0500, "tlillys" <tlillys@xxxxxxx> wrote:
I have an SDI MFC application that produces a serialized project fileJoseph M. Newcomer [MVP]
via
CObject's serialization support. The application can read the file from
within the application just fine. The installer registers the program
and
the file extension properly and associates the file type with the
application. However, when I double click on the project file, the
application generates an "Unexpected File Format" message.
Is there a method in the document class that needs to added to handle
this
functionality?
I want to try and debug the problem but not sure how to invoke the
debugger
inVisualStudio when selecting the file. Any clues on how to do that?
tia
Ted
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Prev by Date: Re: CListCtrl::SetItemState() and keyboard navigation
- Next by Date: Re: Problem opening serialized file via Open command associated with file type
- Previous by thread: TreeCtrl on a PropertyPage
- Next by thread: Re: Problem opening serialized file via Open command associated with file type
- Index(es):
Relevant Pages
|