Hi, I have a custom add-in for VS 2003 using that DTE automation. It issues "Edit.Copy" and "Edit.Cut" commands with the following code:
CComPtr<EnvDTE::Commands> pCommands;
m_pDTE->get_Commands(&pCommands);
VARIANT str;
memset(&str,0,sizeof(str));
str.vt=VT_BSTR;
str.bstrVal=_com_util::ConvertStringToBSTR("Edit.Copy");
CComPtr<Command> cmd;
HRESULT r=pCommands->Item(str,0,&cmd);
SysFreeString(str.bstrVal);
if (r==S_OK) {
BSTR guid;
cmd->get_Guid(&guid);
long id;
cmd->get_ID(&id);
VARIANT vin,vout;
memset(&vin,0,sizeof(vin));
memset(&vout,0,sizeof(vout));
pCommands->Raise(guid,id,&vin,&vout);
SysFreeString(guid);
}
The problem is that the text being copied is not added to the Ctrl+Shift+V paste menu. What am I doing wrong? Note: It is added to the native Ctrl+Shift+V clipboard ring, just doesn't work with Visual Assist's replacement.
Can someone help?
Thanks
Ivo