Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Display the dialog to configure a port
[ All Languages » VB »  Windows]

Total Hit ( 2895)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


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

' display the dialog for serial port configuration
If ConfigurePort(vbNullString, 0&, "COM1:") = Then
  MsgBox "Unable to display the system dialog", vbCritical
End If

' display the dialog for parallel port configuration
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 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.