FIX: Windows side-by-side execution is not supported for Visual Basic 6.0 ActiveX controls (828629)



The information in this article applies to:

  • Microsoft Visual Basic Enterprise Edition for Windows 6.0 SP5
  • Microsoft Visual Basic Learning Edition for Windows 6.0 SP5
  • Microsoft Visual Basic Professional Edition for Windows 6.0 SP5
  • Microsoft Windows XP Professional SP1
  • Microsoft Windows XP Professional SP1a

SYMPTOMS

With Microsoft Windows XP and later versions, you can run Microsoft Component Object Model (COM) DLL modules in side-by-side (SxS) mode. With SxS, different versions of a COM DLL to co-exist in the same computer environment without conflict. This behavior occurs by using .manifest files that specify how a program may bind to a particular COM DLL. Microsoft Visual Basic 6.0 ActiveX controls are essentially COM DLL modules with .ocx file name extensions. If you try to configure these modules for SxS operation in Windows XP, you receive the following error message:

Runtime Error '336' Component not correctly registered.

CAUSE

This problem occurs because both the Windows and Visual Basic runtimes do not support configuring SxS execution of Visual Basic 6.0 ActiveX controls.

RESOLUTION

To fully resolve this problem you must have both of the following:
  • The version of the Visual Basic runtime that is included with Visual Basic 6 Service Pack 6 (SP6)
  • Windows XP Service Pack 2 (SP2)
For additional information about how to obtain the latest Visual Basic runtime, click the following article number to view the article in the Microsoft Knowledge Base:

290887 VBRun60sp6.exe installs Visual Basic 6.0 SP6 run-time files

To obtain Windows XP SP2, visit the following Microsoft Knowledge Base Web site:If you cannot install Windows XP SP2, you can obtain the Windows XP fix as a hotfix. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

843524 FIX: Side-by-side COM DLL module manifest for Visual Basic 6.0 ActiveX Controls is overridden by the registry in Windows XP

MORE INFORMATION

To enable this fix, you must add fields to the .manifest files. The following is a sample .manifest file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
	<assemblyIdentity type="win32" name="control.ocx" version="1.0.0.0" processorArchitecture="x86"/>
	<file name="control.ocx">
		<comClass description="Sub control" clsid="{76548630-0CC8-48E4-B471-A9001865AE65}" 
			miscStatus="recomposeonresize,cantlinkinside,insideout,activatewhenvisible,setclientsitefirst"
			progid="Control.TextBox" threadingModel="Apartment"
			tlbid="{8A1ADF05-8164-4D5B-9267-FA74E601D826}"/>
		<typelib tlbid="{8A1ADF05-8164-4D5B-9267-FA74E601D826}" version="1.0" helpdir=""/>
	</file>
</assembly>
Notice that the miscStatus attribute has been added. Now five new attributes are available on the assembly element or on the comClass element to represent the various DVASPECT values that are available:
AttributeNote
miscStatusThe default status flags that are obtained when you pass 0 for the dwAspect argument to the OleRegGetMiscStatus API
miscStatusIconMaps to DVASPECT_ICON
miscStatusThumbnailMaps to DVASPECT_THUMBNAIL
miscStatusDocPrintMaps to DVASPECT_CONTENT
miscStatusContentMaps to DVASPECT_CONTENT
For each aspect, the following set of flags can be specified as a comma-separated list. Do not use SPACE characters (" ") but the flags can be mixed-case. These elements are taken from the OLEMISC flag enumeration.
Recomposeonresize Onlyiconic Insertnotreplace
StaticCantlinkinsideCanlinkbyole1
IslinkobjectInsideoutActivatewhenvisible
RenderingisdeviceindependentInvisibleatruntimeAlwaysrun
ActslikebuttonActslikelabelNouiactivate
AlignableSimpleframeSetclientsitefirst
ImemodeIgnoreactivatewhenvisibleWantstomenumerge
Supportsmultilevelundo
Notice that you must also use the tlbid attribute in the assembly element or in the comClass element to indicate what type library the COM class comes from for the runtime to resolve it correctly.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

Modification Type:MinorLast Reviewed:10/25/2005
Keywords:kbHotfixServer kbQFE kbQFE kbWinXPpreSP2fix kbfix kbBug KB828629 kbAudDeveloper