INetCfgComponentSetup::ReadAnswerFile method
Note This method is deprecated and should not be used.
The ReadAnswerFile method directs the notify object of the network component to open a specific file for unattended setup and retrieve the parameters required to configure the network component.
Syntax
HRESULT ReadAnswerFile(
[in] LPCWSTR pszwAnswerFile,
[in] LPCWSTR pszwAnswerSections
);
Parameters
pszwAnswerFile [in]
Pointer to a constant null-terminated string of 16-bit Unicode characters containing the full path and name of the file for unattended setup to open.pszwAnswerSections [in]
Pointer to a constant null-terminated string of 16-bit Unicode characters containing a comma-separated list of section names in the file for unattended setup, and used to retrieve parameters for the network component.
Return value
Returns zero (S_OK) if successful; otherwise, returns NETCFG_* codes that are defined in Netcfgx.h.
Remarks
To open and retrieve information from a file for unattended setup, ReadAnswerFile uses the Setup API. For more information about the Setup API, see the Microsoft Windows SDK.
To open the file for unattended setup and retrieve a handle to the file, ReadAnswerFile calls the SetupOpenInfFile function of the Setup API and passes the name of the file. To retrieve parameter information stored in a section of the file, ReadAnswerFile calls the SetupGetLineText function of the Setup API and passes the file handle, section name, and key of the required parameter. The ReadAnswerFile method stores the retrieved parameter information in data members of its notify object. After ReadAnswerFile retrieves and stores all the parameters required to configure the network component, it calls the SetupCloseInfFile function of the Setup API to close the file.
ReadAnswerFile should not set values in the registry. Only the INetCfgComponentControl::ApplyRegistryChanges method should make changes to the registry.
Requirements
Target platform |
Desktop |
Header |
Netcfgn.h (include Netcfgn.h) |
See also
INetCfgComponentControl::ApplyRegistryChanges