ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzakx_5.4.0.1/rzakxsmpcplusreg.htm

278 lines
15 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2005" />
<meta name="DC.rights.owner" content="(C) Copyright IBM Corporation 2005" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="task" />
<meta name="DC.Title" content="Customize the C++ registry values" />
<meta name="abstract" content="The sample plug-includes two registry files: SAMDBG.REG, a windows-readable registry file for use during development and SAMPRLS.REG, a registry file for distribution on the iSeries server." />
<meta name="description" content="The sample plug-includes two registry files: SAMDBG.REG, a windows-readable registry file for use during development and SAMPRLS.REG, a registry file for distribution on the iSeries server." />
<meta name="DC.Relation" scheme="URI" content="rzakxcreateplugin.htm" />
<meta name="DC.Relation" scheme="URI" content="rzakxpriregkeyex.htm" />
<meta name="DC.Relation" scheme="URI" content="rzakxshellext.htm" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="rzakxsmpcplusreg" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Customize the C++ registry values</title>
</head>
<body id="rzakxsmpcplusreg"><a name="rzakxsmpcplusreg"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Customize the C++ registry values</h1>
<div><p>The sample plug-includes two registry files: SAMDBG.REG, a windows-readable
registry file for use during development and SAMPRLS.REG, a registry file
for distribution on the iSeries™ server.</p>
<div class="section"><p>The following table describes the sections in these registry files,
and recommends changes for use when developing your own plug-in.</p>
<p><strong>Primary
registry key</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><tbody><tr><td valign="top"> <pre>; -------------------------------------------------
; Define the primary registry key for the plugin
; NOTE: NLS and ServerEntryPoint DLL names must
; not contain qualified directory paths
[HKEY_CLASSES_ROOT\IBM.AS400.Network\3RD PARTY plug-inS\IBM.Sample]
"Type"="PLUGIN"
"NLS"="sampmri.dll"
"NameID"=dword:00000080
"DescriptionID"=dword:00000081
"MinimumIMPIRelease"="NONE"
"MinimumRISCRelease"="030701"
"ProductID"="NONE"
"ServerEntryPoint"="sampext.dll"</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>See the topic Example Primary registry key for a description of
each of the fields and the recommended values.</p>
<p><strong>Data Server Implementation</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><tbody><tr><td valign="top"> <pre>------------------------------------------------------------------------------
; This section will register an IA4HierarchyFolder implementation
for each new
; folder added to the iSeries Navigator hierarchy.
[HKEY_CLASSES_ROOT\CLSID\{D09970E1-9073-11d0-82BD-08005AA74F5C}]
@="AS/400 Data Server - Sample Data"
[HKEY_CLASSES_ROOT\CLSID\{D09970E1-9073-11d0-82BD-08005AA74F5C}\InprocServer32]
@="%CLIENTACCESS%\Plugins\IBM.Sample\sampext.dll"
"ThreadingModel"="Apartment"</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>If your plug-in will add more than one new folder to the hierarchy,
you must duplicate this section of the registry file for each additional folder,
making sure to generate a separate GUID for each folder. If your plug-in doesn't
add any folders, you can remove this section.</p>
</div>
<ol><li class="stepexpand"><span>Change the name of the DLL to match the name of the DLL that is
generated by your new project workspace.</span></li>
<li class="stepexpand"><span>Generate and copy a new GUID (See the global changes section at
the bottom of this page)</span></li>
<li class="stepexpand"><span>Replace both occurrences of the CLSID in this section of the registry
with the new GUID string you just generated.</span></li>
<li class="stepexpand"><span>Search for the string "IMPLEMENT_OLECREATE" in your version of
the file SAMPDATA.CPP</span></li>
<li class="stepexpand"><span>Paste the new GUID over the existing CLSID in the comment line,
then change the CLSID in the IMPLEMENT_OLECREATE macro call to match the hex
values in your new GUID. Replace the word "Sample" with the name of your new
folder.</span></li>
<li class="stepexpand"><span>Create two new source files for each new GUID, using a renamed
copy of SAMPDATA.H and SAMPDATA.CPP as a base. </span> <div class="note"><span class="notetitle">Note:</span> The header
file (.H) contains the class declaration for the new implementation class.
The implementation file (.CPP) contains the code that obtains the data for
the new folder.</div>
</li>
<li class="stepexpand"><span>Replace all occurrences of the class name "CSampleData"
in the two source files with a class name that is meaningful in the context
of your plug-in.</span></li>
<li class="stepexpand"><span>To add the new implementation files to the project workspace, open
the <span class="uicontrol">Insert</span> menu and select <span class="uicontrol">Files Into Project...</span>.</span></li>
<li class="stepexpand"><span>Because you are duplicating SAMPDATA.CPP in this way, all your
new folders will initially contain library objects.</span></li>
</ol>
<div class="section"><p><strong>Shell plug-in implementation</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><tbody><tr><td valign="top"> <pre>;--------------------------------------------------------------------
; This section will register the shell plug-in implementation class.
; A shell plug-in adds context menu items and/or property pages
; for new or existing objects in the hierarchy.
[HKEY_CLASSES_ROOT\CLSID\{3D7907A1-9080-11d0-82BD-08005AA74F5C}]
@="AS/400 Shell plug-ins - Sample"
[HKEY_CLASSES_ROOT\CLSID\{3D7907A1-9080-11d0-82BD-08005AA74F5C}\InprocServer32]
@="%CLIENTACCESS%\Plugins\IBM.Sample\sampext.dll"
"ThreadingModel"="Apartment"
;--------------------------------------------------------------------
; Approve shell plug-in (required under Windows NT<sup>(R)</sup>)
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved]
"{3D7907A1-9080-11d0-82BD-08005AA74F5C}"="AS/400 Shell plug-ins - Sample"</pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>This section registers the shell plug-in implementation class.
Every c++ plug-in must use this section.</p>
<ol><li>Change the DLL name to match the name of the DLL that was generated by
your new project workspace.</li>
<li>Generate and copy a new GUID (see the global changes section at the bottom
of this page).</li>
<li>Replace all occurrences of the CLSID in the entries that are shown in
the example above with the new GUID you just generated.</li>
<li>Search for the string "IMPLEMENT_OLECREATE" in your version of the file
EXTINTFC.CPP</li>
<li>Paste the new GUID over the existing CLSID in the comment line, then change
the CLSID in the IMPLEMENT_OLECREATE macro call to match the hex values in
your new GUID.</li>
</ol>
<p><strong>Shell plug-in implementation for objects</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" frame="border" border="1" rules="all"><tbody><tr><td valign="top"> <pre>;--------------------------------------------------------------------
; Register a context menu handler for the new folder and its objects
[HKEY_CLASSES_ROOT\IBM.AS400.Network\3RD PARTY plug-inS\IBM.Sample\shellex\Sample\*
\ContextMenuHandlers\{3D7907A1-9080-11d0-82BD-08005AA74F5C}]
;--------------------------------------------------------------------
; Register a property sheet handler for the new folder and its objects
[HKEY_CLASSES_ROOT\IBM.AS400.Network\3RD PARTY EXTENSIONS\IBM.Sample\shellex\Sample\*
\PropertySheetHandlers\{3D7907A1-9080-11d0-82BD-08005AA74F5C}]
;--------------------------------------------------------------------
; Register the Auto Refresh property sheet handler for the new folder and its objects
; (this will allow your folder to take advantage of the iSeries Navigator
; Auto Refresh function)
[HKEY_CLASSES_ROOT\IBM.AS400.Network\3RD PARTY plug-inS\IBM.Sample\shellex\Sample\*
\PropertySheetHandlers\{5E44E520-2F69-11d1-9318-0004AC946C18}]
;------------------------------------------------------------------------------
; Register drag and drop context menu handlers
[HKEY_CLASSES_ROOT\IBM.AS400.Network\3RD PARTY plug-inS\IBM.Sample\shellex\Sample\*
\DragDropHandlers\{3D7907A1-9080-11d0-82BD-08005AA74F5C}]
[HKEY_CLASSES_ROOT\IBM.AS400.Network\3RD PARTY plug-inS\IBM.Sample\shellex\File Systems\*
\DragDropHandlers\{3D7907A1-9080-11d0-82BD-08005AA74F5C}]
;------------------------------------------------------------------------------
; Register Drop Handler to accept drops of objects
[HKEY_CLASSES_ROOT\IBM.AS400.Network\3RD PARTY plug-inS\IBM.Sample\shellex\Sample\*\DropHandler]
@="{3D7907A1-9080-11d0-82BD-08005AA74F5C}"
;------------------------------------------------------------------------------
; Register that this plug-in supports Secure Socket Layer (SSL) Connection
; Note: "Support Level"=dword:00000001 says the plugin supports SSL
; Note: "Support Level"=dword:00000000 says the plugin does not support SSL
[HKEY_CLASSES_ROOT\IBM.AS400.Network\3RD PARTY EXTENSIONS\IBM.Sample\SSL]
"Support Level"=dword:00000001 </pre>
</td>
</tr>
</tbody>
</table>
</div>
<p>The final section of the registry specifies which objects in the
Navigator hierarchy are affected by implementation of the plug-in.</p>
<ol><li>Replace the CLSID in this section with the new GUIDs.</li>
<li>If your plug-in will not add additional property pages to a property sheet
for a folder or object, then remove the registry entry for the property sheet
handler.</li>
<li>If your plug-in will not be a drop handler for objects, remove the drag
and drop context menu handler and drop handler registry entries.</li>
<li>Edit the subkeys \Sample\*\. For more information see, Shell plug-ins.</li>
<li>Edit or remove the code in your version of EXTINTFC.CPP, that checks for
the object types defined by the sample. <p>You should see the folders, context
menu items, property pages, and drop actions from the sample, depending on
how much function from the sample you decided to retain</p>
<div class="note"><span class="notetitle">Note:</span> The code
file based on the sample file EXTINTFC.CPP contains the code that will be
called for context menus, property pages, and drop actions. The sample code
contains checks for the object types that the sample defines. You must edit
this file and either remove these tests or change them to check for the object
types for which you wish to provide new function.</div>
</li>
</ol>
<p><strong>Global changes</strong></p>
<p><strong>You have to specify a unique ProgID
and GUIDs for use throughout the plug-in registry file.</strong></p>
<p><strong>Define
a unique programmatic identifier, or ProgID, for your plug-in:</strong></p>
<p>The
ProgID should match the &lt;vendor&gt;.&lt;component&gt; text string, where
vendor identifies the name of the vendor who developed the plug-in, and component
describes the function being provided. In the sample plug-in, the string "IBM<sup>®</sup>.Sample"
identifies IBM as
the vendor, and "Sample" as the description of the function that is provided
by the plug-in. This will be used throughout the registry file, and will name
the directory where your plug-in will reside on both the iSeries server
and the workstation. Replace every occurrence of "IBM.Sample" in the registry file with your
ProgID.</p>
<p><strong>Generate new GUIDs, and replace the CLSID values in the registry
file:</strong></p>
<p><strong>For your iSeries Navigator C++ plug-in to work properly, you
must replace specific CLSIDs in your new registry file with GUIDs that you
generate.</strong></p>
<p><strong>The Component Object Model from Microsoft<sup>®</sup> uses
16-byte hex integers to uniquely identify ActiveX implementation classes and
interfaces. These integers are known as GUIDs (Globally Unique Identifiers).
GUIDs that identify implementation classes are called CLSIDs. (pronounced
"class IDs") iSeries Navigator
uses the Windows<sup>®</sup> ActiveX runtime support to load a plug-in's
components, and to obtain a pointer to an instance of the plug-in's implementation
of a particular interface. A CLSID in the registry uniquely identifies a specific
implementation class that resides in a specific ActiveX server DLL. The first
stage of this mapping, from the CLSID to the name and location of the server
DLL, is accomplished by means of a registry entry. Therefore, an iSeries Navigator
plug-in must register a CLSID for each implementation class that it provides.</strong></p>
<p>Follow
these steps to generate your GUIDs:</p>
<ol><li>From the Windows taskbar, select <span class="uicontrol">Start</span> and
then <span class="uicontrol">Run</span>.</li>
<li>Type <samp class="codeph">GUIDGEN</samp> and click <span class="uicontrol">OK</span>.</li>
<li>Make sure that Registry Format is selected.</li>
<li>To generate a new GUID value, select <span class="uicontrol">New GUID</span>.</li>
<li>To copy the new GUID value to the clipboard, select <span class="uicontrol">Copy</span>.</li>
</ol>
</div>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="rzakxpriregkeyex.htm">Example: Primary registry key</a></strong><br />
The primary registry key defines a set of fields that specify global information for the plug-in. This information is required.</li>
<li class="ulchildlink"><strong><a href="rzakxshellext.htm">Shell plug-ins</a></strong><br />
These registry keys map a particular node or set of nodes in the hierarchy to the type of function supplied by the plug-in, and to the CLSID of the implementation class which implements the function.</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakxcreateplugin.htm" title="After modifying the sample plug-ins, you'll need to make some modifications to the registry files. This topic provides a walk-through of the registry files for each type of plug-in, and recommends some modifications.">Customize the plug-in registry files</a></div>
</div>
</div>
</body>
</html>