FaxMan Jr


The FaxFinder control is a great help for those times where you need to determine what types of faxmodems are attached to a computer system. FaxFinder is a simple control that interrogates a system’s comm ports and creates a collection of available devices. Your application can then go through the device collection returned from FaxFinder and select one of the devices directly or present a choice to your users.


FaxFinder has two properties:


DeviceCount – the number of faxmodems found connected to this machine. Note that the first time this property is accessed, FaxFinder takes several seconds to search for fax devices and stores the device descriptions. Subsequent accesses simply refer to this stored information.


Item – a collection of DeviceDesc objects. Each DeviceDesc object has the following properties:


Port – port number that this faxmodem is connected to

bClass1 – True if this faxmodem supports Class 1 instructions

bClass2 – True if this faxmodem supports Class 2 instructions

bClass20 – True if this faxmodem supports Class 2.0 instructions

bClass21 - True if this faxmodem supports Class 2.1 instructions



The code sample below illustrates how to use the FaxFinder. This example is a simple subroutine which fills a text control with a list of comm ports with installed faxmodems and the fax capabilities each supports:


Private Sub Command1_Click()

Dim i As Integer

Dim desc As DeviceDesc


For i = 1 To FaxFinder1.DeviceCount

 Set desc = FaxFinder1(i - 1) ‘This is a zero-based enumeration

 Text1.SelText = "Port " & Str(desc.Port) & vbCrLf

 Text1.SelText = "Supports: "

 If desc.bClass1 Then Text1.SelText = "Class 1 "

 If desc.bClass2 Then Text1.SelText = "Class 2 "

 If desc.bClass20 Then Text1.SelText = "Class 2.0 "

 Text1.SelText = vbCrLf & vbCrLf

Next i

End Sub


The following screen shows the results of running this subroutine:





© 2014 Data Techniques, Inc. All Rights Reserved.

Send comments on this topic.