Notifies the project that a component reference has been added to the project.
Namespace: Microsoft.VisualStudio.Package
Assembly: MPF.Project.NonShipping (in MPF.Project.NonShipping.dll)
Syntax
'宣言
Public Overridable Function AddComponent ( _
dwAddCompOperation As VSADDCOMPOPERATION, _
cComponents As UInteger, _
rgpcsdComponents As IntPtr(), _
hwndDialog As IntPtr, _
pResult As VSADDCOMPRESULT() _
) As Integer
'使用
Dim instance As ProjectNode
Dim dwAddCompOperation As VSADDCOMPOPERATION
Dim cComponents As UInteger
Dim rgpcsdComponents As IntPtr()
Dim hwndDialog As IntPtr
Dim pResult As VSADDCOMPRESULT()
Dim returnValue As Integer
returnValue = instance.AddComponent(dwAddCompOperation, _
cComponents, rgpcsdComponents, hwndDialog, _
pResult)
public virtual int AddComponent(
VSADDCOMPOPERATION dwAddCompOperation,
uint cComponents,
IntPtr[] rgpcsdComponents,
IntPtr hwndDialog,
VSADDCOMPRESULT[] pResult
)
public:
virtual int AddComponent(
VSADDCOMPOPERATION dwAddCompOperation,
unsigned int cComponents,
array<IntPtr>^ rgpcsdComponents,
IntPtr hwndDialog,
array<VSADDCOMPRESULT>^ pResult
)
public function AddComponent(
dwAddCompOperation : VSADDCOMPOPERATION,
cComponents : uint,
rgpcsdComponents : IntPtr[],
hwndDialog : IntPtr,
pResult : VSADDCOMPRESULT[]
) : int
Parameters
dwAddCompOperation
Type: Microsoft.VisualStudio.Shell.Interop.VSADDCOMPOPERATIONAlways VSADDCOMPOP_ADD.
cComponents
Type: System.UInt32The number of components in the rgpcsdComponents array.
rgpcsdComponents
Type: []An array of pointers to VSCOMPONENTSELECTORDATA structures representing the selected components.
hwndDialog
Type: System.IntPtrA pointer to the dialog box. Not used, pass in a null reference (Nothing in Visual Basic).
pResult
Type: []An array of results.
Return Value
Type: System.Int32
E_NOTIMPL if there is no reference container, meaning that the project does not support references; otherwise S_OK.
Implements
IVsComponentUser.AddComponent(VSADDCOMPOPERATION, UInt32, [], IntPtr, [])
Remarks
This method is a callback from the IVsComponentSelector dialog when a new component has been selected.
If attempting to add one of the selected components causes a BadImageFormatException to be thrown (i.e. the class library or executable file is invalid), this method will display a message box with the exception's message.
Permissions
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.