Share via


CComModule::UpdateRegistryFromResourceD

As of ATL 7.0, CComModule is obsolete: see ATL Module Classes for more details.

virtual HRESULT UpdateRegistryFromResourceD( 
   LPCTSTR lpszRes, 
   BOOL bRegister, 
   struct _ATL_REGMAP_ENTRY* pMapEntries = NULL  
) throw( ); 
virtual HRESULT UpdateRegistryFromResourceD( 
   UINT nResID, 
   BOOL bRegister, 
   struct _ATL_REGMAP_ENTRY* pMapEntries = NULL  
) throw ( );

Parameters

  • lpszRes
    [in] A resource name.

  • nResID
    [in] A resource ID.

  • bRegister
    [in] Indicates whether the object should be registered.

  • pMapEntries
    [in] A pointer to the replacement map storing values associated with the script's replaceable parameters. ATL automatically uses %MODULE%. To use additional replaceable parameters, see the Remarks for details. Otherwise, use the NULL default value.

Return Value

A standard HRESULT value.

Remarks

Runs the script contained in the resource specified by lpszRes or nResID.

If bRegister is TRUE, this method registers the object in the system registry; otherwise, it unregisters the object.

By specifying the DECLARE_REGISTRY_RESOURCE or DECLARE_REGISTRY_RESOURCEID macro, UpdateRegistryFromResourceD will be invoked automatically when your object map is processed.

Note

To substitute replacement values at run time, do not specify the DECLARE_REGISTRY_RESOURCE or DECLARE_REGISTRY_RESOURCEID macro. Instead, create an array of _ATL_REGMAP_ENTRIES structures, where each entry contains a variable placeholder paired with a value to replace the placeholder at run time. Then call UpdateRegistryFromResourceD, passing the array for the pMapEntries parameter. This adds all the replacement values in the _ATL_REGMAP_ENTRIES structures to the Registrar's replacement map.

Note

To statically link to the ATL Registry Component (Registrar), see UpdateRegistryFromResourceS.

For more information about replaceable parameters and scripting, see the article The ATL Registry Component (Registrar).

Requirements

Header: atlbase.h

See Also

Reference

CComModule Class