Microsoft KB Archive/96760

= PRB: Gray Box Appears Using SDK Custom Control in App Studio =

Article ID: 96760

Article Last Modified on 12/11/2003

-

APPLIES TO

 The App Studio, when used with:  Microsoft Visual C++ 1.0 Professional Edition

 Microsoft Visual C++ 1.5 Professional Edition

 Microsoft Visual C++ 1.51

 Microsoft Visual C++ 1.52 Professional Edition</li></ul>

 Microsoft Visual C++ 1.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.0 Professional Edition</li></ul>

 Microsoft Visual C++ 2.1</li></ul>

 Microsoft Visual C++ 4.0 Standard Edition</li></ul>

 Microsoft Visual C++ 5.0 Standard Edition</li></ul>

 Microsoft Visual C++ 6.0 Service Pack 5</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q96760

<div class="symptoms_section">

SYMPTOMS
In the App Studio, or Developer Studio, an attempt to install a &quot;User- Defined&quot; control fails and a gray box appears instead of the visual representation of the control.

<div class="cause_section">

CAUSE
The App Studio dialog editor supports the following procedures for &quot;User-Defined&quot; controls:


 * Specify a location for the control in the dialog box
 * Specify a caption for the control
 * Specify the window class for the control
 * Specify a 32-bit hexadecimal value for the control style

These procedures are described in the &quot;Working with User-Defined Controls&quot; section in the &quot;Using the Dialog Editor&quot; chapter of both the Visual C++ version 1.0 &quot;App Studio User's Guide&quot; and the Visual C++, 32-bit Edition, versions 2.x and 4.0, Books Online.

<div class="resolution_section">

RESOLUTION
Even though the dialog editor does not display a visual representation of the user-defined control, you can change the size and position of the gray box to reflect the desired placement of the control within the dialog box.

<div class="moreinformation_section">

MORE INFORMATION
Visual C++ for Windows (16-bit) supports installing and design-time testing for VBX version 1.0 controls. For 32-bit systems, OLE Controls (OCX) is the preferred custom control architecture. Building and using OLE Controls is fully supported in Visual C++ versions 2.0 and above. See MFC Technical Note 27 included with these versions of Visual C++ for more information.

Versions 3.0 and later of the Microsoft Windows Software Development Kit (SDK) define an dynamic-link library (DLL) interface for custom controls. The Dialog Editor provided with the Windows SDK supports installing custom controls and testing their functions. Section 20.2.5 of the Windows SDK &quot;Guide to Programming&quot; manual for version 3.1 documents this interface.

Typically, a user-defined control implemented as a DLL registers a WNDCLASS structure in its LibMain procedure. Once a user-defined control is installed into a dialog box in App Studio, double click on the gray box to change the properties of the control and enter the window class and any style information.

Keywords: kbprb KB96760

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.