Mono-resources for cross-platform development

Is there a website or repository of cross-platform development information in mono? Obviously, I know about Moma , and Cross Platform Guidlines and I use Visual Studio Tools to run and debug applications in a virtual machine, however, since I am migrating an old application, I have dozens (if not hundreds) of PInvokes for migration. Of course, everyone who does this should have encountered these problems before, and they have solutions or suggestions for solutions. Instead of a hundred and a hundred β€œWhat is the Mono-equivalent of user32.dll GetKeyState ()” in stackoverflow (or maybe this is a solution), is there a repository (wiki, for example, Pinvoke.net), or is it hidden in mono forums from their search and google search ?

To answer the comment below, I'm looking for ways to use Cross Platform APIs. Obviously, the best solution is to have a controlled way to do everything, but some reference to how to do it on Windows, Linux, and Mac will also be incredibly useful. Due to the lack of an answer, I assume that such a link site does not exist, and perhaps it should be running. Even if a wiki was launched in the monoproject, which began with the principles of application compatibility, I’m sure that over time it will grow and will be very useful for the community.

+4
source share
2 answers

I have had about the same issue lately. I will tell you a success story.

My application uses third-party components. Some of them use PInvokes. At the first launch of MOMA, there were about 20 seats. I replaced one component with a similar crossplan (without PInvokes) - 10 places left. About 5 places I had to code myself (found some workarounds easily) - 5 places remained. These 5 places were never really called.

I guess many of our PInvokes are never called.

+1
source

Portability and use of APIs are mutually exclusive. The use of platform-specific APIs when creating some software means that it will not work on any other platform, and there is no guarantee that other systems even have a similar API. If you have code that uses the API heavily, you probably have no choice but to override (part of) the program if you want to port it to another platform. This is NOT something that could be solved using the "Find + replace one API function with another" function (although this may be applicable in some cases), so the existence of a dictionary for translation between them is unlikely, and will still be incomplete. You must rewrite the code! Read manpages, google, etc., and then if you have specific problems you can ask about them. Instead of spamming this site with a question for every thing ...!

To avoid this entire API problem, rather than using the API directly when writing code, you can use a portable library designed for the required functionality (Google should help you) that will make API calls for you, and the accompanying libraries should worry about all the problems. platform-related so you don’t need to! A good example of this (for C ++) is the SDL, which processes video, audio, and controllers. Please note that it contains a portable version of GetKeyState ! The .NET / Mono library itself hides many API calls from you.

It is probably recommended that you use a library with a similar interface for the Windows API when porting your program (if it exists), and not translate everything into the Linux API (thus transferring the software), but I think the best plan is to see what they are used for APIs, and then learn how to do this in a portable way, rather than trying to translate each function individually. Keep in mind that functions can be interdependent and can be grouped around a set of tasks when looking for solutions.

0
source

All Articles