Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
tools
vsnet.act
vsnet.debugging
vsnet.documentation
vsnet.enterprise.tools
vsnet.general
vsnet.ide
vsnet.jlca
vsnet.servicepacks
vsnet.setup
vsnet.vsip
vsnet.vss
vsnet.vstools.office
vstudio.development
vstudio.extensibility
vstudio.general
vstudio.helpauthoring
vstudio.setup
vstudio.sourcesafe
  
 
date: Sun, 10 Aug 2008 09:52:00 -0700,    group: microsoft.public.vstudio.extensibility        back       


How to build project ?   
I need to do this thing with help of macros:

1. compile one *.cpp file
2. do some *.bat action
3. build project.

I have recoreded two macros. 
My macros:
Sub MyCompile()
        DTE.ActiveWindow.Object.GetItem("MySol\MyProj\Source 
Files\Source.cpp").Select(vsUISelectionType.vsUISelectionTypeSelect)
        DTE.Windows.Item(Constants.vsWindowKindOutput).Activate()
        DTE.ExecuteCommand("Build.Compile")
    End Sub

    Sub MyBuild()
        DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate()
        
DTE.ActiveWindow.Object.GetItem("MySol\MyProj").Select(vsUISelectionType.vsUISelectionTypeSelect)
        DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Build")
    End Sub

They are functional when run separately, but when both called from another 
parent macro:
MyCompile()
wshShell.Run("aaa.bat", True)
MyBuild() 

Error message box:
Command "ClassViewContextMenus.ClassViewProject.Build" is not available

It seems that DTE.ExecuteCommand() is run asynchronously and it dont wait 
for end of compilation and because of Output window is active second 
MyBuild() macro fails ? 

What do you recommend ?
Peter
date: Sun, 10 Aug 2008 09:52:00 -0700   author:   Peter

Re: How to build project ?   
[Please do not mail me a copy of your followup]

=?Utf-8?B?UGV0ZXI=?=  spake the secret code
 thusly:

>What do you recommend ?

Run the batch file as a post-build event for the project or as a
post-build step for the cpp file.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
      <http://www.xmission.com/~legalize/book/download/index.html>

        Legalize Adulthood! <http://blogs.xmission.com/legalize/>
date: Sun, 10 Aug 2008 15:31:52 -0700   author:   legalize+ (Richard)

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us