Đây là một trong những vấn đề thú vị nhất mà tôi đã tìm thấy gần đây. Chúng tôi có một chương trình Delphi 5 kế thừa (tài liệu tham khảo Rave Reports 4 đang ngăn không cho nâng cấp lên D2007).Delphi 5 gây ra EAccessViolation khi tệp kê khai được thêm dưới dạng tài nguyên
Khi chương trình được biên dịch với tài nguyên phiên bản do chúng tôi tạo mẫu, nó hoạt động tốt. Vấn đề nảy sinh khi tài nguyên tệp kê khai được tạo mẫu được thêm vào dpr của chương trình.
Manifest là một "chung chung", tập tin ASCII:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
name="Name"
processorArchitecture="x86"
version="2.0.0.0"
type="win32"/>
<description>Desc</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
</assembly>
Trong App.dpr có một tài liệu tham khảo tài nguyên biểu hiện:
{$R 'manifest.res' 'manifest.rc'}
Manifest được biên dịch bằng cách gọi:
C:\Program Files\Borland\Delphi5\Bin\brcc32.exe manifest.rc
Và khi chương trình bắt đầu sau khi ngoại lệ được nêu ra:
exception class : EAccessViolation
exception message : Access violation at address 75A1A890 in module 'KERNELBASE.dll'. Read of address 00000001.
Gọi ngăn xếp cho chủ đề chính:
main thread ($1144):
75a1a890 +007 KERNELBASE.dll
75a1a97c +069 KERNELBASE.dll WideCharToMultiByte
73f28764 +048 comctl32.dll #342
777741f4 +016 user32.dll CallWindowProcA
00092de2 +0ca app.exe Controls TWinControl.DefaultHandler
0009336c +01c app.exe Controls TWinControl.WMNotify
000c2454 +024 app.exe ComCtrls TCustomListView.WMNotify
00090249 +111 app.exe Controls TControl.WndProc
00092d0a +1d2 app.exe Controls TWinControl.WndProc
000c39ea +072 app.exe ComCtrls TCustomListView.WndProc
0009290c +02c app.exe Controls TWinControl.MainWndProc
000a5880 +014 app.exe Forms StdWndProc
77757690 +044 user32.dll SendMessageW
777741f4 +016 user32.dll CallWindowProcA
000c1e6f +0c7 app.exe ComCtrls TCustomListView.HeaderWndProc
000a5880 +014 app.exe Forms StdWndProc
7763642b +02b ntdll.dll KiUserCallbackDispatcher
77753573 +00a user32.dll DispatchMessageA
000ae8c7 +083 app.exe Forms TApplication.ProcessMessage
000ae8fe +00a app.exe Forms TApplication.HandleMessage
000aeb09 +081 app.exe Forms TApplication.Run
00186ecf +077 app.exe mca initialization
75b61192 +010 kernel32.dll BaseThreadInitThunk
comctl32.dll Liên Kết:
73f00000 comctl32.dll 6.10.7600.16385 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7600.16385_none_421189da2b7fabfc
Từ những gì tôi có thể thấy vấn đề được ràng buộc với một số Delphi 5 không tương thích với các điều khiển comctl32.dll . Tôi cập nhật Delphi VCL để gần đây nhất. Có giải pháp nào khác ngoài việc chuyển sang D2007 không?
Di chuyển sang Delphi 2007 là một ý tưởng hay. Sau đó, bạn chỉ có bốn năm lỗi thời thay vì 12. –
Để tắt phần mềm giá tôi không thể đồng ý nhiều hơn. Tuy nhiên, đây là một "một lần" ứng dụng bespoke cũ "giải khát" và công việc được đền bù cho phù hợp. Delphi 2007 nâng cấp không đau miễn là Rave không tham gia. Delphi 2009 không nhất thiết phải như vậy (tôi đang nói mã hàng tuần đủ điều kiện). – too