473,508 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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
4 8298
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
1307
by: Eduardo Rosa | last post by:
Hi people, Somebody knows where I can get a tutorial, or any help, to make "deny words" in my forum? thanks a lot
18
3333
by: James Radke | last post by:
Hello, We are currently using a user DLL that when working in VB 6.0 has a user defined type as a parameter. Now we are trying to use the same DLL from a vb.net application and are having...
5
5749
by: Ian Rutherford | last post by:
Heya guys, It seems VB .net no longer supports the awesome ability of VB 6 to declare something as a string and specify how long the string would be all in one line: Public myString as String *...
4
1383
by: Michael Fuhr | last post by:
I have a query that works in 7.3.6 but not in 7.4.2 unless I turn off enable_hashjoin. I'm joining a table of network interfaces and a table of networks so I can find additional info about a...
9
2054
by: beni.cherniavsky | last post by:
Python seems to be missing a UCS-32 codec, even in wide builds (not that it the build should matter). Is there some deep reason or should I just contribute a patch? If it's just a bug, should I...
28
13150
by: entfred | last post by:
I have the following line of html: &nbsp;&nbsp1234&nbsp;&nbsp;&nbsp;&nbsp;&nbspabc&nbsp;&nbsp;&nbspyow In Internet Explorer 6.0, the columns look ok using the above html: 1234 abcd ...
3
2742
by: edfialk | last post by:
Hi, all I'm trying to do is load the php_mapscript.so library into php. Here's the php file: Code: dl("php_mapscriot.so") if (extension_loaded("MapScript")) echo "works!"; else echo...
1
3418
by: jamesdylangoldstein | last post by:
So I tried to do my father a favor and convert his advertisements to .flv and place them on his website. With Flash being $600, I found an open-source .flv player and configured it. So today he...
16
1677
by: Ravi | last post by:
main() { float a = 5.375; char *p; int i; p = (char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char)p); } the above code gives the binary representation of a.
0
7115
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7377
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7489
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5624
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5047
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.