failed to create empty document
rwagner -- rwagner@genre.com
Tuesday, July 09, 1996
Environment: VC++ 4.1 / Win 95, MFC AppWizard, ClassWizard. Have MSDN level 1.
I'm getting a runtime error, 'failed to create empty document'
when I try to run the release version of an app based on the above. The debug
version works but the function CreateProcess() always returns 0 (won't work
properly), and I see a few 'First-Chance Exceptions' in the trace window of the
IDE.
After commenting out any references to CreateProcess(), the problem remained.
I've searched for the error both in the help files, and in the MFC source. No
matches. I understand that the problem might not be MFC related, but the error
suggests that it is interacting with MFC in some way (a 'document' was
mentioned, no?), and I'd love to learn how this can happen, and how to trace it.
Thanks,
Rob
funduc@sprynet.com
Saturday, July 13, 1996
[Mini-digest: 2 responses]
Hi,
I've seen that happen in a CFormView-derived object when the dialog could not be
created (one of the controls' class was not registered). This does not sound to
be that same problem but you might want to check all member variables in that
view and doc are initialized. The release version dosn't do that for you. You
can then start overriding in OnOpenDocument and put message boxes until you hit
the problem.
On 9 Jul 96, rwagner wrote:
>Environment: VC++ 4.1 / Win 95, MFC AppWizard, ClassWizard. Have MSDN level 1.
>
>I'm getting a runtime error, 'failed to create empty document'
>when I try to run the release version of an app based on the above. The debug
>version works but the function CreateProcess() always returns 0 (won't work
>properly), and I see a few 'First-Chance Exceptions' in the trace window of the
>IDE.
>
>After commenting out any references to CreateProcess(), the problem remained.
>
>I've searched for the error both in the help files, and in the MFC source. No
>matches. I understand that the problem might not be MFC related, but the error
>suggests that it is interacting with MFC in some way (a 'document' was
>mentioned, no?), and I'd love to learn how this can happen, and how to trace
it.
>
>Thanks,
>Rob
>
Mike Funduc
Funduc Software Inc.
Search and Replace and other Windows 95/NT utilities at URLs below.
funduc@sprynet.com
102372.2530@compuserve.com
http://home.sprynet.com/sprynet/funduc
http://ourworld.compuserve.com/homepages/funduc
-----From: "Stew: Rob Stewart"
If, while the debugger is running, you configure exception handling to break
when exceptions are thrown, you can look through the call stack to determine
where it was thrown and what led to the condition:
1. Choose Exceptions from the Debug menu
2. Choose the last item in the Exceptions list (Microsoft C++
Exception)
3. Click the Stop Always radio button
4. Click OK
To see the call stack, choose Call Stack from the View menu.
Once you know where things are going awry, you can set breakpoints to stop
in the problem code before the exception is thrown.
Robert Stewart | My opinions are usually my own.
Datalytics, Inc. | stew@datalytics.com
| http://www.datalytics.com
Mats Mеnhav -- manhav@connectum.skurup.se
Tuesday, July 16, 1996
-- [ From: Mats Manhav * EMC.Ver #2.5.02 ] --
Try putting a function call to GetLastError() after the failing
CreateProcess.
This will give you a DWORD as result, look for this number in the file
msdev\include\winerr.h
Then you will have an answer why it fails and may be able to debug further
from there.
Mats
-------- REPLY, Original message follows --------
> Date: Tuesday, 09-Jul-96 11:59 AM
>
> From: rwagner \ Internet: (rwagner@genre.com)
> To: MFCList \ Internet: (mfc-l@netcom.com)
>
> Subject: failed to create empty document
>
> Environment: VC++ 4.1 / Win 95, MFC AppWizard, ClassWizard. Have MSDN
level 1.
>
> I'm getting a runtime error, 'failed to create empty document'
> when I try to run the release version of an app based on the above. The
debug
> version works but the function CreateProcess() always returns 0 (won't
work
> properly), and I see a few 'First-Chance Exceptions' in the trace window
of the
> IDE.
>
> After commenting out any references to CreateProcess(), the problem
remained.
>
> I've searched for the error both in the help files, and in the MFC source.
No
> matches. I understand that the problem might not be MFC related, but the
error
> suggests that it is interacting with MFC in some way (a 'document' was
> mentioned, no?), and I'd love to learn how this can happen, and how to
trace
> it.
>
> Thanks,
> Rob
>
-------- REPLY, End of original message --------
--
==========================================================================
Mats Mеnhav (Mats Manhav for 7-bit people)
email:manhav@connectum.skurup.se WWW: http://connectum.skurup.se/~manhav
FAX: (int) 46 (0) 414 243 05 Phone: (int) 46 (0) 414 243 05
==========================================================================
rick cameron -- rick_cameron@msn.com
Monday, August 12, 1996
Hi, Rob
The message string comes from a string resource, with the ID
AFX_IDP_FAILED_TO_CREATE. It's displayed in several places in the MFC source.
Try putting a breakpoint on each one. When you know which function is
displaying the message, you may be able to determine what's going wrong.
- rick
owner-mfc-l@netcom.com on behalf of rwagner wrote:
> Environment: VC++ 4.1 / Win 95, MFC AppWizard, ClassWizard. Have MSDN level
1.
>
> I'm getting a runtime error, 'failed to create empty document'
> when I try to run the release version of an app based on the above. The
debug
> version works but the function CreateProcess() always returns 0 (won't work
> properly), and I see a few 'First-Chance Exceptions' in the trace window of
the
> IDE.
>
> After commenting out any references to CreateProcess(), the problem
remained.
>
> I've searched for the error both in the help files, and in the MFC source.
No
> matches. I understand that the problem might not be MFC related, but the
error
> suggests that it is interacting with MFC in some way (a 'document' was
> mentioned, no?), and I'd love to learn how this can happen, and how to trace
it.
>
> Thanks,
> Rob
>
Sajith Kumar -- sajith@wallop.com
Wednesday, August 14, 1996
[Mini-digest: 2 responses]
The CreateProcess some times failes (especially in NT) if you didn't
initialize the STARTUPINFO prameter properly. To Initialize it you can
call GetStartupInfo. If you already tried please try.
Sajith Kumar
sajith@wallop.com
1155 Triton Drive, Suite E
Foster City, CA 94404
(415) 341 1177x227
>----------
>From: rick cameron[SMTP:rick_cameron@msn.com]
>Sent: Monday, August 12, 1996 9:21 AM
>To: mfc-l@netcom.com
>Subject: RE: failed to create empty document
>
>Hi, Rob
>
>The message string comes from a string resource, with the ID
>AFX_IDP_FAILED_TO_CREATE. It's displayed in several places in the MFC
>source.
>Try putting a breakpoint on each one. When you know which function is
>displaying the message, you may be able to determine what's going
>wrong.
>
>- rick
>
>owner-mfc-l@netcom.com on behalf of rwagner wrote:
>> Environment: VC++ 4.1 / Win 95, MFC AppWizard, ClassWizard. Have MSDN
>>level
>1.
>>
>> I'm getting a runtime error, 'failed to create empty document'
>> when I try to run the release version of an app based on the above. The
>debug
>> version works but the function CreateProcess() always returns 0 (won't
>>work
>> properly), and I see a few 'First-Chance Exceptions' in the trace
>>window of
>the
>> IDE.
>>
>> After commenting out any references to CreateProcess(), the problem
>remained.
>>
>> I've searched for the error both in the help files, and in the MFC
>>source.
>No
>> matches. I understand that the problem might not be MFC related, but the
>error
>> suggests that it is interacting with MFC in some way (a 'document' was
>> mentioned, no?), and I'd love to learn how this can happen, and how to
>>trace
>it.
>>
>> Thanks,
>> Rob
>>
>
>
-----From: Sajith Kumar
The CreateProcess some times failes (especially in NT) if you didn't
initialize the STARTUPINFO prameter properly. To Initialize it you can
call GetStartupInfo. If you already tried please try.
Sajith Kumar
sajith@wallop.com
1155 Triton Drive, Suite E
Foster City, CA 94404
(415) 341 1177x227
Serge Potteck -- serge@lune.cst.cnes.fr
Monday, August 19, 1996
Environment : VC++ 1.51,Win 3.1
There is a vicious reason why it is impossible
to create an empty document :
when there is only one element in the MAINFRAME Menu !
It took me 2 weeks to find it out, after having built
three convergent projects, from Scribble sample, from nothing,
and from my own application.
Serge Potteck
Gareth Glendinning -- garp@callscan.com
Wednesday, August 21, 1996
Environment: VC++ 4.0, NT 3.51
It looks like this messagebox is generated following just about any
failure to create the document or any windows associated with it, such
as those created in the ProcessShellCommand() function (with FileNew,
say).
In my case, I'd imported a dialog from a dialog-based app and tried to
use it as the basis for my CFormView class. Got the above message, and
two-and-a-half days later, I fixed it. Turned out the old dialog-based
app had had a menu associated with it at some point, and despite the
Resource Editor greying it out, it continued to cause the problem until
I manually removed the MENU statement from the .RC file.
Be a bit more helpful in future, Microsoft!
Gareth Glendinning [Garp]
"32-bit Systems Engineer"
| Вернуться в корень Архива
|