15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


OpenDocumentFile causes app to crash under Win95

Svetlana Guljajeva -- svetlana@assert.ee
Wednesday, March 05, 1997

Environment : Win95,WinNT4.0,VC++ 4.2-flat

Hello!

I have an application with size of executable more than 21 MB.
I am testing it on the PC with 32MB memory under Win95.It's an MDi 
application and in one window when user presses the button,application 
crashes.It happens only under Win95.I tried this program under WinNT40 
also ( with 48MB memory PC) - everything is fine.

The problem is that I can't debug it accurately,coz I can't load MSDEV 
and my program into memory at the same time.I found out that my app 
crashes in the CMultiDocTemplate::OpenDocumentFile(NULL) function call.
Here is the part of my code:

...
POSITION posDoc = pDocTemplate->GetFirstDocPositon();
if(posDoc)//if document exists
{
...
}
else//Document does not exist : create it
{
CDocument * p = pDocTemplate->OpenDocumentFile(NULL);//this is the last 
                                  //place where program is still "alive"
}
...

pDocTemplate is valid pointer.
My questions are:

1) Is there any difference in OpenDocumentFile function between
Windows95 and WindowsNT4.0?
2)Is it possible that the lack of memory is the reason of this scrash?

Any other ideas are greatly appreciated.
Thanks in advance,
	Svetlana

svetlana@assert.ee



Svetlana Guljajeva -- svetlana@assert.ee
Thursday, March 06, 1997

[Mini-digest: 2 responses]

Environment : Win95,WinNT4.0,VC++ 4.2-flat

Hello!

Thank you all for your help,I found where the problem was.

In the window that is to be opened with that button there are property
sheet with four property pages.Three of them use DIALOG resource ,but one -
DIALOGEX resource.
Win95 DOES NOT SUPPORT DIALOGEX resource for property pages.

Svetlana
-----------------------------------------------------------------
Svetlana Guljajeva / Assert Ltd. / Tallinn
Email : svetlana@assert.ee
Web page : http://galaxy.assert.ee
-----------------------------------------------------------------


> I have an application with size of executable more than 21 MB.
> I am testing it on the PC with 32MB memory under Win95.It's an MDi 
> application and in one window when user presses the button,application 
> crashes.It happens only under Win95.I tried this program under WinNT40 
> also ( with 48MB memory PC) - everything is fine.

-----From: Mike Blaszczak 

At 17:15 3/5/97 +0200, you wrote:
>Environment : Win95,WinNT4.0,VC++ 4.2-flat

MFC 4.2-flat can't be reliably used against shipping versions of
various operating system components. MFC 4.2-flat works great
against beta versions of those components, but those components
themselves are not supported.  You should upgrade to MFC 4.2b
by installing the patch available at the Microsoft web site.

>I have an application with size of executable more than 21 MB.

Just out of curiosity, why is your program so thunderously large?

>I am testing it on the PC with 32MB memory under Win95.It's an MDi 
>application and in one window when user presses the button,application 
>crashes.

What does "crashes" mean?  Does it mean that you get an assert?  If
so, what line number and file name are identified in the assertion? 
Does it mean that you get an unhandled exception error?  If so, which
exception?  In either case, what is the stack trace?

By "crashes", do you actually mean "becomes unresponsive"?  If so,
when you use the "Break" command in the debugger, what does the stack
trace tell you?

>The problem is that I can't debug it accurately,coz I can't load MSDEV 
>and my program into memory at the same time.

It seems like you should be able to: have you correctly configured the
virtual memory settings on your debugging machine?  You could still
answer the above questions by using remote debugging, or by using
WNDBG from the SDK.

>CDocument * p = pDocTemplate->OpenDocumentFile(NULL);//this is the last 
>                                  //place where program is still "alive"

What, exactly, does "still alive" mean?  At what point inside the
OpenDocumentFile() call does the application become no longer "still
alive"?

>1) Is there any difference in OpenDocumentFile function between
>Windows95 and WindowsNT4.0?

There are a couple of different implementations of OpenDocumentFile(),
and we don't know which one you're using.  The function is
implemented differently in CSingleDocTemplate and CMultiDocTemplate.
The code executed by either implementation of this function shouldn't
do anything that's operating-system dependent, though.

Of course, your operating system configuration is probably wildly
different between your Win95 and WinNT installation--you've not shared
any details about that, so maybe the matter is just that you've got
one operating system cofnigured to offer you lots more virtual memory
than the other operating system.

>2)Is it possible that the lack of memory is the reason of this scrash?

It depends on exactly what you mean by "crash". Generally, low-resource
conditions don't cause plain assertions, but may cause unhandled
exceptions.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
           This performance was not lip-synched.





Become an MFC-L member | Вернуться в корень Архива |