I don't have a Windows Mobile device in front of me, but are you sure
that the DLL name is ZLIBCE.DLL? I think maybe ZLIB.DLL is more likely,
as that's what its name is in generic WindowsCE.
Paul T.
My code where i use method from zlibce.dll:
Error: "Can't find PInvoke DLL 'zlibce.dll'"
...
private static int Uncompress(byte[] dest, ref int destLen, byte[] src,
int
srcLen)
{
if (Environment.OSVersion.Platform == PlatformID.WinCE)
return uncompressCE(dest, ref destLen, src, srcLen);
else
return uncompress(dest, ref destLen, src, srcLen);
}
#region zlib.dll
[DllImport("zlib1.dll")]
private static extern int compress(byte[] dest, ref int destLen, byte[]
src,
int srcLen);
[DllImport("zlib1.dll")]
private static extern int uncompress(byte[] dest, ref int destLen,
byte[]
src, int srcLen);
[DllImport("zlibce.dll", EntryPoint = "compress")]
private static extern int compressCE(byte[] dest, ref int destLen,
byte[]
src, int srcLen);
[DllImport("zlibce.dll", EntryPoint = "uncompress")]
private static extern int uncompressCE(byte[] dest, ref int destLen,
byte[]
src, int srcLen);
#endregion
...
I am getting same error when using another dll (my own) - the usage is
quite
similat except that there is no platform switch (only for CE).
I did not tried to move dlls to \Windows jet - problem is, that this
error
is very irregular - it happend only once on our testing environment,
but it
happens more often to our customer.
Is there any difference when loading library from app. directory and
from
\Windows directory?
:
Have you tried placing the DLL you want to P/Invoke in the \Windows
folder?
How does your code look like?
--
Regards,
Christian Resma Helle
http://christian-helle.blogspot.com
message
Hi,
i have strange problem using PIvoke.
When i call function from native library i get "Can't find PInvoke
DLL"
error sometimes.
The .dll is located in the same directory as app.
When i restart system, then it works fine.
It seems to like that os can't see or access library file on some
circumstances...
have anyone expirienced such behaviour?