Search code examples
c++dllatldllregistration

Can not register DLL


I'm working on an ATL project. When I build my solution under a x64 system it doesn't work on x86 architecture and vice versa. (I can't register the dll I generated in a different architecture). Where could be the problem? any help would be appreciated.


Solution

  • The symptoms you mention are unlikely to be exactly as described. It does not matter if you build in Win32 or x64, what does matter is what target platform is selected when you build. Then,

    I can't register the dll I generated in a different architecture

    In 32-bit Windows there is no way you can use x64 DLL, this is behavior by design. However, in 64-bit systems you typically have both 32 and 64-bit "environments" and you can use and register Win32 DLL there. If you cannot, the typical cause is that a mandatory dependency is missing (CRT or another DLL, Dependency Walker might be helpful). You need to check this out because the Q does not have relevant information on this.

    Another possible problem might be related to "use" of the DLL, apart of its registration. If you "use" the DLL from your, for instance, .NET app build for AnyCPU platform, and the application runs as 64-bit process in 64-bit Windows, then it won't pick and use your 32-bit DLL.