atul Site Admin
Joined: 18 Jul 2005 Posts: 8
|
Posted: Tue Aug 12, 2008 9:17 am Post subject: INFO: Developing protocol handlers with EZNamespaceExtensionsMFC |
|
|
Protocol handlers are a special type of namespace extension which can be accessed using protocol URL such as "protocol://path". For example, the Registry Browser sample that comes with EZNamespaceExtensionsMFC registers itself as a handler for the "reg" protocol, so it can be accessed from Windows Explorer or Internet Explorer using strings such as "reg://HKEY_CURRENT_USER".
To develop a namespace extension, the following steps must be completed in code :
* In the GetExtensionTargetInfo method, set the nseTarget member of CNSETargetInfo to NSET_ProtocolHandler and set the protocol property to the desired protocol (eg : "reg").
* Override the CNSEFolder::GetChildFromDisplayNameEx function in the class representing the root folder of the namespace extension and return the correct child for the passed protocol string. The RegistryBrowser sample strips the protocol part ("reg://") of the passed string and simply calls the base implementation of GetChildFromDisplayNameEx to allow it to return the correct child.
* Override the CNSEFolder::GetDisplayNameEx function and for the case when a parsing display name is requested (NSEDNF_ForParsing), return the exact same string as the protocol path of the folder. Thus, the child returned for a particular protocol string from the GetChildFromDisplayNameEx function should have the exact same protocol string as its parsing name. In the RegistryBrowser sample, a protocol string such as "reg://HKEY_CURRENT_USER" returns the folder corresponding to the "HKEY_CURRENT_USER" key. When this folder is requested for its parsing name, it returns the same protocol string : "reg://HKEY_CURRENT_USER". |
|