libwine problem when calling GetModuleHandle(null) from C# on linux

Steinar Herland steinar.herland at gecko.no
Thu Jul 18 03:09:43 CDT 2002


I sent this post to comp.emulators.ms-windows.wine, but I'm hoping it's appropriate to send it to this list as well. My humble apologies if not.


I have this very simple C# program compiled on linux using the lates mono
(http://www.go-mono.com):
-------
using System;
using System.Runtime.InteropServices;
class Win32Methods{
   [DllImport("kernel32.dll")]
   public extern static IntPtr GetModuleHandleW(string lpModuleName); } class Class1 {
   [STAThread]
   static void Main(string[] args) {
      Console.WriteLine("GetModuleHandle(null): {0}", Win32Methods.GetModuleHandleW(null));
   }
}

------

When I run this on Windows (.NET) it prints out the module-handle. If I run it on linux using mono, I get:
------
err:heap:HEAP_GetPtr Invalid heap 00000000!
GetModuleHandle(null): 0
------

I have seen some old post suggesting that this error is due to opengl-build-problems, but i'm able to run notepad (the wine-version), which I assume call kernel32.GetModuleHandle as well.

WineVersions tested: 
- wine-cvs-unstripped-071702-1.i386.rpm downloaded from http://wine.dataparty.no today
- libwine version included on Mandrake 8.2. (Download Edition)

I hope someone can help me with this, as I'm trying to use Wine to port the basics of the (Microsoft) System.Windows.Forms namespace in .NET to linux.

Best Regards
Steinar Herland





More information about the wine-devel mailing list