Re: How do you gain access to a specific instance of Visual Studio via EnvDTE in C++ without .NET
- From: "Stephen Vivash" <s.vivash@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 18 Apr 2006 14:47:09 +1000
Also tried
if(SUCCEEDED(hResult =
::CreateItemMoniker(L"!",L"VisualStudio.DTE.8.0:3188",&spIMoniker)))
instead of
if(SUCCEEDED(hResult =
::CreateFileMoniker(L"C:\\Projects\\Project1\\Project1.sln",&spIMoniker)))
also, m_spIDevStudioApp is declared as follows:
CComPtr<EnvDTE80::DTE2> m_spIDevStudioApp;
Thanks again !
"Stephen Vivash" <s.vivash@xxxxxxxxxxxxxxxxxx> wrote in message
news:epsvBFqYGHA.1352@xxxxxxxxxxxxxxxxxxxxxxx
The documentation gives this example for VB:
GetObject(L"C:\\Projects\\Project1\\Project1.sln",L"VisualStudio.Solution.8.0")
But I can't find a C++ example.
Without knowing much about monikers I have tried below without success:
HRESULT hResult;
CLSID clsid;
CComPtr<IUnknown> spIUnknown;
CComPtr<IMoniker> spIMoniker;
CComPtr<IBindCtx> spIBindCtx;
CLSIDFromProgID(L"VisualStudio.DTE.8.0",&clsid);
if(SUCCEEDED(hResult =
::CreateFileMoniker(L"C:\\Projects\\Project1\\Project1.sln",&spIMoniker)))
if(SUCCEEDED(hResult = ::CreateBindCtx(NULL,&spIBindCtx)))
if(SUCCEEDED(hResult =
spIMoniker->BindToObject(spIBindCtx,NULL,clsid,(void**) &spIUnknown)))
m_spIDevStudioApp = spIUnknown;
Thanks in advance
Steve
.
- References:
- Prev by Date: How do you gain access to a specific instance of Visual Studio via EnvDTE in C++ without .NET
- Next by Date: WUA IUpdate2.CopyToCache returns always "File not found"
- Previous by thread: How do you gain access to a specific instance of Visual Studio via EnvDTE in C++ without .NET
- Next by thread: Re: How do you gain access to a specific instance of Visual Studio via EnvDTE in C++ without .NET
- Index(es):
Relevant Pages
|