18.04.2015 Views

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

ArcGIS Engine Developer Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VISUAL C++<br />

}<br />

return _Module.UnregisterServer(TRUE);<br />

ATL provides a text file format, .rgs, that is parsed by the ATL’s registrar component<br />

when a DLL is registered and unregistered. The .rgs file is built into a DLL<br />

as a custom resource. The file can be edited to add additional registry entries and<br />

contains ProgID, ClassID, and component category entries. The syntax describes<br />

keys, values, names, and subkeys to be added to or removed from the registry. The<br />

format can be summarized as follows:<br />

[NoRemove | ForceRemove | val] Name | [ = s 'Value' | d 'Value' | b 'Value' ]<br />

{<br />

.. optional subkeys for the registry<br />

}<br />

NoRemove signifies that the registry key should not be removed on unregistration.<br />

ForceRemove will ensure the key and subkeys are removed before registering the<br />

new keys. The s, d, and b values indicate string (enclosed with apostrophes),<br />

double word (32-bit integer value), and binary registry values. A typical registration<br />

script is shown below.<br />

HKCR<br />

{<br />

SimpleObject.SimpleCOMObject.1 = s 'SimpleCOMObject Class'<br />

{<br />

CLSID = s '{2AFFC10E-ECFB-4697-8B3D-0405650B7CFB}'<br />

}<br />

SimpleObject.SimpleCOMObject = s 'SimpleCOMObject Class'<br />

{<br />

CLSID = s '{2AFFC10E-ECFB-4697-8B3D-0405650B7CFB}'<br />

CurVer = s 'SimpleObject.SimpleCOMObject.1'<br />

}<br />

NoRemove CLSID<br />

{<br />

ForceRemove {2AFFC10E-ECFB-4697-8B3D-0405650B7CFB} = s 'SimpleCOMObject<br />

Class'<br />

{<br />

ProgID = s 'SimpleObject.SimpleCOMObject.1'<br />

VersionIndependentProgID = s 'SimpleObject.SimpleCOMObject'<br />

InprocServer32 = s '%MODULE%'<br />

{<br />

val ThreadingModel = s 'Apartment'<br />

}<br />

'TypeLib' = s '{855DD226-5938-489D-986E-149600FEDD63}'<br />

'Implemented Categories'<br />

{<br />

{7DD95801-9882-11CF-9FA9-00AA006C42C4}<br />

}<br />

}<br />

}<br />

}<br />

NoRemove CLSID ensures the registry key CLSID is never removed. This is the<br />

subkey that all COM objects use to register their ProgIDs and GUIDs, so its<br />

Chapter 4 • <strong>Developer</strong> environments • 103

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!