IVsRegisterPriorityCommandTarget.RegisterPriorityCommandTarget 方法

定义

将新的命令目标注册 (IOleCommandTarget) 。

public:
 int RegisterPriorityCommandTarget(System::UInt32 dwReserved, Microsoft::VisualStudio::OLE::Interop::IOleCommandTarget ^ pCmdTrgt, [Runtime::InteropServices::Out] System::UInt32 % pdwCookie);
int RegisterPriorityCommandTarget(unsigned int dwReserved, Microsoft::VisualStudio::OLE::Interop::IOleCommandTarget const & pCmdTrgt, [Runtime::InteropServices::Out] unsigned int & pdwCookie);
public int RegisterPriorityCommandTarget (uint dwReserved, Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget pCmdTrgt, out uint pdwCookie);
abstract member RegisterPriorityCommandTarget : uint32 * Microsoft.VisualStudio.OLE.Interop.IOleCommandTarget * uint32 -> int
Public Function RegisterPriorityCommandTarget (dwReserved As UInteger, pCmdTrgt As IOleCommandTarget, ByRef pdwCookie As UInteger) As Integer

参数

dwReserved
UInt32

中必须为零。

pCmdTrgt
IOleCommandTarget

中指向 IOleCommandTarget 要注册的接口的指针。

pdwCookie
UInt32

弄指向 cookie (VSCOOKIE) 的指针。 在注销命令目标时使用。

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

方法将新的命令目标添加到列表的前面。

COM 签名

从 vsshell:

[C++]

HRESULT IVsRegisterPriorityCommandTarget::RegisterPriorityCommandTarget(  
   [in] DWORD dwReserved,   
   [in] IOleCommandTarget *pCmdTrgt,   
   [out,retval] VSCOOKIE *pdwCookie  
);  

适用于