Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
32 bit Debenu DLL loding on 64 bit machine |
Post Reply |
Author | |
kumarp11
Beginner Joined: 09 Oct 18 Location: United States Status: Offline Points: 13 |
Post Options
Thanks(0)
Posted: 25 Oct 18 at 11:29PM |
Hello, I am using the below code to load the proper DLL in my application but I am sometimes noticing that 32 bit Debenu DLL loading on 64 bit widows operating system. Why it is happening and does it cause any issue while printing? PDFLibrary quickPdf = null;
if (IntPtr.Size == 8) { quickPdf = new PDFLibrary(DllPath64Bit); } else { quickPdf = new PDFLibrary(DllPath32Bit); } quickPdf.UnlockKey(key); |
|
Wheeley
Senior Member Joined: 30 Oct 05 Location: United States Status: Offline Points: 146 |
Post Options
Thanks(0)
|
Just because your OS is 64-bit doesn't mean you should use a 64-bit dll. You should only use a 64-bit DLL if you program is compiled as a 64-bit application, otherwise tehe 32-bit should be used. So how are you compiling your code? 32-bit or 64-bit?
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Some more common words regarding 32-/64-bit...
If you're using a 64 bit dll then you can use it only in 64 bit environments. On 64 bit systems the dll should be in the system32-directory: On 64 bit systems this directory (irritating name!) is used only for 64 bit dlls. If you're using a 32 bit dll it should be in the SysWOW64-directory on 64-bit-environments. If you're working with a 64 bit development and a 64 bit dll you may need to set your compiler platform target to "Any CPU” to create a 64 bit EXE instead of "x86" to force it to create a 32 bit EXE. Application and dll should have the same architecture – both 32- or both 64 bit. |
|
Cheers,
Ingo |
|
kumarp11
Beginner Joined: 09 Oct 18 Location: United States Status: Offline Points: 13 |
Post Options
Thanks(0)
|
Actually, we have customers using a mix of environments, 32 bit machines and 64 bit machines(WIN 10,8 and Win 7). We want Debenu 32 bit dll to load on 32 bit machines(OS) and 64 bit dll to load on 64 bit machines(OS). We are using this code to determine which DLL to load but sometimes we are seeing 32 bit dll getting loaded on 64 bit machines. I did some investigation and found that if IntPtr.Size is 8 then it indicates 64 bit environment and using this code accordingly to load debenu dll. PDFLibrary quickPdf = null; if (IntPtr.Size == 8) { quickPdf = new PDFLibrary(DllPath64Bit); } else { quickPdf = new PDFLibrary(DllPath32Bit); } quickPdf.UnlockKey(key); are we doing something wrong?
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
Probably. IntPtr.Size will depend on whether the program calling the DLL is built as a 32-bit or 64-bit program, which is a compiler setting. If you build your application to run as a 32-bit process, the pointer size will not change if you run this program on a 64-bit operating system, the pointer size it uses will not change and it will still require a 32-bit DLL.
The key rule to remember is that a 32-bit DLL cannot be called by a 64-bit process, and vice-versa. You can test whether the environment running your 32-bit process is 64-bit by various means (Google will help you). I load kernel32.dll without a path and see if it contains an entrypoint named GetSystemWow64Directory, but there are plenty of other means. The answer will not change the pointer size used by the compiler, or which DLL your program needs to load.
|
|
tfrost
Senior Member Joined: 06 Sep 10 Location: UK Status: Offline Points: 437 |
Post Options
Thanks(0)
|
I should add: if you are seeing a 32-bit DLL successfully loaded on a 64-bit OS, this tells you that the 64-bit OS is running a 32-bit version of your application. And if you see a 64-bit DLL successfully loaded, a 64-bit version of your application. In the first case, your user has simply managed to choose the 32-bit version somehow, if you deliver both.
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
Hi,
"...We are using this code to determine which DLL to load...". If this code is running on your single app this will never work. A 64 bit app needs a 64 bit dll and a 32 bit app needs a 32 bit dll. The app and the functions inside a dll needs the same bit-architecture for proper working. |
|
Cheers,
Ingo |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store