The information in this article applies to:
SUMMARYOpenComm() is a function that can be called using FOXTOOLS.FLL to open the COM or LPT ports. Below is a complete description of OpenComm(). MORE INFORMATIONPurposeThe OpenComm() function opens a communications device.Function Syntax
ReturnsThe return value identifies the open device if the function is successful. Otherwise, it is less than zero.ErrorsIf the function fails, it may return one of the following error values:
If this function is called with both queue sizes set to zero, the
return value is -2 if the device is already open, or -4 if the device
is not open.
CommentsWindows allows COM ports 1 through 9 and LPT ports 1 through 3. If the device driver does not support a communications port number, the OpenComm() function will fail.Sample CodeThe following code example uses the OpenComm() function and FOXTOOLS.FLL to open COM1. (This example can be found in FOXPROW\GOODIES\FOXTOOLS\DIALER.PRG.)
NOTE: In reference to the applicability of the OpenComm() function to
Visual FoxPro for Windows, the 32-bit Foxtools.fll returns a handle to the
RegFN() call provided that it passes the optional 4th argument, which is
"USER.DLL." Here is an example:
REFERENCESThe above information can also be found in the Microsoft Windows Software Development Kit (SDK) "Programmer's Reference Volume 2: Functions" [describes OpenComm()] and the "Programmer's Reference Volume 3: Messages, Structures, and Macros" (describes the returned values). The online Help file for the Professional Version of Visual C++ also contains this information. Additional query words: FoxWin 2.50
Keywords : kbcode FxprgFoxtools |
Last Reviewed: August 10, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |