zlibce.dll

  • Thread starter Eduardo Pavinato Klein
  • Start date
E

Eduardo Pavinato Klein

Does anyone has PInvoked zlib.dll?

I think I have a mistake. For example, is it correct to use:

[DllImport("zlibce.dll")]
public static extern IntPtr gzopen (string path, string mode);

for the evc++ function
gzFile gzopen (const char *path, const char *mode);

Thanks,
Eduardo Pavinato Klein
 
A

Alex Feinman [MVP]

It looks like the library expects char and not wchar (not 100% sure - just
looked briefly in the headers)
To pass a string as char*, define parameters as byte[]
[DllImport("zlibce.dll")]
public static extern IntPtr gzopen (byte[] path, byte[] mode);

and call it like this:
gzopen (Encoding.ASCII.GetBytes(path), Encoding.ASCII.GetBytes(mode));
 
L

Lloyd Dupont

you might want to try #ZipLib ?
http://www.ICSharpCode.net

I had to add the BufferedInputStream code source from mono to make it work
on Pocket.
Otherwise it work straight away, and well. And it's 100% managed.
 
E

Eduardo Pavinato Klein

Thanks Alex.

It's worked like you said.
You are right. The library expects a char *.

Eduardo Klein.

Alex Feinman said:
It looks like the library expects char and not wchar (not 100% sure - just
looked briefly in the headers)
To pass a string as char*, define parameters as byte[]
[DllImport("zlibce.dll")]
public static extern IntPtr gzopen (byte[] path, byte[] mode);

and call it like this:
gzopen (Encoding.ASCII.GetBytes(path), Encoding.ASCII.GetBytes(mode));

Eduardo Pavinato Klein said:
Does anyone has PInvoked zlib.dll?

I think I have a mistake. For example, is it correct to use:

[DllImport("zlibce.dll")]
public static extern IntPtr gzopen (string path, string mode);

for the evc++ function
gzFile gzopen (const char *path, const char *mode);

Thanks,
Eduardo Pavinato Klein
 
E

Eduardo Pavinato Klein

Hi Lloyd.

Thanks for the post.
I´ve already used #ZipLib, but ZLIB has a better performance on the Pocket.

Eduardo Klein


Lloyd Dupont said:
you might want to try #ZipLib ?
http://www.ICSharpCode.net

I had to add the BufferedInputStream code source from mono to make it work
on Pocket.
Otherwise it work straight away, and well. And it's 100% managed.

Eduardo Pavinato Klein said:
Does anyone has PInvoked zlib.dll?

I think I have a mistake. For example, is it correct to use:

[DllImport("zlibce.dll")]
public static extern IntPtr gzopen (string path, string mode);

for the evc++ function
gzFile gzopen (const char *path, const char *mode);

Thanks,
Eduardo Pavinato Klein
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top