Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / December 2005

Tip: Looking for answers? Try searching our database.

How to decipher an IDE variable/macro i.e. $(BLAHBLAH)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
kehlar - 07 Dec 2005 18:22 GMT
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!
Anna-Jayne Metcalfe - 10 Dec 2005 10:03 GMT
> 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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.