The information in this article applies to:
SYMPTOMSRegistering an ATL server that has a long file name or one that resides in a directory with a long path name, returns a 0x80070002 error: For DLLs, this error is returned by Regsvr32.exe. For EXEs, the call to Module::RegisterServer (CComModule::RegisterServer) in _tWinMain() returns this error. CAUSEATL's registration code uses GetShortPathName() to retrieve the short name of the file and uses the short name for registration. GetShortPathName() fails if the file doesn't have a short file name. The default behavior in Windows NT, Windows 95, and Windows 98 is to automatically create short file names (8.3 format) for files with long names. You can turn this option off by using the "System Policy Editor" (Poledit.exe). Certain file systems also don't support creation of short names by default. ATL tries to use the invalid file name returned by GetShortPathName() in a call to LoadLibraryEx(), and fails with 0x80070002. RESOLUTIONWhen GetShortPathName() is called in the ATL source, add code to check whether or not it succeeded. The following functions must be modified:
to the following:
In CComModule::RegisterClassHelper(ATLBASE.H, line 5044), change the following lines from:
to the following:
These changes have no result if you build for ReleaseMinSize, because code in ATL.dll is used instead.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.This bug was corrected in Visual Studio 6.0 Service Pack 3.
For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base: MORE INFORMATION
ATL registers servers using the short file name to work around a bug in Windows NT's CreateProcess() function. For additional information, please see the following
article in the Microsoft Knowledge Base: © Microsoft Corporation 1999, All Rights Reserved. REFERENCESFor additional information, please see the following article in the Microsoft Knowledge Base: Q179690 BUG: TCProps.dll Fails to Register During Setup Additional query words: 80070002
Keywords : kbservicepack kbActiveX kbCOMt kbRegistry kbVC600bug kbATL300 kbATL300bug kbVS600sp2bug kbfaq kbVS600sp3fix kbVS600SP1bug kbGrpMFCATL |
|
Last Reviewed: January 19, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |