[Mono-winforms-list] Porting application that calls windows andother DLLs
Matthew Donaldson
matthew at datadeliverance.com
Thu Dec 18 17:20:22 EST 2008
Thanks, that's encouraging news. But you definitely have to compile the DLLs for Linux don't you - I'm right in assuming that pinvoke on Mono won't call into native Windows DLLs?
+--------------------------------------------------------------------------+
| Matthew Donaldson http://www.datadeliverance.com |
| Data Deliverance Pty. Ltd. Email: matthew at datadeliverance.com |
| 30 Musgrave Ave. Phone: +61 8 8265 7976 _ |
| Banksia Park Fax: +61 8 8265 0032 John / \/ |
| South Australia 5091 3:16 \_/\ |
+--------------------------------------------------------------------------+
On Fri 19/12/08 1:07 AM , "Maser, Dan" Dan.Maser at inin.com sent:
> In my mono application I have PInvokes that run on both Windows and Linux
> and in my experience it works and you don't even have to change the source
> code from ".dll" to ".so". If you put the module name
> only in the source code then the right thing happens. The MS.NET knowns to
> append ".dll" when looking for the file and Mono knows to try
> both ".dll" and ".so" when running on Linux.
> Additionally, I think there's something about an xml file you can put in
> the same directory as your assembly that acts as a mapping where you can
> tell mono "when looking for foo.dll you should try bar.so" that
> you can use if you don't want the Windows and Linux libraries to have the
> same name.
> Of course you have to pay close attention to using the correct decorations
> for calling conventions on both libraries.
>
> -----Original Message-----
> From: mono-winforms-list-bounces at lists.ximian.com [mono-winforms-list-bounces at lists.ximian.com] On Behalf
> Of mcgdSent: Thursday, December 18, 2008 5:42 AM
> To: mono-winforms-list at lists.ximian.comSubject: [Mono-winforms-list] Porting application that calls windows and
> other DLLs
>
> Hi,
>
> I've been asked to try and get a .NET 1.1 application working under Mono.
> It makes quite a few Windows API calls, but also calls several other
> DLLsusing PInvoke. Most of these DLLs can probably be recompiled under
> Linux,but probably not all.
>
> >From looking around, it seems that it's not
> possible to call Windows DLLsvia PInvoke using Mono, but I wanted to make sure this is the case.
> Someonementioned something called "ctypes" as a way of doing this, but
> this seemsto be a Python thing.
>
> I'd appreciate input on what my options might be available here, and
> whetherit's worth trying to go further. A few other specific questions -
> answersor URLs appreciated:
>
> - Is there any way at all to get the equivalent of calls into User32.dll?
> Most of these are in User32.dll. The application is very
> GUI-intensive.
> - Is it possible to use Wine to run the DLLs? I've seen references to
> thisidea, but I don't think I've found anything concrete.
>
> - If the other DLLs could be recompiled into .so files under Linux, can
> Iuse PInvoke without changing anything except ".dll" into
> ".so", or doparameter names and types need to be changed too? (i.e. would this
> possiblybe a significant porting effort in its own right?)
> --
> View this message in context: http://www.nabble.com/Porting-application-that-calls-windows-an
> d-other-DLLs-tp21071161p21071161.htmlSent from the Mono - WinForms mailing list archive at Nabble.com.
>
> _______________________________________________
> Mono-winforms-list maillist - Mono-winforms-list at lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/mono-winforms-list
>
>
>
>
---- Message sent via Adam Internet WebMail - http://www.adam.com.au/
More information about the Mono-winforms-list
mailing list