一个利用 Visual Studio 构建的 msflexgrid 的 Windows Winforms 应用程序在 Windows 上正确运行。当使用 wine 在 ubuntu 上运行相同的应用程序时,会出现一系列错误,并且 exe 无法按预期工作。Dotnet 框架已安装使用 winetricks 并使用 wine regsvr32“ocx 文件的路径”命令注册 msflxgrd.ocx。其他不使用 msflexgrid 的 exe 文件按预期运行。有人可以指导有效运行包含 msflexgrid 的 .exe 文件吗?
简单的Vb代码:
Imports System
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Imports AxMSFlexGridLib
Public Class Form1
Inherits Form
Private versionLabel As New Label()
Private textBox1 As New TextBox()
Public Sub New()
Me.Text = "FlexGrid Example"
Me.Size = New Size(500, 400)
AxMSFlexGrid1 = New AxMSFlexGrid()
AxMSFlexGrid1.Size = New Size(300, 200)
AxMSFlexGrid1.Location = New Point(50, 150)
Me.Controls.Add(AxMSFlexGrid1)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AxMSFlexGrid1.Rows = 3
AxMSFlexGrid1.Cols = 3
' Populate the MSFlexGrid with data
AxMSFlexGrid1.set_TextMatrix(0, 0, "Name")
AxMSFlexGrid1.set_TextMatrix(0, 1, "usn")
AxMSFlexGrid1.set_TextMatrix(0, 2, "college")
AxMSFlexGrid1.set_TextMatrix(1, 0, "John")
AxMSFlexGrid1.set_TextMatrix(1, 1, "123")
AxMSFlexGrid1.set_TextMatrix(1, 2, "XYZ")
AxMSFlexGrid1.set_TextMatrix(2, 0, "Adam")
AxMSFlexGrid1.set_TextMatrix(2, 1, "456")
AxMSFlexGrid1.set_TextMatrix(2, 2, "PQR")
End Sub
Private Sub AxMSFlexGrid1_Enter(sender As Object, e As EventArgs) Handles AxMSFlexGrid1.Enter
End Sub
End Class
执行文件时出现的错误:
0024:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.6.1" not implemented
0024:fixme:mscoree:parse_supported_runtime sku=L".NETFramework,Version=v4.6.1" not implemented
0024:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
0024:fixme:file:parse_samba_dos_attrib_data Unhandled user.DOSATTRIB extended attribute value.
Generated GUIDs only implemented for interfaces!
Could not load signature of MSFlexGridLib.IMSFlexGrid:get_Font due to: Could not
load file or assembly 'stdole, Version=7.0.3300.0, Culture=neutral, PublicKeyTo
ken=b03f5f7f11d50a3a' or one of its dependencies.
===========================================================
Native Crash Reporting
=================================================================
Got a UNKNOWN while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
=================================================================
Managed Stacktrace:
=================================================================
at <unknown> <0xffffffff>
at System.Object:__icall_wrapper_mono_upgrade_remote_class_wrapper <0x
00012>
at System.Object:__proxy_isinst_wrapper_MSFlexGridLib.IMSFlexGrid <0x0
0093>
at AxMSFlexGridLib.AxMSFlexGrid:AttachInterfaces <0x0006f>
at System.Windows.Forms.AxHost:GetOcxCreate <0x0004e>
at System.Windows.Forms.AxHost:TransitionUpTo <0x00137>
at System.Windows.Forms.AxHost:CreateHandle <0x00047>
at System.Windows.Forms.Control:CreateControl <0x000b7>
at System.Windows.Forms.Control:CreateControl <0x00073>
at System.Windows.Forms.Control:CreateControl <0x001d3>
at System.Windows.Forms.Control:CreateControl <0x00073>
at System.Windows.Forms.AxHost:EndInit <0x0005b>
at WindowsApp37.Form1:InitializeComponent <0x002ca>
at WindowsApp37.Form1:.ctor <0x0009b>
at System.Object:runtime_invoke_void__this__ <0x0006a>
at <unknown> <0xffffffff>
at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x00012>
at System.Reflection.RuntimeConstructorInfo:InternalInvoke <0x0004b>
at System.RuntimeType:CreateInstanceMono <0x00143>
at System.RuntimeType:CreateInstanceSlow <0x0004f>
at System.RuntimeType:CreateInstanceDefaultCtor <0x0005b>
at System.Activator:CreateInstance <0x0009b>
at MyForms:Create__Instance__ <0x00177>
at MyForms:get_Form1 <0x0002b>
at WindowsApp37.My.MyApplication:OnCreateMainForm <0x0002b>
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBa
se:OnRun <0x00045>
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBa
se:DoApplicationModel <0x000da>
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBa
se:Run <0x000b3>
at WindowsApp37.My.MyApplication:Main <0x00083>
at <Module>:runtime_invoke_void_object <0x0006c>
Unhandled exception: page fault on read access to 0x00000008 in 32-bit code (0x1000ea11).
Register dump:
CS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b
EIP:1000ea11 ESP:0050ede4 EBP:0050eea4 EFLAGS:00010206( R- -- I - -P- )
EAX:00000000 EBX:04ae2e84 ECX:0050ed94 EDX:00000000
ESI:04a88748 EDI:0050eea4
Stack dump:
0x0050ede4: 049e4350 04ae2f44 101c2b50 01019470
0x0050edf4: 04a88748 00000002 0050eea4 04ae2e58
0x0050ee04: 04a838e8 04a838e8 010851f8 01019470
0x0050ee14: 04ae31c8 04ae2e08 00000007 04ae2e0c
0x0050ee24: 000002c4 04ae9340 04a87e64 01019470
0x0050ee34: 01019470 00000002 04ae2de8 0050eea4
Backtrace:
=>0 0x1000ea11 in libmono-2.0-x86 (+0xea11) (0x0050eea4)
0x1000ea11 libmono-2.0-x86+0xea11: cmpw $0,0x8(%eax)
Modules:
Module Address Debug info Name (89 modules)
PE 00370000-0038b000 Deferred version
PE 00390000-003d6000 Deferred shcore
PE 00400000-0040a000 Deferred windowsapp37
PE 00810000-00a23000 Deferred rpcrt4
PE 015d0000-01654000 Deferred winex11
PE 01dc0000-01f84000 Deferred wininet
PE 01f90000-01ff2000 Deferred msacm32
PE 035c0000-03a3c000 Deferred mscorlib
PE 03df0000-03e40000 Deferred microsoft.visualbasic
PE 03e40000-045da000 Deferred system.windows.forms
PE 045e0000-048a4000 Deferred system
PE 048b0000-04930000 Deferred system.drawing
PE 04930000-04956000 Deferred system.configuration
PE 049a0000-049a8000 Deferred accessibility
PE 08bd0000-08ce0000 Deferred system.core
PE 08ce0000-08cf0000 Deferred axinterop.msflexgridlib
PE 08cf0000-08d04000 Deferred interop.msflexgridlib
PE 10000000-103ee000 Export libmono-2.0-x86
PE 20da0000-20ddd000 Deferred msflxgrd
PE 62240000-6231e000 Deferred mscoree
PE 62500000-6290a000 Deferred oleaut32
PE 631c0000-63207000 Deferred fusion
PE 643c0000-64449000 Deferred ws2_32
PE 64a80000-64ad8000 Deferred win32u
PE 65680000-658fc000 Deferred msvcrt
PE 66080000-66179000 Deferred shlwapi
PE 66380000-667f8000 Deferred ole32
PE 67500000-67553000 Deferred imm32
PE 67bc0000-68043000 Deferred comctl32
PE 684c0000-6860d000 Deferred combase
PE 68880000-68d6a000 Deferred user32
PE 69000000-69266000 Deferred gdiplus
PE 69840000-6993b000 Deferred advapi32
PE 6aac0000-6ad9c000 Deferred ucrtbase
PE 6bbc0000-6bc57000 Deferred sechost
PE 6c1c0000-6cb92000 Deferred msxml3
PE 6da80000-6dc9f000 Deferred gdi32
PE 6e200000-6e246000 Deferred bcrypt
PE 6f240000-6f3bc000 Deferred winmm
PE 70000000-70254000 Deferred dbghelp
PE 70380000-70609000 Deferred urlmon
PE 70d80000-70e20000 Deferred uxtheme
PE 712c0000-71314000 Deferred mpr
PE 71400000-720af000 Deferred shell32
PE 7b000000-7b52c000 Deferred kernelbase
PE 7b600000-7b759000 Deferred kernel32
PE 7bc00000-7bebc000 Deferred ntdll
ELF 7d000000-7d005000 Deferred <wine-loader>
ELF 7e537000-7e567000 Deferred libexpat.so.1
ELF 7e567000-7e5b7000 Deferred libfontconfig.so.1
ELF 7e5b7000-7e5da000 Deferred libbrotlicommon.so.1
ELF 7e5da000-7e5e8000 Deferred libbrotlidec.so.1
ELF 7e5e8000-7e6b5000 Deferred libfreetype.so.6
ELF 7e6b5000-7e7bd000 Deferred libm.so.6
ELF 7e7bd000-7e930000 Deferred win32u.so
ELF 7ee07000-7ee25000 Deferred libz.so.1
ELF 7ee25000-7ee65000 Deferred libpng16.so.16
ELF 7ee77000-7f000000 Dwarf libwine.so.1
ELF f721f000-f72ae000 Deferred libgmp.so.10
ELF f72ae000-f72f8000 Deferred libhogweed.so.6
ELF f72f8000-f74a3000 Deferred libunistring.so.2
ELF f74a3000-f7600000 Deferred libp11-kit.so.0
ELF f7600000-f782e000 Deferred libgnutls.so.30
ELF f7832000-f783e000 Deferred libffi.so.8
ELF f783e000-f7888000 Deferred libnettle.so.8
ELF f7888000-f789f000 Deferred libtasn1.so.6
ELF f789f000-f78c2000 Deferred libidn2.so.0
ELF f791a000-f7922000 Deferred libxfixes.so.3
ELF f7922000-f792f000 Deferred libxcursor.so.1
ELF f792f000-f7944000 Deferred libxi.so.6
ELF f7944000-f7949000 Deferred libxcomposite.so.1
ELF f7949000-f7958000 Deferred libxrandr.so.2
ELF f7958000-f7966000 Deferred libxrender.so.1
ELF f7966000-f796e000 Deferred libxxf86vm.so.1
ELF f796e000-f7973000 Deferred libxinerama.so.1
ELF f7973000-f7981000 Deferred libmd.so.0
ELF f7981000-f7999000 Deferred libbsd.so.0
ELF f7999000-f79a1000 Deferred libxdmcp.so.6
ELF f79a1000-f79a7000 Deferred libxau.so.6
ELF f79a7000-f79d5000 Deferred libxcb.so.1
ELF f79d5000-f7b27000 Deferred libx11.so.6
ELF f7b27000-f7b3e000 Deferred libxext.so.6
ELF f7b3e000-f7b4a000 Deferred bcrypt.so
ELF f7b4a000-f7b50000 Deferred ws2_32.so
ELF f7b50000-f7c00000 Deferred ntdll.so
ELF f7c00000-f7e35000 Deferred libc.so.6
ELF f7e36000-f7e40000 Deferred libuuid.so.1
ELF f7e44000-f7ed0000 Deferred winex11.so
ELF f7ed8000-f7f10000 Deferred ld-linux.so.2
Threads:
process tid prio name (all IDs are in hex)
00000020 (D) Z:\home\abc\abcd\Debug\WindowsApp37.exe
00000024 0 <==
0000010c 0 SGen worker
00000110 0 Finalizer
0000011c 0
00000038 services.exe
0000003c 0
00000040 0 wine_rpcrt4_server
0000004c 0 wine_rpcrt4_io
00000070 0 wine_rpcrt4_io
00000090 0 wine_rpcrt4_io
000000b8 0 wine_rpcrt4_io
000000e4 0 wine_rpcrt4_io
00000044 winedevice.exe
00000048 0
00000054 0
00000058 0 wine_sechost_service
0000005c 0
00000060 0
00000064 0
000000c4 0
00000068 winedevice.exe
0000006c 0
00000074 0
00000078 0 wine_sechost_service
0000007c 0
00000080 0
00000084 0
00000098 0
000000ac 0
00000088 plugplay.exe
0000008c 0
00000094 0
0000009c 0 wine_sechost_service
000000a0 0 wine_rpcrt4_server
000000b0 0 wine_rpcrt4_io
000000a4 svchost.exe
000000a8 0
000000bc 0
000000c0 0 wine_sechost_service
000000c8 explorer.exe
000000cc 0
000000d0 0
000000d4 0 wine_rpcrt4_server
000000dc rpcss.exe
000000e0 0
000000ec 0
000000f0 0 wine_sechost_service
000000f4 0 wine_rpcrt4_server
000000f8 0 wine_rpcrt4_server
000000fc 0 wine_rpcrt4_io
00000104 conhost.exe
00000108 0
System information:
Wine build: wine-8.0.2
Platform: i386 (WOW64)
Version: Windows 7
Host system: Linux
Host version: 6.2.0-26-generic