c++windows-xpoffice-automationcomaddinlimited-user

COM addin for MS Office doesn't load in a limited user account


I've created a toolbar for Word. It's a COM addin and is written in C++. It works when Word is started by an Administrator account in XP. But when Word is started from a limited account it's not even loaded. I placed this code in DllMain:

/////////////////////////////////////////////////////////////////////////////
// DLL Entry Point

HINSTANCE g_hInst = NULL;

extern "C"
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
    static int passed = 0;
    if (!passed)
    {
        MessageBox(0, "foo", 0, 0);
        passed = 1;
    }

    g_hInst = hInstance;

    ............................
}

The message box is displayed when running Word from an admin account but not when running from a limited account. I'm testing this on an XP machine with Word 2003.


Solution

  • It turned out that my addin was registering itself in HKCU instead of HKLM (this was in the .rgs file). So only the user doing the install would have it registered. That's why Word wouldn't load it for other user accounts.