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

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


Property Sheet Bug?

Larry Wall -- tech@clearguis.com
Saturday, December 09, 1995

I have been working on an app since version 2.0 of VC++ with Property Sheets. I have had no problems up to this point.

With VC4.0, when DoModal() is called for the property sheet, in the MFC file:
file: DlgProp.cpp
method: DoModal()
Line #: 663
Line = HWND hWnd - (HWND)::PropertySheet(&m_psh);

When this line is implemented for the first showing of my property sheet, in my output debug window, I see:
first chance exception in myprog.exe (COMCTL32.DLL): 0xC000005: Access Violation

On subsequent calls to the property sheet DoModal method, this first chance exception does not result.

The dialog does not crash so I am not sure if this is very serious or not. ( I am running in Debug mode or course)

Any suggestions on what might be happening here?

Larry..




Aaron Kardell -- akardell@usa.net
Sunday, December 10, 1995

> 
> I have been working on an app since version 2.0 of VC++ with Property Sheets. I have had no problems up to this point.
> 
> With VC4.0, when DoModal() is called for the property sheet, in the MFC file:
> file: DlgProp.cpp
> method: DoModal()
> Line #: 663
> Line = HWND hWnd - (HWND)::PropertySheet(&m_psh);
> 
> When this line is implemented for the first showing of my property sheet, in my output debug window, I see:
> first chance exception in myprog.exe (COMCTL32.DLL): 0xC000005: Access Violation
> 
> On subsequent calls to the property sheet DoModal method, this first chance exception does not result.
> 
> The dialog does not crash so I am not sure if this is very serious or not. ( I am running in Debug mode or course)
> 
> Any suggestions on what might be happening here?
> 
Hi Larry,

This error is caused by the OS wanting to write to a read-only resource.  
As long as you don't surround the DoModal() with a try/except statement 
you should be okay (the access violation will be passed on to the OS 
which will safely recover from the error).  Also, you can probably give 
the .rsrc section read/write access.  There's a KB article on this, but I 
don't have it's number right now.

Hope this helps!

Aaron Kardell
akardell@usa.net



Dean McCrory -- deanm@microsoft.com
Monday, December 11, 1995

Message-ID: red-48-msg951211205018MTP[01.51.00]000000f6-28649

This is covered in the VC++4 release notes.  Open 'em up and search for 
"COMCTL32.DLL"

// Dean
----------
| From: Larry Wall  
| To: "'MFCNews - Send'"  
| Subject: Property Sheet Bug?
| Date: Saturday, December 09, 1995 11:36AM
|
| X-Received: from xnet1 by red-48-msg with receive; Sun, 10 Dec 1995 
13:15:45 -0800
| X-Received: from imail1.microsoft.com by xnet1 with recvsmtp;
| Sun, 10 Dec 1995 13:15:43 -0800
| Received: from tide03.microsoft.com (red-03-int.microsoft.com
| [157.61.218.13]) by imail1.microsoft.com (8.7.1/8.7.1) with
| SMTP id NAA11343; Sun, 10 Dec 1995 13:18:09 -0800 (PST)
| Received: by tide03.microsoft.com; id NAA15562; Sun, 10 Dec 1995 
13:20:14 -0800
| Received: from netcom20.netcom.com(192.100.81.133) by
| tide03.microsoft.com via smap (g3.0.3)
| 	id xma015547; Sun, 10 Dec 95 13:19:48 -0800
| Received: by netcom20.netcom.com (8.6.12/Netcom)
| 	id LAA10385; Sun, 10 Dec 1995 11:56:40 -0800
| Message-ID: <01BAC62A.B4E8ED40@cft6.ppp247.cftnet.com>
| MIME-Version: 1.0
| Content-Type: text/plain; charset="us-ascii"



Niels Ull Jacobsen -- nuj@kruger.dk
Monday, January 08, 1996

> 
> I have been working on an app since version 2.0 of VC++ with Property Sheets. I have had no problems up to this point.
> 
> With VC4.0, when DoModal() is called for the property sheet, in the MFC file:
> file: DlgProp.cpp
> method: DoModal()
> Line #: 663
> Line = HWND hWnd - (HWND)::PropertySheet(&m_psh);
> 
> When this line is implemented for the first showing of my property sheet, in my output debug window, I see:
> first chance exception in myprog.exe (COMCTL32.DLL): 0xC000005: Access Violation
> 
> On subsequent calls to the property sheet DoModal method, this first chance exception does not result.
> 
> The dialog does not crash so I am not sure if this is very serious or not. ( I am running in Debug mode or course)
> 
> Any suggestions on what might be happening here?

