共用方式為


IISApp3::AppCreate3

The AppCreate3 method creates a new Web application, configures what type of process to run it in, and assigns it to an application pool, optionally creating the application pool.

Note

This method requires IIS 6.0 or later if you create an application pool or assign the application pool to a pool other than the default.

HRESULT AppCreate3(
  LONG  lAppMode,
  VARIANT  bstrAppPooI,
  VARIANT  bCreatePool
);

Parameters

  • lAppMode
    [in] Long integer that specifies whether the application being created is to run in-process (0), out-of-process (1), or in a pooled process (2). If the application already exists and is running, changing the value of this flag will cause the application definition to be deleted and a new application created to run in the specified process space.

  • bstrAppPooI
    [in] A string that specifies the friendly name of the application pool you want this application to be a part of.

  • bCreatePool
    [in] A Boolean value that specifies if you want to create the application pool if it does not already exist.

Return Value

The method returns an HRESULT. Possible values include, but are not limited to, S_OK, which indicates that the method succeeded.

Requirements

Client: Requires Windows XP Professional.

Server: Requires Windows Server 2003.

Product: IIS

Header: Declared in iiisext.h; include iisext_i.c.

See Also

Concepts

IIS ADSI Provider Interfaces

Using ADSI to Configure IIS in a C++ Application

IIS Constants and Header Files

IIISApplicationAdmin Interface

IISApp Interface

IISApp2 Interface