Share via


IApplication::SetAddInInfo (Windows CE 5.0)

Send Feedback

This method provides information about an add-in when the add-in is loaded.

The add-in calls SetAddInInfo.

HRESULT SetAddInInfo(
  longnInstanceHandle,IDispatch* pCmdDispatch,longnIDBitmapResourceMedium,longnIDBitmapResourceLarge,longdwCookie);

Parameters

  • nInstanceHandle
    [in] The HINSTANCE of the add-in DLL.

  • pCmdDispatch
    [in] The pointer to the dispatch interface implemented by the add-in Commands Object.

    When a user chooses an add-in command, IDE invokes the command by using this pointer to communicate with the add-in.

  • nIDBitmapResourceMedium
    [in] The identifier of the bitmap resource containing medium-sized images of toolbar buttons that the add-in is adding.

    Specify -1 if the add-in does not provide toolbar buttons.

  • nIDBitmapResourceLarge
    [in] The identifier of the bitmap resource containing large-sized images of toolbar buttons that the add-in is adding.

    Specify -1 if the add-in does not provide toolbar buttons.

  • dwCookie
    [in] The cookie identifying the add-in.

    IDE passes this value to the add-in through the add-in IDSAddIn::OnConnection method.

Return Values

None.

Remarks

Only add-ins can call the SetAddInInfo method; VBScript macros cannot.

The following example shows the code that is generated when you create an add-in using the Visual Studio Add-in Wizard:

Note   To make the following code example easier to read, error checking is not included. This code example should not be used in a release configuration unless it has been modified to include secure error handling.

STDMETHODIMP CDSAddIn::OnConnection(IApplication* pApp, VARIANT_BOOL bFirstTime,
      long dwCookie, VARIANT_BOOL* OnConnection)
{
...
   pApplication->SetAddInInfo((long) AfxGetInstanceHandle(),
      (LPDISPATCH) m_pCommands, IDR_TOOLBAR_MEDIUM, IDR_TOOLBAR_LARGE, m_dwCookie);
...
}

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Appdefs.h.
Link Library: Import type library from Devshl.dll.

See Also

Commands Object | IDSAddIn::OnConnection

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.