PRB: Invalid Handle Message Using Static Version of CTL3DID: Q111752
|
The Microsoft Developer Network (MSDN) CD provides a tool, CTL3D, that can be used with applications to give Windows controls a three-dimensional (3- D) look. The tool is provided as a dynamic-link library (DLL) (CTL3D.DLL) and as a static library (CTL3DS.LIB). When using the static library with an Microsoft Foundation Class (MFC) application, the controls do not appear as 3-D and the following debug error messages appear when the Ctl3dRegister() function is called:
err CTLTST 0117:0138: Invalid HANDLE: 0000 err CTLTST 0117:0197: Invalid global handle: 0000
The problem occurs when the .RC file does not include CTL3D.H. The include file, CTL3D.H, is needed to associate a resource ID with the 3-D bitmaps. When using the static version of CTL3D, the .RC file includes 3DCHECK.BMP, which is a bitmap used for the 3-D effects. For example,
CTL3D_3DCHECK BITMAP DISCARDABLE "3DCHECK.BMP"
In CTL3D.H, the resource ID CTL3D_3DCHECK is associated with a number as
shown below:
/* Resource ID for 3dcheck.bmp (for .lib version of ctl3d) */
#define CTL3D_3DCHECK 26567
The association is needed if the library is to successfully load
3DCHECK.BMP. If the CTL3D.H header file is not included in the resource
file, the necessary association is not made. The bitmap is assigned the
string name "CTL3D_3DCHECK" instead of the expected resource number, and
the CTL3D library fails to load the bitmap.
The problem can be corrected by including CTL3D.H in the .RC file. To
include CTL3D.H, open App Studio and choose Set Includes from the File
menu. To the Read-Only Symbol Directives box, add the following text:
#include <ctl3d.h>
Below are the steps necessary to link to the static version of CTL3D,
CTL3DS.LIB:
#include <ctl3d.h>
CTL3D_3DCHECK BITMAP MOVEABLE PRE "3DCHECK.BMP"
Additional query words: 1.00 1.50 2.00 2.50 ctrl3d ctl3ds listbox
Keywords : kb16bitonly
Version :
Platform :
Issue type :
Last Reviewed: July 28, 1999