Archived Forum Post

Index of archived forum posts

Question:

32 bit or 64 bit dll

Apr 20 '17 at 20:30

My development environment is 32 bit. Application is build under 32 bit. When deploy to 64 bit machine, which version (32 or 64 bit) of activeX & dll should I register?


Answer

You would use the 32-bit ActiveX.

A 64-bit Windows computer can run both 32-bit and 64-bit apps. A 32-bit app is where a memory address is 4 bytes in size (32-bits) and thus there is a 4GB address space. When a program is compiled and linked, address pointers are 32-bits in size.

A 64-bit app is where the memory addresses are 8 bytes in size (64-bits) and the address space is 4GB x 4GB in size. When a program is compiled and linked, address pointers are 64-bits in size.

"DLL" stands for Dynamic-link library. When a DLL is loaded, it is linked into your app's already-running code. A DLL contains already compiled code (for 32-bits or 64-bits), and when it's linked into your running app, the size of the address pointers (32-bits or 64-bits) must match the size of the address pointers in your running app.

Therefore, the choice of 32-bit DLL or 64-bit DLL has to do with the running application, not the computer. (of course, on a 32-bit computer, only 32-bit apps can run and there is never a choice)