Hi, i have created a DLL(win32) in visual c++( say myDLL) which is using some other DLL. I load these DLL using visual c++ LoadLibrary() function. And then i am using this DLL(myDLL) in a C# application (Released as Any CPU). This application is working fine on windows XP 32 system.
For windows 7 64bit i created a DLL(x64) in visual c++( say my64DLL) which is using some other DLL. I load these DLL using visual c++ LoadLibrary() function. And then i am using this DLL(my64DLL) in a C# application (Released as Any CPU). Problem is when control goes to LoadLibrary() it return 0. That is it didn't load the third party DLL. I am unable to understand where is the problem. Please help me in resolving this issue.
For whole development i am using windows XP 32 bit system.
Thank in advance.
how are you running 64-bit code on a 32-bit system? and then, anycpu really means run as whatever
@ranjeetg:I suggest see if your application process has a "*" attach to it's process name in task manager under Win7 x64. That's simple verification that whether the process is running as 32-bit process or not (32-bit processes have "*")
Let's eliminate that possibility before continue.
@cheong: Process is running as a 64bit application there is no any process name containing "*" .
@cheong:@cheong: Process is running as a 64bit application there is no any process name containing "*"
@Ion Todirel: I am not running i am only developing DLL(in visual c++ released as X64) and c# application(released as anyCPU and using my DLL) which will run on a windows 7 64bit machine.
Then, since you mentioned it's Visual C++, did you staticly linked everything, or remember to install the VC++ runtime on target machine? I remember if VC++ runtime is missing the libraries won't load.
Try copy the "depends.exe" and run that on Win7 with problem, load the DLL to see if it says anything is missing.
You are correct my test vc++ console() application (released as win32) running as a 32bit application on windows7 64bit system.
@cheong: Hi please suggest me a way to solve this problem in developing application for windows 64bit system. I am only having 32bit version of 3rd party DLL .
Thanks for your help.
If that's not possible, you have to set your library to target x86 then. Which also means your library can't be used by applications that compiles with target = x64.
My advice would be try to see if you can get 64-bit runtime from vendors (some software vendors make it possible to use newer version of runtime with old license, just that it won't enter design mode. If you're running out of budget, it's be wise to just check and see if that move is possible.)
Btw, it'd be justifiable expense to buy software that your code is rely on. Try to ask your boss.
Thank you so much for your valuable response. I tried it and its working fine.
But x86 creates some new problem like i have used Shell32.ShellSpecialFolderConstants.ssfDESKTOP and other things which working fine in a AnyCPU release system but creating problem in x86.
I am trying to resolve these problems.
Ones again thanks a lot for your support.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.