Movatterモバイル変換


[0]ホーム

URL:


Skip to main content

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft EdgeMore info about Internet Explorer and Microsoft Edge
Table of contentsExit focus mode

DllInstall function (shlwapi.h)

  • 2024-02-22
Feedback

In this article

Handles installation and setup for a DLL.

Syntax

HRESULT DllInstall(                 BOOL   bInstall,  [in, optional] PCWSTR pszCmdLine);

Parameters

bInstall

Type:BOOL

TRUE if the DLL is being installed;FALSE if it is being uninstalled.

[in, optional] pszCmdLine

Type:PCWSTR

A string passed in byregsvr32 that indicates which setup procedure to use. This value can beNULL.

Return value

Type:HRESULT

If this function succeeds, it returnsS_OK. Otherwise, it returns anHRESULT error code.

Remarks

This function may be implemented and exported by name by a DLL for use during application installation or setup. It is invoked byregsvr32 to allow the DLL to perform tasks such as adding information to the registry.

DllInstall is used only for application installation and setup. It should not be called by an application. It is similar in purpose toDllRegisterServer orDllUnregisterServer. Unlike these functions,DllInstall takes an input string which can be used to specify a variety of different actions. This allows a DLL to be installed in more than one way, based on any criteria that is appropriate.

To useDllInstall withregsvr32, add a "/i" flag followed by a colon (:) and a string. The string will be passed toDllInstall as thepszCmdLine parameter. If you omit the colon and string,pszCmdLine will be set toNULL. The following example would be used to install a DLL.

regsvr32 /i:"Install_1" dllname.dll

DllInstall is invoked withbInstall set toTRUE andpszCmdLine set to "Install_1". To uninstall a DLL, use the following:

regsvr32 /u /i:"Install_1" dllname.dll

With both of the above examples,DllRegisterServer orDllUnregisterServer will also be called. To callDllInstall only, add a "/n" flag.

regsvr32 /n /i:"Install_1" dllname.dll

Requirements

RequirementValue
Minimum supported clientWindows 2000 Professional, Windows XP [desktop apps only]
Minimum supported serverWindows 2000 Server [desktop apps only]
Target PlatformWindows
Headershlwapi.h
DLLShlwapi.dll (version 4.71 or later)

Feedback

Was this page helpful?

YesNo

In this article

Was this page helpful?

YesNo