DOC: VBCE Error: "The Declare statement is incorrectly formatted" (207564)



The information in this article applies to:

  • Microsoft Windows CE Toolkit for Visual Basic 6.0

This article was previously published under Q207564

SUMMARY

When compiling a Windows CE Toolkit for Visual Basic (VBCE) application which includes a Declare statement, the following error message may appear:
The Declare statement is incorrectly formatted. Please see the documentation for more information on the format of a Declare statement.

MORE INFORMATION

The Winceapi.txt file incorrectly includes some Declare statements that include parameters declared as "Any". This is not supported in Windows CE. By changing the declaration of the parameters to another data type, such as Long, the error will be avoided.

For example, the following Declare statement needs to be changed:
Declare Function SendMessage Lib "Coredll" Alias "SendMessageW" ( _
   ByVal hwnd As Long, _
   ByVal wMsg As Long, _
   ByVal wParam As Long, _
   lParam As Any) As Long
				
The statement can be changed to the following:

Declare Function SendMessage Lib "Coredll" Alias "SendMessageW" ( _
    ByVal hwnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    ByVal lParam As Long) As Long
				

Modification Type:MinorLast Reviewed:8/19/2005
Keywords:kbBug kbdocfix kbpending kbToolkit KB207564