Click to See Complete Forum and Search --> : Automation +Get the active projet of visual studio .net


nicgendron
August 9th, 2004, 11:54 AM
Hi,

As my subject says, I'm trying to get the active projet of a solution opened in visual studio .net 2003.

The only code that I found on that is the following :

CComVariant varActiveSolutionProjects;
pDTE->get_ActiveSolutionProjects(&varActiveSolutionProjects);
if(varActiveSolutionProjects.vt == (VT_ARRAY|VT_VARIANT))
{
CComVariant varProj;
LONG lLBound, lUBound;
SafeArrayGetLBound(varActiveSolutionProjects.parray, 1, &lLBound);
SafeArrayGetUBound(varActiveSolutionProjects.parray, 1, &lUBound);

if((lUBound - lLBound) != 0)
{
return;
}
SafeArrayGetElement(varActiveSolutionProjects.parray, &lLBound, &varProj);
pActiveProjectDisp = varProj.pdispVal;
pProject = pActiveProjectDisp;
}



The problem is that I can't do

pProject = pActiveProjectDisp



Is there a way to assing cast pActiveProjectDisp to pProject ?

Thanks.
Nic