Re: How do you gain access to a specific instance of Visual Studio via EnvDTE in C++ without .NET
- From: "Alexander Nickolov" <agnickolov@xxxxxxxx>
- Date: Tue, 18 Apr 2006 12:35:51 -0700
VB's GetObject maps to CoGetObject or GetActiveObject
depending on its parameters. However, I'm not sure which
takes precedence when both arguments are supplied...
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"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
.
- Follow-Ups:
- References:
- Prev by Date: Re: How do I debug an Access Violation when I exit DialogProc?
- Next by Date: Re: How do I debug an Access Violation when I exit DialogProc?
- Previous by thread: Re: 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
|