Re: Problem opening serialized file via Open command associated with file type

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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.

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 file
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

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm


.



Relevant Pages

  • Re: Forced Base Address and FIXED
    ... > 0x400000 is because I need to compare results obtained from IDA Pro. ... > As my experiences tell me that IDA Pro is well-capable to load its ... >> The only really practical way to write a debugger is using the ...
    (microsoft.public.win32.programmer.kernel)
  • PicoBlaze and (leon) grlib CAN2B core / spartan3E starter kit
    ... clk: in std_logic; ... -- 'lcd_drive' is used to differentiate between LCD and StrataFLASH ... load s0,00 ... compare sa, 01 ...
    (comp.arch.fpga)
  • Re: loss of data depending on security permissions
    ... > hosts the Applet. ... You don't need extra security permissions to load a URL from the server ... Save the downloaded image to a file and do a binary compare. ...
    (comp.lang.java.programmer)
  • Re: Help with TCB status
    ... The compare and load ... For IBM-MAIN subscribe / signoff / archive access instructions, ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ...
    (bit.listserv.ibm-main)
  • Re: Tire rolling resistance
    ... compare with other data, such as the Tour mag test results given in a ... For the road tires the load was 50kg... ... by that to get Crr. ...
    (rec.bicycles.tech)