Click here to Skip to main content
15,879,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to load a thirdparty 32 bit dll with function LoadLibrary().

The function is working on windows xp and windows server 2003 but it returns the error code 6 - Library required separate data segments for each task on windows 2008 X64


how to resolve this error ?
Posted
Comments
Legor 22-Aug-12 7:37am    
Not really clear .. is this library working with your code on Windows XP and 2003 but not on windows 2008?

Did you make sure youre not using a 64Bit DLL with a 32Bit module?
bharati_c 22-Aug-12 7:47am    
this library working with our application code on windows xp and windows 2003 server.

it is working with 32 bit module , just the windows 2008 machine is x64
Richard MacCutchan 22-Aug-12 8:21am    
According to MSDN documentation error code 6 means ERROR_INVALID_HANDLE. Where are you taking your definition from?
ZurdoDev 22-Aug-12 8:27am    
I'd get with the 3rd party and find out how to make it work in 64 bit.
JackDingler 22-Aug-12 11:18am    
Is the DLL dependent on another dll, service, etc...?

Perhaps something that isn't supported on 2008, or something you forgot to install?

What 3rd Party Library are you using? Without knowing that, there's nothing else we can help you with. All we can do is just guess.

Going off what Richard specified as the error code... What path did you specify in LoadLibrary()? Is it possible that the path is different now that you're dealing with 64bit?

Some issues with paths in 64bit:
0. 32bit applications are stored in "Program Files (x86)" instead of "Program Files"
1. Registry settings for 32bit applications are stored in Wow64 keys (name is misleading)
2. 32bit system dlls are found in a different path (%SystemRoot%\SysWoW64)

It's possible that the path that you had before is broken, that would lead you to get the error Richard pointed out.
 
Share this answer
 
Bymistaken 64 bit installtion was done. Hence our application(32 bit) could not able to load the library.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900