IVsObjectList2.CanRename(UInt32, String, Int32) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回一个标志,该标志指示是否可以重命名给定的列表项。
public:
int CanRename(System::UInt32 index, System::String ^ pszNewName, [Runtime::InteropServices::Out] int % pfOK);
int CanRename(unsigned int index, std::wstring const & pszNewName, [Runtime::InteropServices::Out] int & pfOK);
public int CanRename (uint index, string pszNewName, out int pfOK);
abstract member CanRename : uint32 * string * int -> int
Public Function CanRename (index As UInteger, pszNewName As String, ByRef pfOK As Integer) As Integer
参数
- index
- UInt32
中指定感兴趣的列表项的索引。
- pszNewName
- String
中指向以 null 结尾的字符串的指针,该字符串包含新名称。
- pfOK
- Int32
弄一个指针,指向指示是否可以重命名项的标志。
返回
如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。
注解
COM 签名
从 vsshell80:
[C++]
HRESULT IVsObjectList2::CanRename(
[in] ULONG Index,
[in] LPCOLESTR pszNewName,
[out] BOOL *pfOK
);
返回 pfOK 以指示是否可以重命名项索引。 如果传入的 pszNewName 是 null ,你只需回答此项是否支持重命名 (return 或) 的一般问题 true false 。 如果 pszNewName 为非 null,则执行新名称的验证,并在 true 使用该新名称成功重命名) (时返回,如果该名称在某种程度上无效,则返回, false 并设置丰富的错误信息以向用户指示错误的原因。