The information in this article applies to:
SUMMARY
On a single machine, developing and using 16-bit and 32-bit OLE servers
that provide objects with the same ProgID may cause problems if no
compatible server is specified. Some registry entries will point only to
the last server registered and only this server may be accessible from OLE
Automation clients.
MORE INFORMATION
Two of the most important keys that are created by registration of an OLE
server are a ProgID key and a CLSID key. The ProgID is created immediately
beneath the HKEY_CLASSES_ROOT predefined key and consists of the
ProjectName.ClassName for a Visual Basic OLE server. The single key created
beneath this ProgID key is named CLSID; its value is a 64-bit number that
is used by OLE to uniquely identify the particular object. In addition to
the ProgID and file extension keys off of HKEY_CLASSES_ROOT, there is also
a key just named CLSID. Expanding this key will show subkeys for each CLSID
that is registered on the machine. There will be a key with the same 64-bit
number associated with the ProgID in this section. Keys underneath this
individual CLSID hold information that OLE uses to access the server.
HKEY_CLASSES_ROOT\ProjectName.ClassNameand HKEY_CLASSES_ROOT\CLSID\<CLSID for 32-bit server> Where LocalServer32 points to the 32-bit executable. If a client requests an object of ProjectName.ClassName, the 32-bit EXE will be started and used to provided the object. Now suppose a 16-bit server is now registered with the same ProgID of ClassName.ProjectName. The registry will contain these relevant entries (where the ones marked with asterisks are new or modified): HKEY_CLASSES_ROOT\ProjectName.ClassNameand *HKEY_CLASSES_ROOT\CLSID\<CLSID for 16-bit server> HKEY_CLASSES_ROOT\CLSID\<CLSID for 32-bit server> If a client now requests an object of ProjectName.ClassName, OLE will look up the ProgID and use the value of the CLSID beneath the ProgID to determine what object to create. This value is now the CLSID for the 16- bit server, so the server that will be started to provide the object will be the EXE pointed to by the LocalServer key of the new CLSID that was added by the registration of the 16-bit server. Furthermore, if the 16-bit server is now unregistered, not only will the newly added CLSID keys be removed, but the ProgID key will be removed also. At this point the 32-bit server will be unable to provide objects, despite the fact that it has not been unregistered. Because the ProgID key is gone, the CLSID keys that the 32-bit server added are orphaned and OLE has no way to access them. Reregistering the 32-bit server will add the correct ProgID and enable the 32-bit server to again provide objects. Steps to Reproduce
RESOLUTION
If development of both 16-bit and 32-bit servers is done on the same
machine, this problem can be avoided by specifying a compatible server for
your OLE server project. If a compatible server exists, the CLSID from the
compatible server will be used when any new executable is created. In the
above scenario, this means that only one key CLSID will be used for the
server. Instead of one CLSID possessing a LocalServer key and another
containing a LocalServer32 key, both LocalServer and LocalServer32 keys
will exist beneath the same CLSID. When more than one server is listed
beneath a CLSID, OLE has a predefined order that is used to determine which
server is used to provide the object.
Additional query words: kbVBp400 kbdss kbVBp kbDSupport kbRegistry
Keywords : kbGrpVB |
Last Reviewed: January 5, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |