Microsoft KB Archive/247723

= BUG: VBCE Control Manager Only Recognizes First Control in DLL =

Article ID: 247723

Article Last Modified on 8/19/2005

-

APPLIES TO

 Microsoft Windows CE Toolkit for Visual Basic 6.0 Microsoft Windows CE Toolkit for Visual C++ 6.0, when used with:  Microsoft Windows CE 2.0 for the Handheld PC

 Microsoft Windows CE 2.11 for the Handheld PC

 Microsoft Windows CE 2.11 for the Handheld PC </li></ul>

-

<div class="notice_section">

This article was previously published under Q247723

<div class="symptoms_section">

SYMPTOMS
Because the Windows CE Toolkit for Visual Basic (VBCE) does not support control creation, it is common to create ActiveX controls with the Windows CE Toolkit for Visual C++ (VCCE) and host them on VBCE forms.

When a VCCE DLL contains multiple ActiveX controls or property pages and is registered using the Control Manager so that you can host the controls on VBCE forms, the controls are added to the Visual Basic toolbox, but only the first control can be added to the form.

The problem only occurs on the Handheld PC Pro and Palm-size PC platforms.

<div class="cause_section">

CAUSE
The problem is caused by a bug in the Control Manager, which only recognizes the GUID of the first control in the VCCE DLL.

<div class="resolution_section">

RESOLUTION
The workaround is to have one ActiveX control per DLL. If the control needs to have property pages, make sure that the GUID for the control itself is listed first in the IDL file instead of the property pages.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

MORE INFORMATION
This article is based on the assumption that you are already familiar with creating ActiveX controls for Microsoft Windows CE in VCCE and that such controls have already been created. To learn more about the topic, please check the white paper listed in the "References" section of this article.

Steps to Reproduce Behavior

 * 1) Launch Microsoft Visual Basic and create a new Windows CE HPC/Pro or PsPC project. Form1 is created by default.
 * 2) From the Windows CE menu, choose Control Manager.
 * 3) Expand Palm-size PC 2.11 or H/PC Pro 2.11 in the left pane.
 * 4) Select the Desktop Design Controls option for the desired platform.
 * 5) From the Control menu, choose Add New Control, and then browse to the VCCE DLL that contains multiple ActiveX controls. Now the VCCE DLL is registered in the desktop design environment and you should be able to host the control on VBCE forms.
 * 6) From the Project menu, choose Components, and then check the VCCE DLL from the list. Now the controls in that DLL appear in the Toolbox.
 * 7) Add each of the controls in the DLL to Form1. Note only the first control appears on the form.

<div class="references_section">