HostID Property [Visio 2003 SDK Documentation]

String representation of the GUID of the host application of the Microsoft Office Visio Drawing Control 2003.

strRet = object.HostID

object.HostID = strVal

strRet    String. The GUID of the host application, represented as a string.

object    Required. An expression that returns a DrawingControl object.

strVal    Required String. The new GUID of the host application, represented as a string. See Remarks for possible values.

Version added

2003

Remarks

Setting this property is optional. Set HostID at design time, for example in the Properties window in your Microsoft Visual Studio.NET project.

Setting the HostID property creates (or modifies) a subkey at the following location in the registry:

HKEY_CURRENTUSER\Software\Microsoft\Office\11.0\VisioHosts\

If you set HostID, use a unique string that identifies your program, preferably a unique GUID, although any string less than 128 characters or less in length that contains no backslash ("\") or forward slash ("/") character is valid. A GUID should be no more than 40 characters. Write your Setup program so that when it uninstalls your program, it deletes the registry key and all its subkeys.

All instances of the Visio Drawing Control in your program share the same HostID value. If you set HostID multiple times for multiple instances of the Visio Drawing Control within the same application, later values will overwrite earlier ones in the registry.

HostID data is global to all instances of the Drawing Control in a given Win32 process. If you change any of the registry settings associated with any instance of the control at the HostID location, that setting is changed for all instances.

If you leave HostID set to the default, an empty string (""), your application will share application settings, for example, those you can set in the Visio Options dialog box (Tools menu), with Visio itself. If you set a HostID value, your application will have its own persistent registry-based values for these settings. In addition, you thereby leave Visio settings unchanged. If you have more than one application that contains a Drawing Control and you want each to have its own application settings, assign each a different HostID.

Security Modifying the Microsoft Windows registry in any manner, whether through the Registry Editor or programmatically, always carries some degree of risk. Incorrect modification can cause serious problems that may require you to reinstall your operating system. It is a good practice to always back up a computer's registry first before modifying it. If you are running Microsoft Windows NT or Microsoft Windows 2000, you should also update your Emergency Repair Disk (ERD).

Applies to | DrawingControl object

See Also | About the Visio Drawing Control | About using the Visio Drawing Control in your application | NegotiateMenus property | NegotiateToolbars property | PageSizingBehavior property | Src property