|
|
|
The ConfigurePort API function lets you programmatically bring up the system dialog box for configuring a COM or LPT port. The function returns a non-zero value if successful (that is, the dialog appears). Here is the Declare of this function, and an example of its usage: |
Click here to copy the following block | Private Declare Function ConfigurePort Lib "winspool.drv" Alias _ "ConfigurePortA" (ByVal pName As String, ByVal hWnd As Long, _ ByVal pPortName As String) As Long
If ConfigurePort(vbNullString, 0&, "COM1:") = Then MsgBox "Unable to display the system dialog", vbCritical End If
If ConfigurePort(vbNullString, 0&, "LPT1:") = Then MsgBox "Unable to display the system dialog", vbCritical End If |
Remember to always add a trailing colon when specifying the port name. Note that specifying a particular port (such as "COM2") doesn't make any difference, because the same dialog is displayed in all cases.
|
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|