在64位系统下的32位程序/DLL眼中的System32目录
由于需要把一个老VB6程序升级到VB.NET,于是就先用VS2008升级,结果升级过程中说缺少CdoNts.dll,于是从Windows Server 2003中copy一份到本地System32目录下,并注册,结果提示“The module CdoNts.dll failed to load. The specific module could not be found.”。傻眼了,该不是我64位Windows的原因吧?后来Google一番发现,果然如此,原话摘录如下:
If your DLLs are 32-bit, you need to explicitly call the 32-bit DLL
regsvr32. It is located in %windir%\syswow64.
The problem is that 32-bit and 64-bit programs have a different view of the
file system and "system32" is not the same to them. 32-bit programs see
%windir%\syswow64 as "%windir%\system32". 64-bit programs see the real
system32, which is for 64-bit programs and dlls.
简而言之,在32位程序的眼中,他们眼中的System32目录,在64位系统中其物理路径其实是SysWow64目录,而真正的System32目录下都是64位的东西…… 这真够让人纠结的,没办法,为了兼容性。呵呵。
把CdoNts.dll拷贝到SysWow64目录下,然后注册就可以了。