I'm having the same problem (or something like it). Unfortunately, my
dialog crash, so for me it's pretty serious.

I'm running VC 4.0, patch level I and NT 3.51, patch level III.  It
seems to crash in the default processing of WM_ERASEBKGND,
dereferencing a NULL pointer.  I've added an OnEraseBkgrnd handler to
my sheet, which just calls the default. 
I get an unhandled exception in COMCTL32.DLL: 0xC0000005: Access Violation.
The call stack is

PropSheetDlgProc@16 + 615 bytes
DispatchDlgProc@20 + 33 bytes
__fnGDIHANDLE@4 + 385 bytes
NTDLL! 77f8a301()
NTDLL! 77f8a3af()
CCSMakeCall@4 + 55 bytes
fnDWORD@28 + 99 bytes
fnHDCDWORD@28 + 44 bytes
DefDlgProcA@16 + 47 bytes
CallWindowProcAorW@24 + 45 bytes
CallWindowProcA@20 + 25 bytes
CWnd::DefWindowProcA(unsigned int 20, unsigned int 105, long 0) line 984 + 32 bytes
CWnd::Default() line 242 + 35 bytes
CWnd::OnEraseBkgnd(CDC * 0x0095ec60 {hDC=0x00000069 attrib=0x00000069}) line 354 + 20 bytes
CMySheet::OnEraseBkgnd(CDC * 0x0095ec60 {hDC=0x00000069 attrib=0x00000069}) line 1128 + 12 bytes
CWnd::OnWndMsg(unsigned int 20, unsigned int 105, long 0, long * 0x0005f3a0) line 1745 + 19 bytes
CWnd::WindowProc(unsigned int 20, unsigned int 105, long 0) line 1617 + 30 bytes
AfxCallWndProc(CWnd * 0x0005f7d8 {CMySheet hWnd=0x001002b0}, HWND__ * 0x001002b0, unsigned int 20, unsigned int 105, long 0) line 209 + 26 bytes
....

The instruction which fails is a 
mov eax,dword ptr [esi+54] 
which fails as esi is NULL.

I haven't been able to determine exactly what causes this error, however.

I'm pretty desperate for suggestions...


> 
> Larry..
> 
> 
> 


--
Niels Ull Jacobsen, Kruger A/S

Everything stated herein is THE OFFICIAL POLICY of the entire Kruger
group and should be taken as legally binding in every respect. Pigs
will grow wings and fly.








Mario Contestabile -- Mario_Contestabile.UOS__MTL@UOSMTL2.universal.com
Tuesday, January 09, 1996

>> 
>> I have been working on an app since version 2.0 of VC++ with Property 
Sheets. I have had no problems up to this point.
>> 
>> With VC4.0, when DoModal() is called for the property sheet, in the MFC file:
> >file: DlgProp.cpp
> >method: DoModal()
> >Line #: 663
> >Line = HWND hWnd - (HWND)::PropertySheet(&m_psh);
> 
> >When this line is implemented for the first showing of my property sheet, in 
my output debug window, I see:
> f>irst chance exception in myprog.exe (COMCTL32.DLL): 0xC000005: Access Vio
lation
> 
> >On subsequent calls to the property sheet DoModal method, this first chance 
exception does not result.
> 
> >The dialog does not crash so I am not sure if this is very serious or not. ( 
I am running in Debug mode or course)
> 
> >Any suggestions on what might be happening here?

The first time a property page is created from its corresponding dialog 
resource it
may cause a first-chance exception in COMCTL32.DLL. The exception is handled by 
the system,
ignore it.


>I'm having the same problem (or something like it). Unfortunately, my
>dialog crash, so for me it's pretty serious.

>I'm running VC 4.0, patch level I and NT 3.51, patch level III.  It
>seems to crash in the default processing of WM_ERASEBKGND,
>dereferencing a NULL pointer.  I've added an OnEraseBkgrnd handler to
>my sheet, which just calls the default. 
>I get an unhandled exception in COMCTL32.DLL: 0xC0000005: Access Violation.
>The call stack is

Is it possible the page is receiving the message without it being activated at 
least once?

mcontest@universal.com





| Вернуться в корень Архива |