
Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
On Feb 24, 8:07 am, Mattias Sjögren <mattias.dont.want.s...@mvps.org>
wrote:
> >I'm trying to DllImport the SendMessage and SetWindowTheme APIs, but
> >maintain backward compatibility with Win2k and stay cross-platform
[quoted text clipped - 10 lines]
>
> Mattias
That doesn't help.
I need to support Win2K, but use SetWindowTheme when available.
I also need to support Mono, but use SendMessage when it is available.
Preferably without resorting to compiling different versions of the
assembly.
The problem with using DllImport is that it causes the assembly to
fail loading if it can't find the .dll or export.
Mattias Sjögren - 25 Feb 2007 09:24 GMT
>The problem with using DllImport is that it causes the assembly to
>fail loading if it can't find the .dll or export.
That's not what I'm seeing. DllImports are resolved the first time
they are called. If you never call a function, it doesn't matter if it
exists or not. At least that's the behavior of the CLR, I don't know
if Mono behaves in a different way.
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.