macropas
macropas

Reputation: 3160

Using P/Invokes in Mono through Wine

Is it possible to use native Win API functions in Mono through Wine? Are there some additional libraries for interactions between Mono and Wine?

Upvotes: 2

Views: 999

Answers (2)

Mikayla Hutchinson
Mikayla Hutchinson

Reputation: 16153

This will only work if you install and use the Windows version of Mono inside the Wine environment. No additional libraries should be needed. However, P/Invoke that affects the Windows Forms GUI likely won't work, because Mono's Windows Forms doesn't actually wrap native controls, but instead is implemented using fully managed code.

There's probably a better way to do what you want, if you could be more specific.

Upvotes: 4

Jon Smock
Jon Smock

Reputation: 9641

Just some helpful tidbits I've found so far:

Looks like Mono does support P/Invoke (half way down you'll see a section on Marshalling).

So, I think it could potentially work, if Wine correctly supports the Win API call you're trying to make. You'll never really be able to call the native Win API function, but if there's a Wine interpretation, theoretically it should work. Just make sure to run your Mono project inside of Wine.

Any reason you're not virtualizing and running Mono on Windows itself?

Upvotes: 2

Related Questions