Re: Using build.exe within Visual C++ 6.0 IDE

Anything not involving running build.exe is not a good idea.

There is a slightly different way with different compromises.
If you have a slightly large source tree, multiple drivers, whatever, and
you value the VC editor and easy navigation to compilation errors via the
output window, and don’t care about ClassView and FileView, and you find
creating all these projects a pain, then instead of creating a project, you
can put something on the tools menu, like, that runs build.exe for the
directory of whatever file is in front in the editor. This makes it easier
to build, like, what you are working on at the moment. You can open a dirs
or sources file if you aren’t actively editing anything.

As well, if you do a command line build and have a bunch of compilation
errors in build.err, you just do like type $(File) or somesuch to get it
into the output window and then navigate to the indicates lines. I had a
.bat file called f4ize.bat, after the f4 key that navigates forward through
the output window, but it isn’t handy. You /should/ just be able to past
build.err into the output window…

@echo off
REM
***************************************************************************
REM This works great launched from the VC IDE’s tools menu.
REM It builds in the directory of the front open file, if you set it up:
REM Tools.Customize.Tools
REM Click starburst to add new.
REM Name it whatever you want, I create “NtddkBuild checked” and
“NtddkBuild free”
REM Command: z:\dev\ntddkbuild2.bat
REM Arguments: checked $(FileDir)
REM Initial directory: $(FileDir) (this should only be needed on Win9x
[untested])
REM Check “Use Output Window” this is very important.
REM
REM You can easily associate a keypress with this via the gui.
REM
***************************************************************************

if (%1) == () goto usage
if (%2) == () goto usage

@if (%OS%)==(Windows_NT) goto nt
REM — EDIT HERE if you need Win9x compatibility [untested] —
call z:\dev\NtddkEnv2 %1
build -FeEP
goto end

:nt
REM or… \ddk\bin\setenv…
call %~dp0NtddkEnv2 %1
cd /d %2 && build -FeEP %3 %4 %5 %6 %7 %8 %9
goto end

:usage
@if (%OS%)==(Windows_NT) goto ntUsage
REM [untested]
@echo “%0 %1 %2 %3 %4 %5 %6 %7 %8 %9”
@echo “Usage: %0 free|checked directoryToBuild [additional build.exe args]”
goto end

:ntUsage
@echo “%0%*”
@echo “Usage: %~n0 free|checked directoryToBuild [additional build.exe
args]”
goto end

:err
@echo “There was an error in %0. Sorry.”

:noerr
:end
:eof

  • Jay

You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Another alternative is to use Source Insight. It has a very nice
capability to define custom commands and run builds similar to
DevStudio. With it, you can define builds or complete rebuilds and the
output is captured. This means that if you get errors or warnings, the
results are displayed in a separate window and it jumps to the first
error/warning. Other errors/warnings are easily jumped to via buttons in
the output window.

A very nice feature of SI is its ability to define custom chroma/font
code for keywords. (This was the primary reason I switched from
CodeWright.) You can define additional keywords as needed. For example,
I defined all the synchronization calls to have a special color and size
so I can see where I’m locking and unlocking very easily. It also builds
a database in the background immediately as you add files to a project
to make browsing of symbols quick and simple.

Not a plug, just some praise for a really cool editor that does a nice
job of integrating builds and providing very capable browsing. I already
had a multipurpose batch file that sets up my build environments for
NT4, Win2K, and XP and I easily wrapped it with a small batch file that
I use for the SI custom command.

You can find SI at www.sourceinsight.com.

–jerry

-----Original Message-----
From: Jay Krell [mailto:xxxxx@cornell.edu]
Sent: Wednesday, November 14, 2001 6:38 AM
To: File Systems Developers
Subject: [ntfsd] Re: Using build.exe within Visual C++ 6.0 IDE

Anything not involving running build.exe is not a good idea.

There is a slightly different way with different compromises.
If you have a slightly large source tree, multiple drivers, whatever,
and
you value the VC editor and easy navigation to compilation errors via
the
output window, and don’t care about ClassView and FileView, and you find
creating all these projects a pain, then instead of creating a project,
you
can put something on the tools menu, like, that runs build.exe for the
directory of whatever file is in front in the editor. This makes it
easier
to build, like, what you are working on at the moment. You can open a
dirs
or sources file if you aren’t actively editing anything.

As well, if you do a command line build and have a bunch of compilation
errors in build.err, you just do like type $(File) or somesuch to get it
into the output window and then navigate to the indicates lines. I had a
.bat file called f4ize.bat, after the f4 key that navigates forward
through
the output window, but it isn’t handy. You /should/ just be able to past
build.err into the output window…

@echo off
REM
************************************************************************
***
REM This works great launched from the VC IDE’s tools menu.
REM It builds in the directory of the front open file, if you set it up:
REM Tools.Customize.Tools
REM Click starburst to add new.
REM Name it whatever you want, I create “NtddkBuild checked” and
“NtddkBuild free”
REM Command: z:\dev\ntddkbuild2.bat
REM Arguments: checked $(FileDir)
REM Initial directory: $(FileDir) (this should only be needed on
Win9x
[untested])
REM Check “Use Output Window” this is very important.
REM
REM You can easily associate a keypress with this via the gui.
REM
************************************************************************
***

if (%1) == () goto usage
if (%2) == () goto usage

@if (%OS%)==(Windows_NT) goto nt
REM — EDIT HERE if you need Win9x compatibility [untested] —
call z:\dev\NtddkEnv2 %1
build -FeEP
goto end

:nt
REM or… \ddk\bin\setenv…
call %~dp0NtddkEnv2 %1
cd /d %2 && build -FeEP %3 %4 %5 %6 %7 %8 %9
goto end

:usage
@if (%OS%)==(Windows_NT) goto ntUsage
REM [untested]
@echo “%0 %1 %2 %3 %4 %5 %6 %7 %8 %9”
@echo “Usage: %0 free|checked directoryToBuild [additional build.exe
args]”
goto end

:ntUsage
@echo “%0%*”
@echo “Usage: %~n0 free|checked directoryToBuild [additional build.exe
args]”
goto end

:err
@echo “There was an error in %0. Sorry.”

:noerr
:end
:eof

  • Jay

You are currently subscribed to ntfsd as: xxxxx@nsisoftware.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com