FaxMan Jr

Quick Start Tutorial


This quick-start tutorial will show you how to quickly add the FaxMan Jr. fax control to your application and begin sending faxes. It should give you enough information to get started...if you have a problem you can always refer to the more extensive tutorial that follows.


We assume that you’re working with Visual Basic. If you’re not, you should have very little trouble translating this tutorial to your development environment.


Step 1: Create a new VB project.

Create a new VB project with a form that you can drop the FaxMan Jr. control onto.


Step 2: Add the FaxMan Jr. controls to your application.

The next thing you need to do, of course, is to add the FaxMan Jr. controls to your control palette so you can then add the FaxMan Jr. control to your form. The illustration below shows the two controls added to your toolbar.





Step 3: Add the FaxMan Jr. control to your form.

Add a new FaxMan Jr. control to your form. It should automatically be named FaxManJr1 – if not, change the name to FaxManJr1.




Step 4: Fill out your form.

Add the rest of the controls you’ll need for this quick tutorial: a label control to display returned status values (named Label1), an edit control to display messages returned from FaxMan Jr. (named Text1) and a button to start the whole process (named Command1).



Be sure to setup the text control so that it has a vertical scrollbar and is multi-line.


Step 5: Add sending code to the Send! button.

Double click on the Send button and add the following code:


Private Sub Command1_Click()


'use the number of your comm port here 

FaxManJr1.Port = 1 


'be sure to specify the complete path to 

'the file to send 

FaxManJr1.FaxFiles = "c:\FaxMan\server\FaxMan.fmf" 


'put your own phone number in here 

FaxManJr1.FaxNumber = "555-5555" 




End Sub


Be sure to alter the port number, file path, and FaxNumber to be valid values for your machine!


Your little sample app can now send a fax. The next step is to learn how to keep track of what your FaxMan Jr. control is doing.


Step 6: Add status reporting.

Double click on the FaxMan Jr. control. Add the following code to the Status event:


Private Sub FaxManJr1_Status(ByVal pStatObj As FaxmanJrCtl.IfaxStatusObj)

Label1.Caption = pStatObj.CurrentStatusDesc

End Sub


Your application will now report on FaxMan Jr.’s status throughout the faxing procedure.


Note that there are several other status messages that FaxMan Jr. sends to your application – these are all defined in the reference for the Status event.


Step 7: Seeing what FaxMan Jr. is doing.

Ok, this is the fun part. FaxMan Jr. actually sends your application the strings sent to and received from the faxmodem. By simply placing a little bit of code in the Message event, your application can display this data.


To see how, just double-click on the FaxMan Jr. control and select the Message event. Then add the following code to it:


Private Sub FaxManJr1_Message(ByVal bsMsg As String, ByVal bNewLine As Integer)

Text1.SelText = bsMsg 

If bNewLine Then Text1.SelText = vbCrLf 

End Sub


If you’ve setup your textbox control properly, you should see something like this (this screenshot was taken while the fax was in-progress, so it still shows the "Waiting for connection" string):




Note that all of the strings FaxMan Jr. sends to the faxmodem are prefixed with "à", whereas all of the data returned from the faxmodem and read by FaxMan Jr. are prefixed with "ß".


That’s Easy! What’s Next?

Ok, now that you see how easy it is to use FaxMan Jr. to send a fax, you can either just start playing with it and rely on the reference section to help with the properties, methods, and events, or you can go ahead and tackle the in-depth tutorial presented in the next section.



© 2014 Data Techniques, Inc. All Rights Reserved.

Send comments on this topic.