JimH44 JimH44 - 1 year ago 91
C# Question

How to use NativeMethods.GetUpdateRect on Mono on Lubuntu 16.04.1?

I'm trying to port a great Windows Forms program to Linux and get this error:

System.EntryPointNotFoundException: GetUpdateRect
at (wrapper managed-to-native)
at CDBurnerXP.Controls.NativeMethods.GetUpdateRect
(System.Windows.Forms.Control cntl) [0x0000f] in

Is there a way to support C# calls to

NativeMethods:GetUpdateRect noon Mono on Lubuntu 16.04.1?


Thanks, knocte, for your comment. This edit is to quote the bit of code that tries to reference this function (because comments don't allow any formatting):

[DllImport("user32.dll", EntryPoint = "GetUpdateRect", CharSet = CharSet.Auto)]
private static extern IntPtr GetUpdateRectInternal(IntPtr hWnd, ref Rectangle r, bool eraseBackground);

Answer Source

Well, the answer is that I was asking the wrong question.
I should have been asking "How can I replace ObjectListView.cs, which depends on non-portable Windows system calls, to port this program to Mono on Linux?"

ObjectListView seems to work very well on Windows, but is not compatible with Linux or Mac systems. There's a very good discussion in the ObjectListView discussion board. The comment by Steve Hiner (2015-11-29) changed the direction of my search. Steve's approach is "I already created a proxy that uses OLV on Windows and the stock listview on Linux and Mac. That would be one way OLV could provide pseudo mono support, it could just use the stock listview without any fancy features."

Thanks, knocte, for getting me thinking in the right direction.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download