By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,997 Members | 1,470 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,997 IT Pros & Developers. It's quick & easy.

a .dll works on 32-bit machine but not 64-bit machine

P: n/a
Hi, I'm calling zlib.dll to compress/uncompress file in my C# program.
The problem is it works very well on my 32-bit machine, but on another
64-bit machine, it throw an exception says "An attempt was made to load
a program with an incorrect format. <Exception from HRESULT:
0x8007000B>"
when uncompress() is called.

Since I have the source code of Zlib, I can build and generate both
..lib and .dll files. The generated .lib file works well in my C++
program on the 64-bit machine. But the generated .dll just keep
throwing exceptions in my C# program on the same machine.

Did I miss something? I'm really appreciate your help!

Nov 21 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Compile your C# program to use 32 bits, you do this in, the IDE, click in
the arrow that says Any CPU->Configuration Manager: Active Solution
Platform-<New...>

Regards,

Bela Istok
"erxuan" <er****@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi, I'm calling zlib.dll to compress/uncompress file in my C# program.
The problem is it works very well on my 32-bit machine, but on another
64-bit machine, it throw an exception says "An attempt was made to load
a program with an incorrect format. <Exception from HRESULT:
0x8007000B>"
when uncompress() is called.

Since I have the source code of Zlib, I can build and generate both
.lib and .dll files. The generated .lib file works well in my C++
program on the 64-bit machine. But the generated .dll just keep
throwing exceptions in my C# program on the same machine.

Did I miss something? I'm really appreciate your help!

Nov 21 '06 #2

P: n/a
Other Question why you use zlib, if the .net framework 2.0 includes a method
to use the gzip format?

See the namespace System.IO.Compression.

Regards,

Bela Istok
"erxuan" <er****@gmail.comwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
Hi, I'm calling zlib.dll to compress/uncompress file in my C# program.
The problem is it works very well on my 32-bit machine, but on another
64-bit machine, it throw an exception says "An attempt was made to load
a program with an incorrect format. <Exception from HRESULT:
0x8007000B>"
when uncompress() is called.

Since I have the source code of Zlib, I can build and generate both
.lib and .dll files. The generated .lib file works well in my C++
program on the 64-bit machine. But the generated .dll just keep
throwing exceptions in my C# program on the same machine.

Did I miss something? I'm really appreciate your help!

Nov 21 '06 #3

P: n/a
Problem solved! Thank you!

I guess I have to use zlib in my case since I need to parse some files
as input which were compressed using zlib by others.

Bela Istok wrote:
Compile your C# program to use 32 bits, you do this in, the IDE, click in
the arrow that says Any CPU->Configuration Manager: Active Solution
Platform-<New...>

Regards,
Nov 21 '06 #4

P: n/a
As far as I know, zlib uses the Gzip standard, you can use any library that
handle that standard, give a try ;)

Regards,

Bela Istok
"erxuan" <er****@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Problem solved! Thank you!

I guess I have to use zlib in my case since I need to parse some files
as input which were compressed using zlib by others.

Bela Istok wrote:
>Compile your C# program to use 32 bits, you do this in, the IDE, click in
the arrow that says Any CPU->Configuration Manager: Active Solution
Platform-<New...>

Regards,

Nov 21 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.