Randy C
May 14th, 1999, 01:48 PM
I'm sure I'm not understanding something very basic here. I thought I had my SDI project all done, when there suddenly arose a need to provide the program one small piece of info before it ran. It occurred to me that the easiest thing to do would be to pass it the item in the command line as a parameter, and since I wasn't using any of the typical OnNewDoc() file type commands, I thought it would be a snap to just parse the applications m_lpCmdLine member, and just remove the standard ParseCommandLine(cmdInfo) stuff. Well I certainly was able to pick off the string I'd passed to the app, but then as soon as the app called m_pMainWnd->ShowWindow(SW_SHOW), it would crash because the window didn't exist. I tried doing the above the "right" way by actually overriding the CCommandLineInfo class and handling it there, but the same thing happened. To me it looks like the very act of passing ANY parameters causes the application to be run differently, so that not even the main window is available. I guess that's why the subsequent call is called ProcessShellCommand(), because maybe it's treating it like a console program? I don't know, but I'm hoping there is a simple way to make it DO WHAT I MEAN!
--Randy C
* * * Second star to the Right!
--Randy C
* * * Second star to the Right!