Skip to content

Latest commit

 

History

History
59 lines (54 loc) · 3.64 KB

File metadata and controls

59 lines (54 loc) · 3.64 KB
title Invoking Scripts (ATL) | Microsoft Docs
ms.custom
ms.date 11/04/2016
ms.reviewer
ms.suite
ms.technology
cpp-windows
ms.tgt_pltfrm
ms.topic article
f1_keywords
StringRegister
dev_langs
C++
helpviewer_keywords
StringRegister method
scripts, invoking registry in ATL
ms.assetid eabd41ee-586b-4266-9e92-5aaad04b73a4
caps.latest.revision 10
author mikeblome
ms.author mblome
manager ghogen
translation.priority.ht
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
ru-ru
zh-cn
zh-tw
translation.priority.mt
cs-cz
pl-pl
pt-br
tr-tr

Invoking Scripts

Using Replaceable Parameters (The Registrar's Preprocessor) discusses replacement maps and mentions the Registrar method AddReplacement. The Registrar has eight other methods specific to scripting, and all are described in the following table.

Method Syntax/Description
ResourceRegister HRESULT ResourceRegister( LPCOLESTR resFileName , UINT nID , LPCOLESTR szType );

Registers the script contained in a module's resource. resFileName indicates the UNC path to the module itself. nID and szType contain the resource's ID and type, respectively.
ResourceUnregister HRESULT ResourceUnregister( LPCOLESTR resFileName , UINT nID , LPCOLESTR szType );

Unregisters the script contained in a module's resource. resFileName indicates the UNC path to the module itself. nID and szType contain the resource's ID and type, respectively.
ResourceRegisterSz HRESULT ResourceRegisterSz( LPCOLESTR resFileName , LPCOLESTR szID , LPCOLESTR szType );

Registers the script contained in a module's resource. resFileName indicates the UNC path to the module itself. szID and szType contain the resource's string identifier and type, respectively.
ResourceUnregisterSz HRESULT ResourceUnregisterSz( LPCOLESTR resFileName , LPCOLESTR szID , LPCOLESTR szType );

Unregisters the script contained in a module's resource. resFileName indicates the UNC path to the module itself. szID and szType contain the resource's string identifier and type, respectively.
FileRegister HRESULT FileRegister( LPCOLESTR fileName );

Registers the script in a file. fileName is a UNC path to a file that contains (or is) a resource script.
FileUnregister HRESULT FileUnregister( LPCOLESTR fileName );

Unregisters the script in a file. fileName is a UNC path to a file that contains (or is) a resource script.
StringRegister HRESULT StringRegister( LPCOLESTR data );

Registers the script in a string. data contains the script itself.
StringUnregister HRESULT StringUnregister( LPCOLESTR data );

Unregisters the script in a string. data contains the script itself.

ResourceRegisterSz and ResourceUnregisterSz, are similar to ResourceRegister and ResourceUnregister, but allow you to specify a string identifier.

The methods FileRegister and FileUnregister are useful if you do not want the script in a resource or if you want the script in its own file. The methods StringRegister and StringUnregister allow the .rgs file to be stored in a dynamically allocated string.

See Also

Creating Registrar Scripts