Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

RegDBGetKeyValueEx() returns invalid data

475 views
Skip to first unread message

Vincent Goossens

unread,
Apr 7, 1999, 3:00:00 AM4/7/99
to
Hi all,

I encounter a strange behaviour of RegDBGetKeyValueEx() when reading
REG_FULL_RESOURCE_DESCRIPTOR value: the functions reports no error code, but
the returned data buffer doesn't contain the expected registry value. The
returned value type is 9, which is undocumented.

I use InstallShield for Microsoft C++ 6 (Build-130).

Is this behaviour a limitation of the InstallShield version or a real
problem?

Thanks for your help.

----------------------------------------------------------------------------
--
Snippet code
----------------------------------------------------------------------------
--
STRING szKey, szNumName, szNumValue, svNumValue, szTitle, szMsg,
szHexString,szHexByte;
NUMBER nvType, nvSize, nRootKey, nByteIndex;

program

nRootKey = HKEY_LOCAL_MACHINE;
if (RegDBSetDefaultRoot(nRootKey) < 0) then
MessageBox("First call to RegDBSetDefaultRoot failed.", SEVERE);
endif;

szKey =
"\\HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter\\2\\SerialController\
\0";
szTitle = "Snippet Test";

/************************************/
/* Component information works well */
/************************************/
szNumName = "Component Information";
szHexString = "";
if (RegDBGetKeyValueEx(szKey, szNumName, nvType, svNumValue, nvSize) < 0)
then
MessageBox("RegDBGetKeyValueEx failed.", SEVERE);
else
for nByteIndex = 0 to (nvSize-1)
Sprintf(szHexByte,"%02lx ",svNumValue[nByteIndex] );
szHexString = szHexString + szHexByte;
endfor;
szMsg = "%s has value: %s\nThis data is %d bytes.\nnvType =
%d.\n\nREGDB_STRING = %d.\nREGDB_STRING_EXPAND = %d.\nREGDB_STRING_MULTI =
%d.\nREGDB_NUMBER = %d.\nREGDB_BINARY = %d.\n";
SprintfBox(INFORMATION, szTitle, szMsg, szNumName, szHexString,
nvSize,nvType, REGDB_STRING,REGDB_STRING_EXPAND, REGDB_STRING_MULTI,
REGDB_NUMBER, REGDB_BINARY);
endif;

/***************************************/
/* Configuration information works bad */
/***************************************/
szNumName = "Configuration Data";
szHexString = "";
if (RegDBGetKeyValueEx(szKey, szNumName, nvType, svNumValue, nvSize) < 0)
then
MessageBox("RegDBGetKeyValueEx failed.", SEVERE);
else
for nByteIndex = 0 to (nvSize-1)
Sprintf(szHexByte,"%02lx ",svNumValue[nByteIndex] );
szHexString = szHexString + szHexByte;
endfor;
szMsg = "%s has value: %s\nThis data is %d bytes.\nnvType =
%d.\n\nREGDB_STRING = %d.\nREGDB_STRING_EXPAND = %d.\nREGDB_STRING_MULTI =
%d.\nREGDB_NUMBER = %d.\nREGDB_BINARY = %d.\n";
SprintfBox(INFORMATION, szTitle, szMsg, szNumName, szHexString,
nvSize,nvType, REGDB_STRING,REGDB_STRING_EXPAND, REGDB_STRING_MULTI,
REGDB_NUMBER, REGDB_BINARY);
endif;
endprogram


=================================================================
Vincent Goossens - System Engineer
E-mail : Vincent....@Aspentech.com
Aspentech - Cimtech S.A.
Rue de l'industrie 20
B-1400 Nivelles Belgium
Phone : (+32) 067 88 36 66 Fax : (+32) 067 88 36 88

More about CIMVIEW & CIMWORK? Connect to http://www.cimtech.be.
More about Aspentech? Connect to http://www.aspentech.com.


Vincent Goossens

unread,
Apr 9, 1999, 3:00:00 AM4/9/99
to

Linh C. Nguyen

unread,
Apr 9, 1999, 3:00:00 AM4/9/99
to
Remove the first two ("\\") characters may help..

Vincent Goossens wrote in message <370da...@news.installshield.com>...

0 new messages