Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using Installshield 2011.
When calling the function RegDBGetKeyValueEx() i am getting error code -2147024894.
What may be the reason for this?

See my script below.

C#
#define REGDB_SYS_ENV				"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"
function NewRegValues(szName, szDir)
    string szValue, szTmp,svType,svTmp2;
    NUMBER test,flag;
begin
       //--------- set Registry root to HKEY_LOCAL_MACHINE -------------//
	test = RegDBSetDefaultRoot( REGDB_ROOT_LOCAL_MACHINE );
	nTemp2 = -1;
	nTemp = REGDB_STRING_EXPAND;
	flag = RegDBGetKeyValueEx( REGDB_SYS_ENV, szName, nTemp, szValue, nTemp2 );
	if (flag < 0) then				
	  LogInstallationErrorToFile("ERROR:RegDBGetKeyValueEx failed to get ");
Posted
Updated 9-May-12 1:30am
v2

1 solution

Do you mean to refer a single value? Now it looks like you're trying to get a key value from a whole node. Should the path be something like:
#define REGDB_SYS_ENV				"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\\OS"

or whatever key you're trying to use.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900