The information in this article applies to:
SYMPTOMS
A call to RegCreateKeyEx() is successful under Windows NT version 3.1 and
Windows 95, but the call fails with error 161 (ERROR_BAD_PATHNAME) under
Windows NT version 3.5 and later.
CAUSEThis is by design. Windows NT version 3.1 and Windows 95 allow the subkey to begin with a backslash ("\"), however Windows NT version 3.5 and later do not. The subkey is given as the second parameter to RegCreateKeyEx(). RESOLUTIONRemove the backslash from the beginning of the subkey name. MORE INFORMATIONIn the sample code below, RegCreateKeyEx() fails with error 161 while the string defined by SUBKEY_FORMAT_STRING begins with a backslash, but succeeds if the initial backslash is removed. Sample Code
NOTE: Double backslashes ("\\") are required in strings in C code to
represent a single backslash, since a backslash ordinarily indicates the
beginning of an escape sequence.
Additional query words:
Keywords : kbKernBase kbWinOS2000 kbRegistry kbDSupport kbGrpKernBase |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |