[Mono-devel-list] Can I use Microsoft's DLL's on the Win32 platform?

Pete Gonzalez pgonzalez at bluel.com
Tue Apr 26 06:14:53 EDT 2005


Miguel de Icaza wrote:
> My list was not exhaustive, you should also look for P/Invoke and IJW
> stubs.
> 
> But even if you did not look into that, Windows.Forms exposes and
> consumes COM extensively so it will not work on Mono (in our
> implementation we just throw).

Hmm... I didn't see COM interop listed anywhere on your roadmap page.  Is 
this a priority?  It seems that the ability to execute Microsoft DLL's 
would be a prerequisite for running Visual Studio projects, and in 
particular the huge number of third party Win32-only assemblies require for 
a desktop application.  (Interoperability is everything, and I would argue 
that Java's failure on the desktop is largely due to Sun's obssession with 
"platform independence", to the point of discouraging usage of native 
API's, even when they are vastly superior to the JDK stuff.)

For what it's worth, I was able to reconfigure Mono.exe to load Microsoft's 
DLL's (except for mscorlib.dll).  The first problem I encountered was 
missing implementations for Marshal.ReadByte() and Marshal.ReadInt16().  I 
hacked these as calls to mscoree.dll (which seems to work!), and now the 
application runs until the CreateWindowEx() call, at which point it crashes 
with a basic Win32 API error.  With some more hacking, I could probably get 
further to some other error.

Anyway, my point is that Mono can successfully execute quite a lot of 
Microsoft code before crashing.  :-)

Cheers,
-Pete


____

. . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper 
managed-to-native) Microsoft.Win32.UnsafeNativeMethods:CreateWindowEx 
(int,string,string,int,int,int,int,int,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef,object)(0, 
[STRING:01822C80:.NET-BroadcastEventWindow.1.0.5000.0.84f73c00], 
[STRING:01822C80:.NET-BroadcastEventWindow.1.0.5000.0.84f73c00], 
-2147483648, 0, 0, 0, 0, [00,00,00,00,00,00,00,00,], 
[00,00,00,00,00,00,00,00,], [70,ee,82,01,00,00,40,00,], 00000000, )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper 
managed-to-native) 
System.Object:__icall_wrapper_mono_marshal_string_to_utf16 
(object)([STRING:01822C80:.NET-BroadcastEventWindow.1.0.5000.0.84f73c00], )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper 
managed-to-native) 
System.Object:__icall_wrapper_mono_marshal_string_to_utf16 
(object)result=25308300
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper 
managed-to-native) 
System.Object:__icall_wrapper_mono_marshal_string_to_utf16 
(object)([STRING:01822C80:.NET-BroadcastEventWindow.1.0.5000.0.84f73c00], )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper 
managed-to-native) 
System.Object:__icall_wrapper_mono_marshal_string_to_utf16 
(object)result=25308300
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_marshal_asany 
(object,int)(00000000, 21, )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_marshal_asany 
(object,int)result=0
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_struct_delete_old 
(intptr,intptr)(0164E0E8, 0224FE04, )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_struct_delete_old 
(intptr,intptr)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_struct_delete_old 
(intptr,intptr)(0164E0E8, 0224FE00, )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_struct_delete_old 
(intptr,intptr)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_struct_delete_old 
(intptr,intptr)(0164E0E8, 0224FDFC, )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_struct_delete_old 
(intptr,intptr)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . ENTER: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_marshal_free_asany 
(object,intptr,int)(00000000, 00000000, 21, )
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper 
managed-to-native) System.Object:__icall_wrapper_mono_marshal_free_asany 
(object,intptr,int)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . LEAVE: (wrapper 
managed-to-native) Microsoft.Win32.UnsafeNativeMethods:CreateWindowEx 
(int,string,string,int,int,int,int,int,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef,System.Runtime.InteropServices.HandleRef,object)result=0



More information about the Mono-devel-list mailing list