What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Windows registry: how hard can it be...

Windows registry: how hard can it be...
Author: Message:
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
O.P. Windows registry: how hard can it be...
I know this sort of carries on from my last topic, but this problem is unrelated. Promise.

OK, here we go. I haven't yet figured out how to embed the sound data in the .dll, so I am trying to use the registry to find the Msg+ plugins directory, and reference my sound files that way. However, I cannot get the code to open the registry.
Here is the offending code:
code:
MPPLUGIN_RETURN_BOOL Initialize(/*[in]*/ DWORD nVersion,
                                /*[in]*/ const char* sUserEmail,
                                /*[in]*/ IDispatch* iMessengerObj)
{
    bool retValue = TRUE;
    long retCode = 0;
    HKEY regKey;
    unsigned long *szType = 0, *szSize = 0;
    unsigned char *szValue = 0;

    retCode = RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE/Patchou/MsgPlus2",
        0, KEY_QUERY_VALUE, &regKey);
    if (retCode != ERROR_SUCCESS)
    {
        MessageBox(NULL, "Error opening registry", "Error", MB_OK);
        retValue = FALSE;
    }
    else
    {
        retCode = RegQueryValueEx(regKey, "PluginDir", NULL,
            szType, szValue, szSize);
        if (retCode != ERROR_SUCCESS){ retValue = FALSE;
            MessageBox(NULL, "Error reading registry", "Error", MB_OK);
        }
        else strcpy(sPluginPath,
            reinterpret_cast<const char*>(szValue));
    }

    retCode = RegCloseKey(regKey);

    if (retCode != ERROR_SUCCESS){ retValue = FALSE;
        MessageBox(NULL, "Error closing registry", "Error", MB_OK);
    }

    return retValue;
}

It compiles, it runs, but it doesn't work. :@ The message boxes are to help me (try to) debug.

Any suggestions? All welcome.

This post was edited on 11-19-2003 at 11:33 PM by RaceProUK.
[Image: spartaafk.png]
11-19-2003 11:31 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Windows registry: how hard can it be... - by RaceProUK on 11-19-2003 at 11:31 PM
RE: Windows registry: how hard can it be... - by chris on 11-20-2003 at 01:52 PM
RE: Windows registry: how hard can it be... - by RaceProUK on 11-20-2003 at 02:24 PM
RE: Windows registry: how hard can it be... - by Hah on 11-20-2003 at 09:18 PM
RE: Windows registry: how hard can it be... - by optimism_ on 11-21-2003 at 02:03 AM
RE: Windows registry: how hard can it be... - by chris on 11-21-2003 at 04:10 AM
RE: Windows registry: how hard can it be... - by WDZ on 11-21-2003 at 04:52 AM
RE: Windows registry: how hard can it be... - by RaceProUK on 11-21-2003 at 03:22 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