> My program needs to read the debugging Command property from project
> properties and translate it to something else (for remote debugging). By
> default the Command is set to $(TargetPath). How do I get the absolute path
> of macros like this? Is there an API I can use?
>
> Thanks!
Yes, there is. Would I be right in assuming you are working with C++ projects? If so, you can use a method such as VCProjectEngineLibrary::VCPlatformPtr::Evaluate(), as in the example below (which retrieves the include folder configuration) from one of our add-ins:
CString VsAutomationHelper::GetVcIncludeFolders(EnvDTE::_DTE* pDTE)
{
if (pDTE == NULL)
{
return _T("");
}
try
{
EnvDTE::_DTEPtr ptrDTE;
pDTE->QueryInterface(&ptrDTE);
EnvDTE::PropertiesPtr ptrProperties = ptrDTE->GetProperties( _T("Projects"), _T("VCDirectories") );
VCProjectEngineLibrary::IVCCollectionPtr ptrPlatforms = ptrProperties->Item( _T("Platforms") )->GetObject();
ATLASSERT(ptrPlatforms != NULL);
if (ptrPlatforms != NULL)
{
VCProjectEngineLibrary::VCPlatformPtr ptrPlatform = ptrPlatforms->Item( _T("Win32") );
_bstr_t bsFolders = ptrPlatform->GetIncludeDirectories();
CString sIncludeFolders = OLE2CT( ptrPlatform->Evaluate(bsFolders) );
}
return sIncludeFolders;
}
catch (const _com_error& e)
{
UNREFERENCED_PARAMETER(e);
ATLASSERT(false);
}
return _T("");
}
Good luck!
Kind Regards,
Anna-Jayne Metcalfe
Software/Product Development Consultant,
Riverblade Limited.
http://www.riverblade.co.uk