IApplication::SetAddInInfo
This method provides information about an add-in when the add-in is loaded. The add-in calls SetAddInInfo.
HRESULT SetAddInInfo(
long nInstanceHandle,
IDispatch* pCmdDispatch,
long nIDBitmapResourceMedium,
long nIDBitmapResourceLarge,
long dwCookie
);
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 one of the add-in commands, 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 all 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 all 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 code example shows the code automatically 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
Last updated on Friday, October 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.