WINAPI.TXT Corrections for VB Professional Toolkit and Add-on

ID Number: Q74526

1.00

WINDOWS

buglist1.00 docerr

Summary:

The following corrections apply to the WINAPI.TXT file provided on

disk with the following products:

- WINAPI.TXT file dated 5/14/91, shipped with "Microsoft Windows

Programmer's Reference" and Online Resource, add-on kit number

1-55615-413-5, for Microsoft Visual Basic.

- WINAPI.TXT file dated 2/24/92, shipped with Microsoft Professional

Toolkit for Visual Basic version 1.0.

This information applies to Microsoft Visual Basic programming system

version 1.0 for Windows.

More Information:

The following corrections apply to the WINAPI.TXT file dated 5/14/91

or 2/24/92:

- The following statement is incorrect

Declare Function SetCommState Lib "User" ()

and should be changed to read as follows:

Declare Function SetCommState Lib "User" (lpDCB as DCB) As Integer

- The following statement is incorrect

GetDC Lib "GDI" (ByVal hWnd As Integer) As Integer

and should be changed to read as follows:

GetDC Lib "USER" (ByVal hWnd As Integer) As Integer

In other words, the function GetDC is in the Windows "USER"

DLL library, not in the "GDI" DLL library.

- The following statement is incorrect

Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String,

nCmdShow As Integer) As Integer

and should be changed to read as follows:

Declare Function WinExec Lib "Kernel" (ByVal lpCmdLine As String,

ByVal nCmdShow As Integer) As Integer

(The Declare statement for WinExec is missing the ByVal attribute in

the second parameter. Without this ByVal, invoking WinExec can cause

a Windows Unrecoverable Application Error [UAE].)

- The following separate Declare statements in WINAPI.TXT are

incorrect

Declare Function DrawIcon Lib "GDI" ...

Declare Function DrawText Lib "GDI" ...

Declare Function GetWindowDC Lib "GDI" ...

Declare Function SelectPalette Lib "GDI" ...

Declare Function RealizePalette Lib "GDI" ...

Declare Function ReleaseDC Lib "GDI" ...

and should be changed to "USER" instead of "GDI," as shown:

Declare Function DrawIcon Lib "USER" ...

Declare Function DrawText Lib "USER" ...

Declare Function GetWindowDC Lib "USER" ...

Declare Function SelectPalette Lib "USER" ...

Declare Function RealizePalette Lib "USER" ...

Declare Function ReleaseDC Lib "USER" ...

(These functions are correctly declared in the APIXREF.HLP file.)

- The following declaration is incorrect:

Declare Function ExitWindows Lib "User" (ByVal dwReserved As Long,

wReturnCode) As Integer

and should be changed to the following:

Declare Function ExitWindows Lib "User" (ByVal dwReserved As Long,

ByVal wReturnCode As Integer) As Integer

(For the second parameter, Windows is expecting to get an actual

integer value rather than an address of an integer.)

- The following statement is incorrect:

Declare Function FindWindow Lib "User" (lpClassName As Any,

lpWindowName As Any) As Integer

and should be changed to the following (ByVal is added to each

parameter):

Declare Function FindWindow Lib "User" (ByVal lpClassName As Any,

ByVal lpWindowName As Any) As Integer

- The following statements are incorrect:

Global Const EM_GETMODIFY = WM_USER+7

Global Const EM_SETMODIFY = WM_USER+8

Global Const EM_GETLINECOUNT = WM_USER+9

Global Const EM_LINEINDEX = WM_USER+10

and should be changed to the following, respectively:

Global Const EM_GETMODIFY = WM_USER+8

Global Const EM_SETMODIFY = WM_USER+9

Global Const EM_GETLINECOUNT = WM_USER+10

Global Const EM_LINEINDEX = WM_USER+11

(Note that no WM_USER+7 message exists.)

For more information on WINAPI.TXT, query on the following words in

the Microsoft Knowledge Base:

WINAPI.TXT and Visual and Basic

Additional reference words: 1.00