我的应用程序中有一个随机罕见的AV,遗憾的是我无法重现。
exception message : Access violation at address 76FFD968 in module 'ntdll.dll'. Write of address 00000014.
main thread ($11a0):
76ffd968 +00099 ntdll.dll
76ffd872 +1b572 ntdll.dll RtlEnterCriticalSection
00470dca +0001e app.exe Graphics TCanvas.Lock
0047116b +0002f app.exe Graphics TCanvas.TryLock
00489cbd +00041 app.exe Controls FreeDeviceContexts
0048ea80 +0003c app.exe Controls TWinControl.MainWndProc
004a241c +00014 app.exe Forms StdWndProc
75a50d48 +00016 user32.dll CallWindowProcW
004ff768 +00048 app.exe TntControls 617 +12 TWinControlTrap.Win32Proc
004a241c +00014 app.exe Forms StdWndProc
76fd0107 +0002b ntdll.dll KiUserCallbackDispatcher
0048d463 +0005f app.exe Controls TWinControl.Destroy
00493049 +0001d app.exe Controls TCustomControl.Destroy
0040332c +00008 app.exe System TObject.Free
004ac369 +00035 app.exe Forms ValidateHintWindow
004ac5b8 +00230 app.exe Forms TApplication.ActivateHint
004ac161 +00029 app.exe Forms TApplication.HintTimerExpired
004a9fb6 +00022 app.exe Forms HintTimerProc
75a47bc5 +0000a user32.dll DispatchMessageA
004ab4fb +00083 app.exe Forms TApplication.ProcessMessage
004ab532 +0000a app.exe Forms TApplication.HandleMessage
004a8137 +00147 app.exe Forms TCustomForm.ShowModal
我正在使用Tnt Unicode控件。从错误日志我可以看出问题的原因是Unicode提示窗口和无效的设备上下文(?)。我要确保在TCustomControl.WMPaint
祖先中正确锁定/解锁提示窗口Canvas。但我仍然认为DC无效,无法弄清楚为什么 - 谁在搞乱DC。
我不是要你调试我的程序。但也许是关于如何处理这个问题的想法。有人有Tnt Unicode控件的这个问题吗?
非常感谢任何帮助。