The information in this article applies to:
SUMMARYThis article describes how to pass NULL as a parameter to any Windows API function that requires a pointer to a string from a Visual Basic 4.0 or higher application. MORE INFORMATION
Many Windows APIs have pointers to strings (for example, LPSTR or LPCSTR)
in their parameter lists. The documentation often indicates that special
processing occurs if a NULL is passed (instead of a pointer to a string).
With earlier versions of Visual Basic, you could accomplish this by using
0& for the parameter. However, Visual Basic versions 4.0 and higher include
a special constant, vbNullString, that you can use when you need to pass
NULL to a Windows API.
If NULL is passed as the second parameter, FindWindow locates any window of the specified class name. In a C or C++ program, the call might look like this:
If you make the same call from Visual Basic, it looks like this:
Note that using vbNullString is equivalent to passing NULL as the parameter. This is not the same as passing an empty string (""). REFERENCESVisual Basic Help file, versions 4.0, 5.0; Topic: "Declare Statement" Additional query words: kbdsi kbDSupport kbVBp kbVBp400 kbVBp500 kbVBp600 kbAPI
Keywords : |
Last Reviewed: June 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |