Fantom Laboratory Ltd.

 

 

 


Hylafx.dll

 

 

Examples

Visual FoxPro

 

Download Example

Vfp.zip 3 KB

(test.prg, test.frt, test.frx, test.dbf)

* set current printer HP LaserJet 4/4M PS *

SET PRINTER TO name 'HP LaserJet 4/4M PS'

* print report test.frx to file faxtmp.ps *

REPORT FORM test.frx NOEJECT NOCONSOLE TO FILE faxtmp.ps

* set current printer to default *

SET PRINTER TO DEFAULT

* set parameters *

HylaFAXServerIp = '192.168.1.10'

User = 'fax'

Password = ''

FaxPhoneNumber = '555-77-99'

MailAddress = 'fax@company.com'

Info = 'Test Info'

* declare Function sendfax from hylafx.dll *

DECLARE INTEGER sendfax IN hylafx STRING @HylaFAXServerIp, STRING @User, STRING @Password, STRING @FaxPhoneNumber, STRING @MailAddress, STRING @Info

* call Function sendfax *

? sendfax(@HylaFAXServerIp, @User, @Password, @FaxPhoneNumber, @MailAddress, @Info)

* if need, free memory *

CLEAR DLLS

 

Visual Basic

 

Download Example

 

Test.zip 12 KB

(test.doc)

Declare Function SendFax Lib "hylafx.dll" Alias "sendfax" (ByVal ipaddr As String, ByVal user As String, ByVal pass As String, ByVal num As String, ByVal mail As String, ByVal info As String) As Integer

 

Sub fax()

Application.ActivePrinter = "HP LaserJet 4/4M PS"

ThisDocument.PrintOut True, , , "faxtmp.ps", , , , , , , True

 

Dim Message, Title

Message = "Enter a phone number"   ' Set prompt.

Title = "Phone Input"   ' Set title.

Dim ret As String

 

ret = InputBox(Message, Title)

 

Dim ipaddr As String

ipaddr = "192.168.1.10"

Dim user As String

user = "fax"

Dim pass As String

pass = ""

Dim num As String

num = ret

Dim mail As String

mail = "user@company.com"

Dim info As String

info = "test message"

 

Dim Error As Integer

 

Error = SendFax(ipaddr, user, pass, num, mail, info)

 

If Error = 0 Then

MsgBox "Send ok"

Else

MsgBox Error

End If

 

End Sub

C

 

 

Download hylafx.lib

 

#include <stdio.h>

#include <windows.h>

#include <winbase.h>

 

int main(void)

{

LPCTSTR lpLibFileName = "hylafx.dll";

LPCSTR lpProcName = "sendfax";

HINSTANCE hLib;

typedef int (far pascal aprocSendFax)(char *HylaFAXServerIp, char *User, char *Password, char *FaxPhoneNumber, char *MailAddress, char *Info);

aprocSendFax far *procSendFax;

int iRezult;

//These are parameters of function, change them.

char *HylaFAXServerIp = "192.168.1.10";

char *User = "fax";

char *Password = "";

char *FaxPhoneNumber = "5557799";

char *MailAddress = "fax-user@you-company.com";

char *Info = "Test";

 

hLib = LoadLibrary(lpLibFileName);

if(!hLib)

{

            printf("Error load DLL %d\n", GetLastError());

}

 

procSendFax = (aprocSendFax far *)GetProcAddress(hLib, lpProcName);

if(!procSendFax)

{

            printf("Error load function sendfax %d\n", GetLastError());

}

 

iRezult = procSendFax(HylaFAXServerIp,

                                     User,

                                     Password,

                                     FaxPhoneNumber,

                                     MailAddress,

                                     Info);

 

printf("Error sendfax (0 - Ok!):  %i\n", iRezult);

return 0;

}

OR

Link with hylafx.lib

And

#include <stdio.h>

#include <windows.h>

 

int far pascal sendfax(   char *HylaFAXServerIp,

                                   char *User, char *Password,

                                   char *FaxPhoneNumber,

                                   char *MailAddress,

                                   char *Info);

 

int main(void)

{

char *HylaFAXServerIp = "192.168.1.10";

char *User = "fax";

char *Password = "";

char *FaxPhoneNumber = "5557799";

char *MailAddress = "fax-user@you-company.com";

char *Info = "Test";

int iRezult;

 

iRezult = sendfax(HylaFAXServerIp,

                          User,

                          Password,

                          FaxPhoneNumber,

                          MailAddress,

                          Info);

 

printf("Error sendfax (0 - Ok!):  %i\n", iRezult);

return 0;

}

 

Back...

Support: send e-mail

Copyright © 2006 Fantom Laboratory Ltd. All rights reserved.

Get a VISA