Build

This project method lets you build your project.

Usage

lSuccess = prjProject.Build( [ cResultFile ] [, nBuildType ]
                             [, lRebuildAll ] [, lShowErrors ]
                             [, lRegenerateIds ] )

Parameter

Value

Meaning

cResultFile

Character

The file in which to store the built application. You can include a path to put the result in a different directory.

Omitted

Use the project name plus the appropriate extension.

nBuildType

1 or Omitted

Rebuild the project, but don't build an APP, EXE or DLL.

2

Build an APP.

3

Build an EXE.

4

Build a DLL. This works only if you have at least one OLE Public class in the project. If not, you get an error "Cannot build a DLL without OLE public classes."

5

Build a multi-threaded DLL (MTDLL). This works only if you have at least one OLE Public class in the project. If not, you get an error "Cannot build a DLL without OLE public classes."

lRebuildAll

Logical

Should every item in the project be rebuilt or only those that have changed?

lShowErrors

Logical

Should an edit window open up after the build to display any error messages? Either way, any errors are stored in a file with an ERR extension if SET LOGERRORS is set ON.

lRegenerateIds

Logical

If you're building a DLL, should new component IDs be created? Typically, you would do this only if you have changed the interface of the DLL, because COM requires that the interface of an existing component never change.

lSuccess

.T.

The build was completed.

.F.

The build was not completed. The only time we've seen this result is when we canceled in mid-build (after a missing-file message appeared). If we build a project that has errors in it, but we let it run to completion, Build returns .T.


This method lets you do the things you'd normally do by clicking the Build button in the Project Manager or by issuing BUILD APP, BUILD EXE, BUILD DLL, or BUILD MTDLL.

Help says you can mismatch cFileName and nBuildAction. Not so. If you specify, say, "Test.EXE" for cFileName and 2 (App) for nBuildAction, no output file is created. But the method returns .T. anyway.


Example

* Build an APP, using the project name for the output file.
_VFP.ActiveProject.Build(,2)

See Also

ActiveProject, AfterBuild, BeforeBuild, Build APP, Build DLL, Build EXE, Build MTDLL, Project, Set LogErrors


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .