Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
can't get rget to work properly
#1
I want to manipulate the registry in one of my macros, but I can't get rget to work. Here's my test macro:

run "notepad.exe" "" "" "" 1 "Notepad"
int port = 5
key "value before = "
outp port
key Y
rget port "TCPIPDataPort" "SOFTWARE\Symantec\pcANYWHERE\CurrentVersion\System" "HKEY_LOCAL_MACHINE")
key "value after = "
outp port

When I compile I get "Error in test: expected numeric expression." on "HKEY_LOCAL_MACHINE

It works using the default hive,

rget(port "Identity Ordinal" "Identities")

but not for any other hives. Have I misunderstood something? Is there a numeric value for HKEY_LOCAL_MACHINE, and if so what is it?
#2
I should have noted that I am evaluating the latest version (2.0.8) of QM running XP SP1
#3
Registry hives
def HKEY_CLASSES_ROOT 0x80000000
def HKEY_CURRENT_USER 0x80000001
def HKEY_LOCAL_MACHINE 0x80000002
def HKEY_USERS 0x80000003

These constants are also declared in reference file "winapiqm.txt". This file should be selected in Settings.

Example:
rget port "TCPIPDataPort" "SOFTWARE\Symantec\pcANYWHERE\CurrentVersion\System" HKEY_LOCAL_MACHINE
#4
the winapiQM.txt file in settings was what I was missing. Thanks for the quick reply.
#5
I had the same problem regarding winapiQM.txt upon upgrading to 2.0.8 from an earlier version 2 - the Replace function stopped working suddenly, giving an "unknown identifier" error. So i emailed Gintaras and he replied:

Quote:To avoid similar errors, select reference file in QM Settings, Files. It is "winapiQM.txt" in QM directory. This also can help you in programming - you dont need to declare most of winAPI functions, types and constants.


Dont know how the setting ended up blank. But if such is the case then i think an upgrade should make the file the default to prevent such errors in the first place. And/or warn the user if s/he deletes or changes the entry.


Forum Jump:


Users browsing this thread: 1 Guest(s)