Using Precompiled .NET Assembly DLL in Mono?

前端 未结 5 1312
再見小時候
再見小時候 2020-12-30 05:30

We\'re currently testing Mono to see if our .NET DLLs will work for customers on Linux. Our DLLs provide components for Windows Forms. I placed the DLLs in the Debug direc

5条回答
  •  梦谈多话
    2020-12-30 06:16

    uxtheme.dll is the Windows theme engine, if I'm not mistaken. It's quite natural you don't have that in a non-Windows environment, so P/Invoking its exported functions is not directly possible.

    You have two options here:

    1. Open up that OnHandleCreated method and replace the SetWindowTheme call with something portable or
    2. Create a dummy libuxtheme.so that contains just this one function so mono can P/Invoke it.

    I recommend the first approach if possible, as you'd need to create that dummy libuxtheme.so for every platform you're supporting. I.e., you'd have to make a libuxtheme.so for x86 Linux, a libuxtheme.so for x86_64 Linux, the same for FreeBSD, a libuxtheme.dylib for Mac OS X and so on.

    If OnHandleCreated was generated by some UI designer or the like, you probably have to remove some widget themes the get rid of the call.

提交回复
热议问题