What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help - accessing the registry

Help - accessing the registry
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Help - accessing the registry
You just experienced a (known) Plus! bug ;) :

1) Plus! can't handle numbers larger than 0x80000000. (this should be fixed in next update). In fact, every interop function of Plus! requires SIGNED numbers instead of UNSIGNED numbers.

eg: ReadWord(), ReadDWord(), WriteDWord(), etc all require signed numbers.

so, instead of:
code:
var HKEY_CURRENT_USER = 0x80000001;
which will return the unsigned number 2147483649, use this:
code:
var HKEY_CURRENT_USER = 0x80000000 | 1;
which will return the equivalent, but signed, number -2147483647...

[edit]
or:
code:
var HKEY_CURRENT_USER = 0x80000001 & 0xFFFFFFFF;
[/edit]


The reason why certain keys do work is because Plus! interprets that provided unsigned number as a signed one (thus wrongly) and thus you actually open the key under a different main hive, namely HKEY_CLASSES_ROOT in this case (which does has a "Software" subkey).




2)
quote:
Return Values
If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
Thus those registry APIs don't use GetLastError, they return the error directly as the return value...

However, I must say Interop.GetLastError always returns 0 with me too with certain APIs (APIs which do provide the error in GetLastError).

This post was edited on 09-23-2006 at 07:59 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
09-23-2006 07:12 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help - accessing the registry - by Choli on 09-23-2006 at 06:53 PM
RE: Help - accessing the registry - by CookieRevised on 09-23-2006 at 07:12 PM
RE: Help - accessing the registry - by Choli on 09-23-2006 at 07:30 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On