Introduction

The LEADTOOLS FTP/HTTP features are only available in the LEADTOOLS Internet Pro toolkits. These features let you add the following capabilities to your application:

  • interact with web servers without requiring the use of a Web Browser.

  • programmatically send and receive files.

LEADTOOLS FTP/HTTP COM includes the following COM Objects developed by LEAD Technologies, Inc.:

  • LEAD Raster FTP Object is a COM Object used for programmatically sending and receiving files.

  • LEAD Raster HTTP Object is a COM Object for interacting with web servers.

LEADTOOLS FTP/HTTP COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

You can use the LEADTOOLS FTP/HTTP features in any programming environment that supports OLE custom controls, including the following:

Visual C++ 5.0 and later (32-bit)
Visual Basic 5.0 and later (32-bit)

Summary of All Supported Image File Formats

Registering the Internet COM Objects


Registering the Internet COM Objects

Registering the FTP/HTTP COM Objects

Registering COM Objects

Before COM objects can be used, it must be registered. The installation program automatically registers all the LEADTOOLS objects. If you would like to manually register the objects run:

REGSVR32.EXE for 32-bit objects

found in the BIN directory and pass the name of the objects to register as a parameter.

EX.:

REGSVR32 LTR14N.DLL will register the LEAD Main Raster Object.

REGSVR32 LTRIO14N.DLL will register the LEAD Raster IO Object.

REGSVR32 LTRFT14N.DLL will register the LEAD Raster FTP Object.

REGSVR32 LTRHT14N.DLL will register the LEAD Raster HTTP Object.

Unregistering COM Objects

To unregister COM objects, include the "/u" switch before the object name when running:

REGSVR32.EXE for 32-bit objects

EX.:

REGSVR32 /u LTR14N.DLL will unregister the LEAD Main Raster Object.

REGSVR32 /u LTRIO14N.DLL will unregister the LEAD Raster IO Object.

REGSVR32 /u LTRFT14N.DLL will unregister the LEAD Raster FTP Object.

REGSVR32 /u LTRHT14N.DLL will unregister the LEAD Raster HTTP Object.

For a list of required DLLs for the FTP/HTTP COM Objects, refer to Files To Be Included With Your Application.


Version History

Current version: | 14.5
Last update: | October 20, 2005

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Changes from Version 12.1 to Version 13

Version 12.1


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS FTP/HTTP COM has not changed from Version 14.


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS FTP/HTTP COM has been updated to work better in scripting languages. Methods that used to take pointer parameters have been changed to use the new ILEADRasterVariant object.

LEADTOOLS FTP/HTTP COM now supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

The rest of this topic lists the new property in version 14.

StopFtpBrowseEvent property


Changes from Version 12.1 to Version 13

Version 13 of the LEADTOOLS FTP/HTTP COM has not changed from Version 12.1.


Version 12.1

Version 12.1 is the first version of LEADTOOLS FTP/HTTP COM Objects.

EnableMethodErrors property

FtpBrowse event

InetFtpBrowseDir method

InetFtpChangeDir method

InetFtpConnect method

InetFtpCreateDir method

InetFtpDeleteDir method

InetFtpDeleteFile method

InetFtpDisconnect method

InetFtpGetCurrentDir method

InetFtpGetFile method

InetFtpRenameFile method

InetFtpSendBitmap method

InetFtpSendFile method

InetHttpCloseRequest method

InetHttpConnect method

InetHttpDisconnect method

InetHttpFormValueCount property

InetHttpFormValues property

InetHttpGetResponse method

InetHttpGetServerStatus method

InetHttpOpenRequest method

InetHttpSendBitmap method

InetHttpSendData method

InetHttpSendForm method

InetHttpSendRequest method


Copyright notice

Copyright Notices

©Copyright LEAD Technologies, Inc. 1991-2005. ALL RIGHTS RESERVED

Portions of the PCDLIB32.DLL, PCDLIB.DLL, LFFPX7.DLL, LFKODAK.DLL, EKFPIXJPEG140.DLL, PDC_SDK.DLL, PROFIRE.DLL, DC120V154_32.DLL, LFDCR14N.DLL, DCSPROBACK.DLL, DCSPRO3SLR.DLL, LFDCS14N.DLL, and LFKDC14N.DLL files contain material that is ©Copyright Eastman Kodak Company, 1996-2001. This software is based in part on the work of the Independent JPEG Group.

Portions of the LFCRW14N.DLL, LTCMP14.DLL, CDSDK.reg, CDSDK.dll, CDRAPCLS.dll, czs_ui.dll, deimg.dll, deImg010.dll, deImg110.dll, deImg153.dll, deimg301.dll, deimg401.dll, deImg404.dll, deimg602.dll, Deimg603.dll, DeImgd60.dll, pscAdimg.dll, pscCllct.dll, pscCStUI.dll, pscDcd.dll, pscDevUI.dll, pscDvlp.dll, Pscl2STI.dll, pscll.dll, pscParse.dll, pscSetup.dll, psdkdll.dll, psdkReg.dll, psParse.dll. file contain material that is © Canon, Inc. 2002

Portions of the LFFPX7.DLL and LFKODAK.DLL files contain material that is ©Copyright Hewlett Packard, 1996.

Portions of the OCR/ICR/OMR Features and the help file for the OCR/ICR/OMR Features are ©Copyright Scansoft, Inc. 1995-2003. ALL RIGHTS RESERVED

Portions of the Barcode Modules contain material that is ©Copyright Axtel Inc., 1999.

Portions of the LEADTOOLS PDF Plug in and the LEADTOOLS Vector Imaging Pro are ©Copyright 1996, 2000 Artifex Software Inc. All rights reserved.

File filters for decoding MrSID ® and DjVu ® formats are provided under a license from Lizardtech, Inc.

The "FlashPix" format uses Microsoft's OLE structured storage.

Portions of the DICOM help files in Medical Imaging product line are reprinted with permission from the National Electrical Manufacturers Association ©Copyright 1998 by the National Electrical Manufacturers Association. All rights including translation into other languages, reserved under the Universal Copyright Convention, the Berne Convention or the Protection of Literacy and Artistic Works, and the International and Pan American Copyright Conventions.

Portions of LEADTOOLS Data Security Add On contain software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/), including cryptographic software written by Eric Young (eay@cryptsoft.com) and by Tim Hudson (tjh@cryptsoft.com). Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) All rights reserved. Copyright Tim Hudson 1995-1998 (tjh@cryptsoft.com) All rights reserved.

Portions of LEADTOOLS Data Security Add On contain software based on the MD5 Message Digest Algorithm developed by RSA Data Security, Inc.. Copyright (c) 1991-92 RSA Data Security, Inc. All Rights Reserved.

Portions hereof licensed under US patent 5,327,254 and foreign counterparts.

Portions of the LEADTOOLS ICC Profiles material is © Copyright 2004, International Color Consortium.

Trademarks

LEAD® and LEADTOOLS® are registered trademarks of LEAD Technologies, Inc.
Microsoft, Windows, Windows NT, Visual Basic, Visual FoxPro, and Microsoft Access are either trademarks or registered trademarks of the Microsoft Corporation.
OS/2® is a registered trademark of International Business Machines Corporation.

TextBridge®OCR is a registered trademark of Scansoft, Inc.

ISIS® is a registered trademark of Pixel Translations, Inc.

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

All other brand or product names used in this online help are trademarks of their respective holders.

Address and Contact Information

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

(704) 332-5532
FAX: (704) 372-8161
E-mail: support@leadtools.com
Technical support: (704) 372-9681 or support@leadtools.com
Home page: http://www.leadtools.com


Programming with FTP/HTTP COM Objects

The following topics provide a systematic approach to understanding and using the LEAD FTP and HTTP objects properties, methods, and events:

How to Program with the LEAD Raster FTP Object

How to Program with the LEAD Raster HTTP Object


How to Program with the LEAD Raster FTP Object

The LEAD Raster FTP Object allows a user to create a connection with an FTP server, transfer files and bitmaps, perform remote file operations, perform remote directory operations and browse remote directories for files. The following topics provide a systematic approach to understanding how to program with the LEADTOOLS FTP methods.

Connecting and Disconnecting to the FTP Server

The first step in working with a FTP server is to use InetFtpConnect to connect to the desired FTP server. A user can connect with a user name and password, or as an "anonymous" user. To disconnect from the FTP server use the InetFtpDisconnect method.

File Manipulation

The user can store files on the FTP server via InetFtpSendFile. To get a file from the FTP server and store it on the local system, use the InetFtpGetFile method. In addition, a remote file on the server can be renamed using InetFtpRenameFile. Finally, InetFtpDeleteFile can delete a remote file on the server.

Directory Manipulation

The user can create directories on the FTP server via InetFtpCreateDir. To delete a directory from an FTP server, use the InetFtpDeleteDir method. InetFtpChangeDir changes the working directory on the FTP server. Finally, InetFtpGetCurrentDir retrieves the current directory for the specified FTP session.

Directory Browsing (Search results)

Any directory can be browsed on the FTP server. In addition, a file search can also be performed. Both can be implemented by calling InetFtpBrowseDir. The search results can be obtained from the FTPBrowse event. This event is triggered for every file that matches the search criterion given to InetFtpBrowseDir.

Uploading a Bitmap to an FTP server

The LEADTOOLS FTP Object supports uploading a LEAD bitmap. Use the InetFtpSendBitmap method to manage asynchronous uploading of a bitmap.


How to Program with the LEAD Raster HTTP Object

The LEAD Raster HTTP Object allows a user to connect to Internet servers and issue requests. Its methods and properties allow you to interact with Internet servers without requiring the use of an Internet Browser.

The first step in working with an Internet server is to use InetHttpConnect to connect to the desired Internet server. After connecting with the Internet server, designate what page, cgi script, asp script, file, or executable will be the target of the request to the Internet server. Once the target has been decided, call InetHttpOpenRequest to open the request to the Internet server. No data can be sent to the Internet server without first calling InetHttpOpenRequest.

After a valid request has been opened, several actions can be taken. Simulate a user sending a form to the server with InetHttpSendForm. Send raw data using InetHttpSendData. Finally, send a bitmap with InetHttpSendBitmap. If it is not necessary to send any particular data, the InetHttpSendRequest method can be used to send the request.

Once the request has been sent to the Internet server, the status can be retrieved using InetHttpGetServerStatus. If the Internet server sent any data back in its response InetHttpGetResponse can be used to get the response data.

After the request is finished, call InetHttpCloseRequest to close the request. When no more requests are needed, call InetHttpDisconnect to disconnect from the Internet server.


FTP/HTTP Files To Be Included With Your Application

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation. The following subdirectory for the FTP/HTTP features is created:

REDIST\

Redistributable FTP/HTTP features files.

Note:

The FTP/HTTP features are provided for evaluation purposes only. You may not copy or redistribute any of the following files without obtaining the proper license. In some cases, the license is included with your initial purchase of LEADTOOLS. In other cases, you must obtain a license from a third party or enter into a royalty agreement with LEAD to obtain the proper license. For these special licensing situations, see the notes below accompanying the specific file.

The following table summarizes the files you must include on your distribution diskettes to support the LEADTOOLS FTP/HTTP features functions on a WIN32 system. (\REDIST\ subdirectory contains copies of these files.)

Please note that LTR is required for ALL COM applications. For more information on LTR and other files for the Main COM, refer to Files To Be Included With Your Application .

Redistributables: | Explanation: | If you are using a standard release without Unicode, the files to use are: | If you are using a standard release with Unicode, the files to use are: | If you are using an evaluation release without Unicode, the files to use are: | If you are using an evaluation release with Unicode, the files to use are:
LTRFT LTRHT | FTP/HTTP support. LTRFT is the LEADTOOLS FTP Object. LTRHT is the LEADTOOLS HTTP Object. Also requires LTRIO. | DLL: LTRFT14N.DLL LTRHT14N.DLL | DLL: LTRFT14NU.DLL LTRHT14NU.DLL | DLL: LTRFT14E.DLL LTRHT14E.DLL | DLL: LTRFT14EU.DLL LTRHT14EU.DLL


Installation Directory

The installation procedure creates a directory tree for the LEADTOOLS files, and adds the demonstration programs and online help to your desktop. You specify the root directory during installation.

Please note that due to the large size of the PDF files that contain the LEADTOOLS manuals, these files are no longer included in the setup. Instead, these PDF files can be downloaded from our website at http://support.leadtools.com/SupportPortal/DesktopDefault.aspx?tabindex=3&tabid=27.

The following is a list of the subdirectories in the root directory:

ACROBAT | LEADTOOLS manuals in the PDF format, which you can view and print using Adobe Acrobat. These files are optional and are available when installing from the CD-ROM.
BIN | Executable files for the demonstration programs.
HELP | Online help files.
IMAGES | Sample images and databases containing images.
EXAMPLES\DLL | One subdirectory for each example API program.
EXAMPLES\OCX | One subdirectory for each example ActiveX program.
EXAMPLES\COM | One subdirectory for each example COM program.
EXAMPLES\CLASSLIB | One subdirectory for each example Class Library program.
EXAMPLES\RES | Resource files for the example programs.
INCLUDE | Header files, BAS files, and the ActiveX's MFC interface files for versions of Visual C++ earlier than 4.0.
INCLUDE\CLASSLIB | Header files for the Class Library
LIB | Library files.
REDIST | Redistributable files. These are copies of the LEADTOOLS files and other files that you may need to distribute with your application. For exact information about required files, refer to Files To Be Included With Your Application.


System Files Updated

The LEADTOOLS installation procedure adds the DLL files and all of the required driver files to your WINDOWS\SYSTEM directory. For a list of these files, refer to Files To Be Included With Your Application.

In addition, the installation procedure, as noted in the remainder of this topic, updates Windows system files that are required by the LEADTOOLS example programs.

The LEADTOOLS WIN32 installation procedure adds the following Windows files to your WINDOWS\SYSTEM directory. If your system has an earlier version of any of these files, the installation procedure overwrites it with the newer version.

COMDLG32.OCX
CTL3D32.DLL
MFC40.DLL
MFC42.DLL
MSVCRT20.DLL
MSVCRT40.DLL
MSVCRT.DLL
OC30.DLL
OLE32.DLL
OLEAUT32.DLL
OLEPRO32.DLL
STDOLE2.TLB
VB40032.DLL
VEN2232.OLB


FTP/HTTP Features Properties, methods, and events

Working with HTTP

HTTP Connections

Sending Data Over an HTTP Connection

Working with FTP

FTP Connections

File Manipulation and Sending Bitmaps Over an FTP Connection

Directory Manipulation Over an FTP Connection


FTP Functions:File Manipulation and Sending Bitmaps Over an FTP Connection

Working with FTP:
File Manipulation and Sending Bitmaps Over an FTP Connection

InetFtpDeleteFile method

InetFtpGetFile method

InetFtpRenameFile method

InetFtpSendBitmap method

InetFtpSendFile method


FTP Functions:FTP Connections

Working with FTP:
FTP Connections

InetFtpConnect method

InetFtpDisconnect method


FTP Functions:Directory Manipulation Over an FTP Connection

Working with FTP:
Directory Manipulation Over an FTP Connection

InetFtpBrowseDir method

InetFtpChangeDir method

InetFtpCreateDir method

InetFtpDeleteDir method

InetFtpGetCurrentDir method

FtpBrowse event

StopFtpBrowseEvent property


HTTP Functions:HTTP Connections

Working with HTTP:
HTTP Connections

InetHttpConnect method

InetHttpDisconnect method

InetHttpOpenRequest method

InetHttpCloseRequest method

InetHttpGetResponse method

InetHttpGetServerStatus method


HTTP Functions:Sending Data Over an HTTP Connection

Working with HTTP:
Sending Data Over an HTTP Connection

InetHttpSendBitmap method

InetHttpSendData method

InetHttpSendForm method

InetHttpSendRequest method

InetHttpFormValueCount property

InetHttpFormValues property


Error Codes

For a list of all possible error codes for LEADTOOLS FTP/HTTP COM functions, refer to LEADTOOLS COM Error Codes in the Main COM help file.


A Special Note About UNICODE Support

LEADTOOLS now provides UNICODE support. However, in order to utilize the examples and tutorials in this help file with UNICODE, you must make a few substitutions for class names, IDs, event names, etc. This is true for VB, MFC, Delphi and C++ Builder. Before attempting to compile the samples or tutorials in this help file for UNICODE, replace the class name, ID name, event name, etc. in the first column below, with the corresponding name in the second column. As you can see, this just involves adding "_U" to the end of the class name, ID name, event name, etc.

General Notes For VC++ Programmers:

1.

Replace: | With:
LTRASTERXXXXLib | LTRASTERXXXXLib_U
ILEADRasterXXXX | ILEADRasterXXXX_U
LEADRasterXXXX | LEADRasterXXXX_U
IID_ILEADRasterXXXX | IID_ILEADRasterXXXX_U
CLSID_LEADRasterXXXX | CLSID_LEADRasterXXXX_U
LIBID_LTRASTERXXXXLib | LIBID_LTRASTERXXXXLib_U
_LEADRasterXXXXEvents | _LEADRasterXXXXEvents_U
DIID__LEADRasterXXXXEvents | DIID__LEADRasterXXXXEvents_U

For example:

ILEADRasterIO_U *pRasterIO=NULL;

CoCreateInstance(CLSID_LEADRasterIO_U, NULL, CLSCTX_ALL, IID_ILEADRasterIO_U, (void**)&pRasterIO);

2.

For importing (.DLL) or (.OCX) files in your project:

Replace: | With:
LTRXXXN.OCX | LTRXXXNU.OCX
LTRXXXN.DLL | LTRXXXNU.DLL

For example:

#import "c:\\winnt\\system32\\ltrvr14nu.dll" no_namespace, named_guids

#import "c:\\winnt\\system32\\ltrvw14nu.ocx" no_namespace, named_guids

General Notes For VB Programmers:

Replace: | With:
LTRASTERXXXXLib | LTRASTERXXXXLib_U
LEADRasterXXXX | LEADRasterXXXX_U
LEADRasterXXXX_EventName | LEADRasterXXXX_U_EventName
LEADRasterXXXX.LEADRasterXXXX | LEADRasterXXXX_U.LEADRasterXXXX_U

When adding a Reference or Component to a Visual Basic project, be sure that the desired Reference or Component name ends with (_U).

For example:

To add the Unicode version of LEAD RasterView Control to your project, you have to select LEAD Raster View_U Control (14).

General Notes For Delphi and C++ Builder Programmers:

Replace: | With:
LTRASTERXXXLib_TLB | LTRASTERXXXLib_U_TLB
ILEADRasterXXXX | ILEADRasterXXXX_U
CLASS_LEADRasterXXXX | CLASS_LEADRasterXXXX_U
LEADRasterXXXX | LEADRasterXXXX_U
IID_ILEADRasterXXXX | IID_ILEADRasterXXXX_U
CLSID_LEADRasterXXXX | CLSID_LEADRasterXXXX_U
LIBID_LTRASTERXXXXLib | LIBID_LTRASTERXXXXLib_U
_LEADRasterXXXXEvents | _LEADRasterXXXXEvents_U
DIID__LEADRasterXXXXEvents | DIID__LEADRasterXXXXEvents_U

Note:

When adding an ActiveX Control or Import type library to a Delphi or C++ Builder project, be sure that the desired ActiveX Control or Library name ends with (_U).

For example:

To add the Unicode version of LEAD Raster View Control to your project, you have to select LEAD Raster View_U Control (14).


Tutorial for Visual Basic Programmers

LEADTOOLS FTP/HTTP COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS Internet COM objects.

LEADRasterFTP Sample for Visual Basic

InetHttpSendForm example for Visual Basic

InetHttpSendBitmap example for Visual Basic

InetHttpSendData example for Visual Basic

InetHttpSendRequest example for Visual Basic


LEADRasterFTP Sample for Visual Basic

Take the following steps to use FTP features, including Directory Browsing, to your application:

1. | Start Visual Basic.
2. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14).
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14).
3. | Add the LEAD RasterIO Object Library to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14).
4. | Add the LEAD RasterFTP Object Library to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD RasterFTP Object Library (14).
5. | Add the following lines to the General Declarations section at the top of your form's code:

Dim WithEvents FTPObj As LEADRasterFTP
Dim RasterObj As LEADRaster
Dim IOObj As LEADRasterIO

6. | Add a command button to your form and name it as follows:
 | Name | Caption
 | FTP | Test FTP
7. | Add the following initialization code to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Form_Load()
Set FTPObj = CreateObject("LEADRasterFTP.LEADRasterFTP")
Set RasterObj = CreateObject("LEADRaster.LEADRaster")
Set IOObj = CreateObject("LEADRasterIO.LEADRasterIO")
FTPObj.EnableMethodErrors =
 False
End Sub

8.

Code the FTP button's click procedure as follows:

Private Sub FTP_Click()
' Connect to FTP server
FTPObj.InetFtpConnect "10.1.1.113", 21, "anonymous", "password"
' Change working directory on the server
FTPObj.InetFtpChangeDir "/pub/TestFolder"
' Check that the change took effect
Me.Caption = "currently in: " + FTPObj.InetFtpGetCurrentDir
' Display the contents of the directory using the FTPBrowse event
FTPObj.InetFtpBrowseDir "*.*"
' Send a file to the server
FTPObj.InetFtpSendFile "c:\local.txt", "remote.txt", SENDAS_BINARY
' rename a file on the server
FTPObj.InetFtpRenameFile "remote.txt", "remote2.txt"
' get a file from the server
FTPObj.InetFtpGetFile "remote2.txt", "c:\local2.txt", True, SENDAS_BINARY
' create a new directory on the server
FTPObj.InetFtpCreateDir "/pub/TestFolder/SubFolder"
' send a LEAD COM image to a file on the server
IOObj.Load RasterObj, "v:\images\eagle.cmp", 0, 1, 1
FTPObj.InetFtpSendBitmap RasterObj, FILE_BMP, 4, 0, "SubFolder/test.bmp", SENDAS_BINARY
' delete a file on the server
FTPObj.InetFtpDeleteFile "SubFolder/test.bmp"
' remove a directory from the server
FTPObj.InetFtpDeleteDir "SubFolder"
' end the connection with the server
FTPObj.InetFtpDisconnect
End Sub

9.

Code the FTPBrowse event as follows:

Private Sub FTPObj_FtpBrowse(ByVal pszFile As String, ByVal FileAttrib As Long, ByVal CreateTime As Date, ByVal AccessTime As Date, ByVal LastWriteTime As Date, ByVal uFileSize As Long)
Dim s As String

FTPObj.StopFtpBrowseEvent = False
s = "File name: " + pszFile + vbNewLine
s = s + "File Attributies:" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_ARCHIVE) <> 0 Then s = s + vbTab + "Archive" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_COMPRESSED) <> 0 Then s = s + vbTab + "Compressed" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_DIRECTORY) <> 0 Then s = s + vbTab + "Directory" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_ENCRYPTED) <> 0 Then s = s + vbTab + "Encrypted" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_HIDDEN) <> 0 Then s = s + vbTab + "Hidden" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_NORMAL) <> 0 Then s = s + vbTab + "Normal" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_OFFLINE) <> 0 Then s = s + vbTab + "Offline" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_READONLY) <> 0 Then s = s + vbTab + "Readonly" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_REPARSE_POINT) <> 0 Then s = s + vbTab + "Reparse point" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_SPARSE_FILE) <> 0 Then s = s + vbTab + "Sparse file" + vbNewLine
If (FileAttrib And FTP_FILE_ATTRIB_SYSTEM) <> 0 Then s = s + vbTab + "System" + vbNewLine

If (FileAttrib And FTP_FILE_ATTRIB_TEMPORARY) <> 0 Then s = s + vbTab + "Temporary" + vbNewLine
s = s + "Create Time:" + vbTab + Str(CreateTime) + vbNewLine
s = s + "Access Time:" + vbTab + Str(AccessTime) + vbNewLine
s = s + "Write Time: " + vbTab + Str(LastWriteTime) + vbNewLine
s = s + "File Size: " + vbTab + Str(uFileSize) + vbNewLine
MsgBox s, , "FTP Browse"
End Sub

10.

Run your program to test it.


InetHttpSendForm example for Visual Basic

Take the following steps to use HTTP features to your application:

1. | Start Visual Basic.
2. | Add the LEAD Raster Object Library and LEAD Raster Variant Object Library to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14).
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster Variant Object Library (14).
3. | Add the LEAD RasterIO Object Library to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14).
4. | Add the LEAD RasterHTTP Object Library to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD RasterHTTP Object Library (14).
5. | Add the following lines to the General Declarations section at the top of your form's code:

Dim HTTPObj As LEADRasterHTTP
Dim RasterObj As LEADRaster
Dim IOObj As LEADRasterIO

6. | Add a command button to your form and name it as follows:
 | Name | Caption
 | SendForm | Send Form
7. | Add the following initialization code to the main form's Load procedure. In online help, you can use the Edit pull-down menu to copy the block of code.

Private Sub Form_Load()
Set HTTPObj = CreateObject("LEADRasterHTTP.LEADRasterHTTP")
Set RasterObj = CreateObject("LEADRaster.LEADRaster")
Set IOObj = CreateObject("LEADRasterIO.LEADRasterIO")

HTTPObj.EnableMethodErrors =
 False

End Sub

8.

Code the SendForm button's click procedure as follows:

Private Sub SendForm_Click()
Dim nRet As Integer, nStatus As Long
nRet = HTTPObj.InetHttpConnect ("demo.leadtools.com", 80, "", "")

If nRet = 0 Then
nRet = HTTPObj.InetHttpOpenRequest (HTTP_RQST_POST, "/com/tutorial/http/form.asp ", "", "HTTP/1.0")
If nRet = 0 Then
HTTPObj.InetHttpFormValueCount = 2
HTTPObj.InetHttpFormValues (0).pszName = "email"
HTTPObj.InetHttpFormValues(0).pszValue = "myemail@somewhere.com"
HTTPObj.InetHttpFormValues(1).pszName = "name"
HTTPObj.InetHttpFormValues(1).pszValue = "First Last"
nRet = HTTPObj.InetHttpSendForm ()
If nRet <> 0 Then
MsgBox "Error Sending Form", vbOKOnly + vbExclamation, "Error"
HTTPObj.InetHttpCloseRequest
HTTPObj.InetHttpDisconnect
Exit Sub
End If
HTTPObj.InetHttpGetServerStatus nStatus
If nStatus = HTTP_STATUS_OK Then
Dim strResponse As String
strResponse = HTTPObj.InetHttpGetResponse
Open "c:\output.htm" For Binary As #1
Put #1, , strResponse
Close #1
Else
MsgBox "Problem With Server", vbOK + vbExclamation, "Error"
End If
HTTPObj.InetHttpCloseRequest
HTTPObj.InetHttpDisconnect
End If
End If
End Sub

9. | Run your program to test it.
10. | Save the project to use as a starting point for other tutorials.


InetHttpSendBitmap example for Visual Basic

1. | Start with a copy of the project that you created in InetHttpSendForm example for Visual Basic
2. | Add a command button to your form and name it as follows:
 | Name | Caption
 | SendBMP | Send Bitmap
3. | Code the SendBMP button's click procedure as follows:

Private Sub SendBMP_Click()
Dim nRet As Integer
nRet = HTTPObj.InetHttpConnect ("demo.leadtools.com", 80, "", "")
If nRet = 0 Then
nRet = HTTPObj.InetHttpOpenRequest (HTTP_RQST_GET, "/com/tutorial/http/upload.asp ", "", "HTTP/1.0")
If nRet = 0 Then
Dim strResponse As String
Dim nv As NAMEVALUEItem
Set nv = CreateObject("NAMEVALUEItem.NAMEVALUEItem.121")
nv.pszName = "Photo"
nv.pszValue = "photo1.jpg"
IOObj.Load RasterObj, "v:\images\eagle.cmp", 0, 1, 1
nRet = HTTPObj.InetHttpSendBitmap(RasterObj, FILE_JFIF, 24, 200, "image/jpg", nv)
If nRet <> 0 Then
MsgBox "Error Sending Image", vbExclamation, "Error"
HTTPObj.InetHttpCloseRequest
HTTPObj.InetHttpDisconnect
Exit Sub
End If
Dim nStatus As Long
HTTPObj.InetHttpGetServerStatus nStatus
If nStatus = HTTP_STATUS_OK Then
strResponse = HTTPObj.InetHttpGetResponse ()
Open "c:\output.htm" For Binary As #1
Put #1, , strResponse
Close #1
Else
MsgBox "Problem With Server", vbExclamation, "Error"
strResponse = HTTPObj.InetHttpGetResponse
Kill "c:\error.htm"
Open "c:\error.htm" For Binary As #1
Put #1, , strResponse
Close #1
End If
HTTPObj.InetHttpCloseRequest
End If
HTTPObj.InetHttpDisconnect
End If
End Sub

4.

Run your program to test it.


InetHttpSendData example for Visual Basic

1. | Start with a copy of the project that you created in InetHttpSendForm example for Visual Basic
2. | Add a command button to your form and name it as follows:
 | Name | Caption
 | SendData | Send Data
3. | Code the SendData button's click procedure as follows:

Private Sub SendData_Click()
Dim nRet As Integer
Dim i As Integer
nRet = HTTPObj.InetHttpConnect("demo.leadtools.com", 80, "", "")
If nRet = 0 Then
nRet = HTTPObj.InetHttpOpenRequest(HTTP_RQST_GET, "/com/tutorial/http/upload.asp ", "", "HTTP/1.0")
If nRet = 0 Then
Dim strResponse As String
Dim nStatus As Long
Dim nv As NAMEVALUEItem
Dim RasterVar As LEADRasterVariant

RasterVar.Type = VALUE_ARRAY_BYTE
RasterVar.ItemCount = 1000
For i = 0 To 999
RasterVar.ShortItemValue(i) = 65 + i / 10
Next i
Set nv = CreateObject("NAMEVALUEItem.NAMEVALUEItem.121")
nv.pszName = "Data"
nv.pszValue = "data1.raw"
nRet = HTTPObj.InetHttpSendData(RasterVar, 1000, "image/jpg", nv)
If nRet <> 0 Then
MsgBox "Error Sending Data", vbExclamation, "Error"
HTTPObj.InetHttpCloseRequest
HTTPObj.InetHttpDisconnect
Exit Sub
End If
nStatus = HTTPObj.InetHttpGetServerStatus
If nStatus = HTTP_STATUS_OK Then
strResponse = HTTPObj.InetHttpGetResponse()
Kill "c:\output.htm"
Open "c:\output.htm" For Binary As #1
Put #1, , strResponse
Close #1
Else
MsgBox "Problem With Server", vbExclamation, "Error"
strResponse = HTTPObj.InetHttpGetResponse()
Open "c:\error.htm" For Binary As #1
Put #1, , strResponse
Close #1

End If
HTTPObj.InetHttpCloseRequest
End If
HTTPObj.InetHttpDisconnect
End If
End Sub

4.

Run your program to test it.


InetHttpSendRequest example for Visual Basic

1. | Start with a copy of the project that you created in InetHttpSendForm example for Visual Basic
2. | Add a command button to your form and name it as follows:
 | Name | Caption
 | SendRequest | Send Request
3. | Code the SendRequest button's click procedure as follows:

Private Sub SendRequest_Click()
Dim nRet As Integer
Dim RasterVar As LEADRasterVariant
nRet = HTTPObj.InetHttpConnect("demo.leadtools.com", 80, "", "")
If nRet = 0 Then
nRet = HTTPObj.InetHttpOpenRequest(HTTP_RQST_GET, "/com/default.htm ", "", "HTTP/1.0")
If nRet = 0 Then
Dim strResponse As String
Dim nStatus As Long
RasterVar.StringValue = ""
nRet = HTTPObj.InetHttpSendRequest(RasterVar, 0, RasterVar, 0)
If nRet <> 0 Then
MsgBox "Error Sending Form", vbExclamation, "Error"
HTTPObj.InetHttpCloseRequest
HTTPObj.InetHttpDisconnect
Exit Sub
End If
nStatus = HTTPObj.InetHttpGetServerStatus
If nStatus = HTTP_STATUS_OK Then
strResponse = HTTPObj.InetHttpGetResponse()
Kill "c:\output.htm"
Open "c:\output.htm" For Binary As #1
Put #1, , strResponse
Close #1
Else
MsgBox "Problem With Server", vbExclamation, "Error"
strResponse = HTTPObj.InetHttpGetResponse()
Open "c:\error.htm" For Binary As #1
Put #1, , strResponse
Close #1
End If
HTTPObj.InetHttpCloseRequest
End If
HTTPObj.InetHttpDisconnect
End If
End Sub

4.

Run your program to test it.


Tutorial for Visual C++ 5.0 Programmers

LEADTOOLS FTP/HTTP COM supports UNICODE. For more information on using the samples in this help file with UNICODE, please refer to A Special Note About UNICODE Support.

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS Internet COM objects. Note that the COM objects require the MFC 4.2 files, which are described in System Files Updated.

FTP example for C++ 5.0 and later

InetHttpSendForm example for C++ 5.0 and later

InetHttpSendBitmap example for C++ 5.0 and later

InetHttpSendData example for C++ 5.0 and later

InetHttpSendRequest example for C++ 5.0 and later


FTP example for C++ 5.0 and later

Take the following steps to use FTP features, including Directory Browsing, to your application:

1. | Start with a copy of the project that you created in Loading and Displaying an Image
 | Note: This example changes the initialization of the window; so using a copy of the original project prevents problems with later reuse of the original project.
2. | From the Project menu choose "Settings...". In the "General" tab, select "Use MFC in a Shared DLL".
3. | A sink interface must be added to receive FtpBrowse event from the LEADRasterFTP COM object. Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterFTPSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterFTPSink.h file, move the destructor so that it is public:

// Implementation
virtual ~CRasterFTPSink();
protected:

h.

In the RasterFTPSink.h file, add the following to the top of the file:

class CTutorDlg;

i.

In the RasterFTPSink.cpp file, add the following to the top of the file (after #include "RasterFTPSink.h")

#include "tutorDlg.h"

4. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following line to the end of the file (keep in mind, you may have to change the path to where the DLL resides):

#import "c:\\winnt\\system32\\LTRVR14N.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\LTRFT14N.dll" no_namespace, named_guids
#include "RasterFTPSink.h"

5.

Edit the TUTORDLG.H file and change the definition of CTutorDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:
ILEADRasterFTP *m_pRasterFTP;
CRasterFTPSink *m_pRasterFTPSink;
DWORD m_dwFTPCookie;

6.

Edit the TutorDlg.cpp file and add the following code to the end of the OnInitDialog function (just before return TRUE):

//Instantiate the sink class
 and hold a pointer to it.
m_pRasterFTPSink = new CRasterFTPSink;
//Create the RasterFTP object
CoCreateInstance(CLSID_LEADRasterFTP, NULL, CLSCTX_ALL, IID_ILEADRasterFTP,
 (void**)&m_pRasterFTP);
//Establish a connection between source and sink.
LPUNKNOWN pUnkSink = m_pRasterFTPSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterFTP, DIID__LEADRasterFTPEvents, pUnkSink,
 FALSE, &m_dwFTPCookie);

7.

Add the following line near the top of TutorDlg.cpp (just after #include "tutorDlg.h")

#include <afxctl.h>

8. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select CTutorDlg.
 | c. | In the Messages list box, select WM_DESTROY.
 | d. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | e. | Click the Edit Code button to start entering the code.
9. | Enter new code as follows (just before the CDialog::OnDestroy call):

void CTutorDlg::OnDestroy()
{
//Terminate a connection between source and sink.
LPUNKNOWN pUnkSink = m_pRasterFTPSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterFTP, DIID__LEADRasterFTPEvents,
 pUnkSink, FALSE, m_dwFTPCookie);
delete m_pRasterFTPSink;
m_pRasterFTP->Release();
CDialog::OnDestroy();
}

10. | Add a command button to the Tutor dialog and name it as follows:
 | ID | Caption
 | IDC_FTP | FTP Test
11. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_FTP.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnFtp).
 | f. | Click the Edit Code button and enter the following code: (you will have to change the file names to existing file names on your computer)

BOOL SavedSetting = m_pRasterFTP->EnableMethodErrors;
m_pRasterFTP->EnableMethodErrors
 = FALSE;
if(m_pRasterFTP->InetFtpConnect
 ("10.1.1.113", 21, "anonymous", "user@domain.com"))
{
AfxMessageBox(TEXT("Error connecting to FTP server"));
return;
}
// Change working directory on the server
m_pRasterFTP->InetFtpChangeDir
 ("/pub/TestFolder");
// Check that the change took effect
TCHAR s[1000];
wsprintf(s, TEXT("Current Directory is: %s"), (TCHAR*)( m_pRasterFTP->InetFtpGetCurrentDir
 ()));
AfxMessageBox(s);
// get directory contents
m_pRasterFTP->InetFtpBrowseDir("*.*");
// Send a file to the server
m_pRasterFTP->InetFtpSendFile("c:\\local.txt",
 "remote.txt", SENDAS_BINARY);
// rename a file on the server
m_pRasterFTP->InetFtpRenameFile
 ("remote.txt", "remote2.txt");
// get a file from the server
m_pRasterFTP->InetFtpGetFile
 ("remote2.txt", "c:\\local2.txt", TRUE, SENDAS_BINARY);
// create a new directory on the server
m_pRasterFTP->InetFtpCreateDir
 ("/pub/TestFolder/SubFolder");
// send a LEAD image to a file on the server
// load the image first by clicking the "LEAD Load" button
m_pRasterFTP->InetFtpSendBitmap(m_LEADRasView1.GetRaster(),
 FILE_BMP, 4, 0, "SubFolder/test.bmp", SENDAS_BINARY);
// delete a file on the server
m_pRasterFTP->InetFtpDeleteFile("SubFolder/test.bmp");
// remove a directory from the server
m_pRasterFTP->InetFtpDeleteDir("SubFolder");
// end the connection with the server
m_pRasterFTP->InetFtpDisconnect();
m_pRasterFTP->EnableMethodErrors = SavedSetting;

12. | Add code to handle the FtpBrowse Event.
 | a. | Start the OLE VIEW (OLE/COM object viewer) tool that ships with Visual Studio.
 | b. | Click to open the "Type Libraries" branch (if it is not displayed, choose "Expert Mode" from the View menu).
 | c. | Double-click the "LEAD RasterFTP Object Library" item.
 | d. | Click to open the dispinterface _LEADRasterFTPEvents branch.
 | e. | Click to open the "Methods" branch.
 | f. | Select the "FtpBrowse" method. See that the Dispatch ID is 1, and the FtpBrowse() event takes 7 arguments.
 | g. | Add the following code to RasterFTPSink.cpp immediately before the END_DISPATCH_MAP() macro. The VT_EMPTY argument indicates that the FtpBrowse Event returns NULL. The VTS_xxx arguments indicate the types and order of the FtpBrowse Event arguments:

DISP_FUNCTION_ID(CRasterFTPSink, "FtpBrowse", 1, OnFtpBrowse, VT_EMPTY, VTS_BSTR VTS_I4 VTS_DATE VTS_DATE VTS_DATE VTS_I4 VTS_PBOOL)

h. | In RasterFTPSink.cpp, modify the second parameter of the INTERFACE_PART macro to become as follows:
i. | INTERFACE_PART(CRasterFTPSink, DIID__LEADRasterFTPEvents, Dispatch)
j. | Click on the "Class View" tab in the project workspace.
k. | Right-click the "CRasterFTPSink" branch, and choose "Add Member Function".
l. | For "Function Type" enter "void".
m. | For "Function Declaration" enter the following and click the "OK" button:

OnFtpBrowse(TCHAR * pszFile, long FileAttrib, DATE CreateTime, DATE AccessTime, DATE LastWriteTime, long uFileSize)

n.

Add the following code to the OnFtpBrowse() method:

void CRasterFTPSink::OnFtpBrowse(TCHAR * pszFile, long FileAttrib, DATE CreateTime, DATE AccessTime, DATE LastWriteTime, long uFileSize)
{
CString s(TEXT("File name: "));

   m_pRasterFTP->PutStopFtpBrowseEvent(
 FALSE);

s = s + pszFile + TEXT("\n");
s = s + TEXT("File Attributies:") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_ARCHIVE) s = s +
 TEXT("\t") + TEXT("Archive") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_COMPRESSED) s =
 s + TEXT("\t") + TEXT("Compressed") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_DIRECTORY) s = s
 + TEXT("\t") + TEXT("Directory") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_ENCRYPTED) s = s
 + TEXT("\t") + TEXT("Encrypted") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_HIDDEN) s = s +
 TEXT("\t") + TEXT("Hidden") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_NORMAL) s = s +
 TEXT("\t") + TEXT("Normal") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_OFFLINE) s = s +
 TEXT("\t") + TEXT("Offline") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_READONLY) s = s
 + TEXT("\t") + TEXT("Read-only") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_REPARSE_POINT) s
 = s + TEXT("\t") + TEXT("Reparse point") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_SPARSE_FILE) s =
 s + TEXT("\t") + TEXT("Sparse file") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_SYSTEM) s = s +
 TEXT("\t") + TEXT("System") + TEXT("\n");
if (FileAttrib & FTP_FILE_ATTRIB_TEMPORARY) s = s
 + TEXT("\t") + TEXT("Temporary") + TEXT("\n");
s = s + TEXT("Create Time:") + TEXT("\t")
 + COleDateTime(CreateTime).Format() + TEXT("\n");
s = s + TEXT("Access Time:") + TEXT("\t")
 + COleDateTime(AccessTime).Format() + TEXT("\n");
s = s + TEXT("Write Time: ") + TEXT("\t")
 + COleDateTime(LastWriteTime).Format() + TEXT("\n");
CString sFileSize;
sFileSize.Format(TEXT("%ld"), uFileSize);
s = s + TEXT("File Size: ") + TEXT("\t")
 + sFileSize + TEXT("\n");
AfxMessageBox(s);
};

13.

Rebuild and run the application.


InetHttpSendForm example for C++ 5.0 and later

Take the following steps to use HTTP features to your application:

1. | Start with a copy of the project that you created in Loading and Displaying an Image
 | Note: This example changes the initialization of the window; so using a copy of the original project prevents problems with later reuse of the original project.
2. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the tutor files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following line to the end of the file (keep in mind, you may have to change the path to where the DLL resides):

#import "c:\\winnt\\system32\\LTRVR14N.dll" no_namespace, named_guids
#import "c:\\winnt\\system32\\LTRHT14N.dll" no_namespace, named_guids

3.

Edit the TUTORDLG.H file and change the definition of CTutorDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:
ILEADRasterHTTP *m_pRasterHTTP;

4.

Edit the TutorDlg.cpp file and add the following code to the end of the OnInitDialog function (just before return TRUE):

//Create the RasterHTTP object
CoCreateInstance(CLSID_LEADRasterHTTP, NULL, CLSCTX_ALL, IID_ILEADRasterHTTP, (void**)&m_pRasterHTTP);

5. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | In the Class name combo box, select CTutorDlg.
 | b. | In the Object IDs list box, select CTutorDlg.
 | c. | In the Messages list box, select WM_DESTROY.
 | d. | Click the Add function button. Choose OK for the default function name (OnDestroy).
 | e. | Click the Edit Code button to start entering the code.
6. | Enter new code as follows (just before the CDialog::OnDestroy call):

void CTutorDlg::OnDestroy()
{
m_pRasterHTTP->Release();
CDialog::OnDestroy();
}

7. | Add a command buttons to the Tutor dialog and name it as follows:
 | ID |  | Caption
 | IDC_HTTP_FORM |  | HTTP Form
8. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_HTTP_FORM.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnHttpForm).
 | f. | Click the Edit Code button and enter the following code: (you will have to change the IP address to a valid server name or address)

void CTutorDlg::OnHttpForm()
{
short nRet;
long nStatus;
nRet = m_pRasterHTTP->InetHttpConnect("demo.leadtools.com",
 80, "", "");
if(nRet == 0)
{
nRet = m_pRasterHTTP->InetHttpOpenRequest(HTTP_RQST_POST,
 "/com/tutorial/http/form.asp", "", "HTTP/1.0");
if(nRet == 0)
{
m_pRasterHTTP->InetHttpFormValueCount =
 2;
m_pRasterHTTP->InetHttpFormValues[0]->pszName
 = "email";
m_pRasterHTTP->InetHttpFormValues[0]->pszValue
 = TEXT("myemail@mydomain.com");
m_pRasterHTTP->InetHttpFormValues[1]->pszName
 = TEXT("name");
m_pRasterHTTP->InetHttpFormValues[1]->pszValue
 = TEXT("First Last");
nRet = m_pRasterHTTP->InetHttpSendForm();
if(nRet != 0)
{
AfxMessageBox(TEXT("Error
 Sending Form"));
m_pRasterHTTP->InetHttpCloseRequest();
m_pRasterHTTP->InetHttpDisconnect();
return;
}
m_pRasterHTTP->InetHttpGetServerStatus(&nStatus);
if(nStatus == HTTP_STATUS_OK)
{
FILE
 * fp = _topen(TEXT("c:\\output.htm"), TEXT("wb"));
if(fp)
{
_bstr_t
 szResponse = m_pRasterHTTP->InetHttpGetResponse();
fwrite((TCHAR
 *)szResponse, szResponse.length(), 1, fp);
fclose(fp);
}
}
else
{
AfxMessageBox(TEXT("Problem
 With Server"));
}
m_pRasterHTTP->InetHttpCloseRequest();
m_pRasterHTTP->InetHttpDisconnect();
}
}
}

9.

Rebuild and run the application.


InetHttpSendBitmap example for C++ 5.0 and later

1. | Start with the project you created in InetHttpSendForm example for C++ 5.0 and later
2. | Add a command buttons to the Tutor dialog and name it as follows:
 | ID |  | Caption
 | IDC_HTTP_BITMAP |  | HTTP Bitmap
3. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_HTTP_BITMAP.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnHttpBitmap).
 | f. | Click the Edit Code button and enter the following code: (you will have to change the IP address to a valid server name or address)

void CTutorDlg::OnHttpBitmap()
{
short nRet;
nRet = m_pRasterHTTP->InetHttpConnect
 ("demo.leadtools.com", 80, "", "");
if(nRet == 0)
{
nRet = m_pRasterHTTP->InetHttpOpenRequest (HTTP_RQST_POST,
 "/com/tutorial/http/upload.asp", "", "HTTP/1.0");
if(nRet == 0)
{
INAMEVALUEItem* nv=NULL;
CoCreateInstance(CLSID_NAMEVALUEItem,
 NULL, CLSCTX_ALL, IID_INAMEVALUEItem, (void**)&nv);
if(!nv)
{
AfxMessageBox(TEXT("Error
 creating Name/Value item"));
m_pRasterHTTP->InetHttpCloseRequest ();
m_pRasterHTTP->InetHttpDisconnect ();
return;
}
nv->pszName =
 TEXT("Photo");
nv->pszValue =
 TEXT("photo1.jpg");
nRet = m_pRasterHTTP->InetHttpSendBitmap (m_LEADRasView1.GetRaster(),
 FILE_JFIF, 24, 200, "image/jpg", nv);
nv->Release();
if(nRet != 0)
{
AfxMessageBox(TEXT("Error
 Sending Image"));
m_pRasterHTTP->InetHttpCloseRequest ();
m_pRasterHTTP->InetHttpDisconnect ();
return;
}
long nStatus;
m_pRasterHTTP->InetHttpGetServerStatus
 (&nStatus);
_bstr_t szResponse
 = m_pRasterHTTP->InetHttpGetResponse
 ();
if(nStatus == HTTP_STATUS_OK)
{
FILE
 * fp = _tfopen(TEXT("c:\\output.htm"), TEXT("wb"));
if(fp)
{
fwrite((TCHAR
 *)szResponse, szResponse.length(), 1, fp);
fclose(fp);
}
}
else
{
AfxMessageBox(TEXT("Problem
 With Server"));
FILE
 * fp = _tfopen(TEXT("c:\\error.htm"), TEXT("wb"));
if(fp)
{
fwrite((TCHAR
 *)szResponse, szResponse.length(), 1, fp);
fclose(fp);
}
}
m_pRasterHTTP->InetHttpCloseRequest ();
}
m_pRasterHTTP->InetHttpDisconnect
 ();
}
}

4.

Rebuild and run the application.


InetHttpSendData example for C++ 5.0 and later

1. | Start with the project you created in InetHttpSendForm example for C++ 5.0 and later
2. | Add a command buttons to the Tutor dialog and name it as follows:
 | ID |  | Caption
 | IDC_HTTP_DATA |  | HTTP Data
3. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_HTTP_DATA.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnHttpData).
 | f. | Click the Edit Code button and enter the following code: (you will have to change the IP address to a valid server name or address)

void CTutorDlg::OnHttpData()
{
short nRet;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
 IID_ILEADRasterVariant, (void **)&pltRasVar);
nRet = m_pRasterHTTP->InetHttpConnect("demo.leadtools.com",
 80, "", "");
if(nRet == 0)
{
nRet = m_pRasterHTTP->InetHttpOpenRequest(HTTP_RQST_POST,
 "/com/tutorial/http/upload.asp", "", "HTTP/1.0");
if(nRet == 0)
{
long nStatus;
INAMEVALUEItem* nv=NULL;
CoCreateInstance(CLSID_NAMEVALUEItem,
 NULL, CLSCTX_ALL, IID_INAMEVALUEItem, (void**)&nv);
if(!nv)
{
AfxMessageBox(TEXT("Error
 creating Name/Value item"));
m_pRasterHTTP->InetHttpCloseRequest();
m_pRasterHTTP->InetHttpDisconnect();
return;
}
nv->pszName =
 TEXT("Data");
nv->pszValue =
 TEXT("data1.raw");
//Fill it with data
for(int i=0; i<1000;
 ++i)
pltRasVar->ShortItemValue
 [i] = 65 + i / 10;
//Unlock the variant
 data

nRet = m_pRasterHTTP->InetHttpSendData(pltRasVar,
 1000, "image/jpg", nv);

nv->Release();
if(nRet != 0)
{
AfxMessageBox(TEXT("Error
 Sending Data"));
m_pRasterHTTP->InetHttpCloseRequest
 ();
m_pRasterHTTP->InetHttpDisconnect
 ();
return;
}
nStatus = m_pRasterHTTP->InetHttpGetServerStatus();
_bstr_t szResponse
 = m_pRasterHTTP->InetHttpGetResponse();
if(nStatus == HTTP_STATUS_OK)
{
FILE
 * fp = _tfopen(TEXT("c:\\output.htm"), TEXT("wb"));
if(fp)
{
fwrite((TCHAR
 *)szResponse, szResponse.length(), 1, fp);
fclose(fp);
}
}
else
{
AfxMessageBox(TEXT("Problem
 With Server"));
FILE
 * fp = _tfopen(TEXT("c:\\output.htm"), TEXT("wb"));
if(fp)
{
fwrite((TCHAR
 *)szResponse, szResponse.length(), 1, fp);
fclose(fp);
}
}
m_pRasterHTTP->InetHttpCloseRequest
 ();
}
m_pRasterHTTP->InetHttpDisconnect
 ();
}
}

4.

Rebuild and run the application.


InetHttpSendRequest example for C++ 5.0 and later

1. | Start with the project you created in InetHttpSendForm example for C++ 5.0 and later
2. | Add a command buttons to the Tutor dialog and name it as follows:
 | ID |  | Caption
 | IDC_HTTP_REQUEST |  | HTTP Request
3. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CTutorDlg.
 | c. | In the Object IDs list box, select IDC_HTTP_REQUEST.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnHttpRequest).
 | f. | Click the Edit Code button and enter the following code: (you will have to change the IP address to a valid server name or address)

void CTutorDlg::OnHttpRequest()
{
short nRet;
ILEADRasterVariant * pltRasVar = NULL;

CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);

nRet = m_pRasterHTTP->InetHttpConnect("demo.leadtools.com",
 80, "", "");
if(nRet == 0)
{
nRet = m_pRasterHTTP->InetHttpOpenRequest(HTTP_RQST_GET,
 "/com/default.htm", "", "HTTP/1.0");
if(nRet == 0)
{
long nStatus;

nRet = m_pRasterHTTP->InetHttpSendRequest(pltRasVar,
 0, pltRasVar, 0);
if(nRet != 0)
{
AfxMessageBox(TEXT("Error
 Sending request"));
m_pRasterHTTP->InetHttpCloseRequest
 ();
m_pRasterHTTP->InetHttpDisconnect
 ();
return;
}
nStatus = m_pRasterHTTP->InetHttpGetServerStatus
 ();
_bstr_t szResponse
 = m_pRasterHTTP->InetHttpGetResponse
 ();
if(nStatus == HTTP_STATUS_OK)
{
FILE
 * fp = _tfopen(TEXT("c:\\output.htm"), TEXT("wb"));
if(fp)
{
fwrite((TCHAR
 *)szResponse, szResponse.length(), 1, fp);
fclose(fp);
}
}
else
{
AfxMessageBox(TEXT("Problem
 With Server"));
FILE
 * fp = _tfopen(TEXT("c:\\output.htm"), TEXT("wb"));
if(fp)
{
fwrite((TCHAR
 *)szResponse, szResponse.length(), 1, fp);
fclose(fp);
}
}
m_pRasterHTTP->InetHttpCloseRequest
 ();
}
m_pRasterHTTP->InetHttpDisconnect
 ();
}

pltRasVar->Release();
}

4.

Rebuild and run the application.


EnableMethodErrors property (ILEADRasterFTP, ILEADRasterHTTP)

Visual Basic example

Visual C++ 5.0 example

Syntax

VARIANT_BOOL EnableMethodErrors

Remarks

Specifies whether LEADTOOLS generates system error events (in addition to error return codes).

Setting | Description
TRUE | Generate system error events.
FALSE | Do not generate system error events.


FtpBrowse event (ILEADRasterFTP)

Visual Basic example

Visual C++ 5.0 example

Syntax | void FtpBrowse (BSTR pszFile, long FileAttrib, VARIANT CreateTime, VARIANT AccessTime, VARIANT LastWriteTime, long uFileSize);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Handles the data generated by calling the InetFtpBrowseDir method.

This event receives the results of a file search or from browsing a directory.

To abort browsing, set the StopFtpBrowseEvent property to VARIANT_TRUE.

See Also

Elements: | InetFtpBrowseDir method, InetFtpChangeDir method, InetFtpCreateDir method
Topics: | Working with FTP: Directory Manipulation Over an FTP Connection


InetFtpBrowseDir method (ILEADRasterFTP)

InetFtpBrowseDir method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpBrowseDir(BSTR pszSearch);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Browses a specific directory or searches for a specific file on an FTP server's file system.

Searches the specified directory of the active FTP connection. File and directory entries are returned to the application through the FtpBrowse event.

See Also

Elements: | FtpBrowse event, InetFtpChangeDir method, InetFtpCreateDir method
Topics: | Working with FTP: Directory Manipulation Over an FTP Connection


InetFtpChangeDir method (ILEADRasterFTP)

InetFtpChangeDir method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpChangeDir(BSTR pszDirectory);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Changes the working directory on the FTP server.

See Also

Elements: | InetFtpCreateDir method, InetFtpDeleteDir method, InetFtpGetCurrentDir method
Topics: | Working with FTP: Directory Manipulation Over an FTP Connection


InetFtpConnect method (ILEADRasterFTP)

InetFtpConnect method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpConnect(BSTR pszServer, short nPort, BSTR pszUserName, BSTR pszPassword);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Establishes a connection with the specified server.

See Also

Elements: | InetFtpDisconnect method
Topics: | Working with FTP: FTP Connections


InetFtpCreateDir method (ILEADRasterFTP)

InetFtpCreateDir method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpCreateDir(BSTR pszRemoteDir);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Creates a new directory on the FTP server.

If the directory specified in pszRemoteDir already exists on the FTP server, this method will fail.

See Also

Elements: | InetFtpChangeDir method, InetFtpDeleteDir method, InetFtpGetCurrentDir method
Topics: | Working with FTP: Directory Manipulation Over an FTP Connection


InetFtpDeleteDir method (ILEADRasterFTP)

InetFtpDeleteDir method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpDeleteDir(BSTR pszRemoteDir);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Removes the specified directory on the FTP server.

If the directory specified in pszRemoteDir does not exist on the FTP server, this method will fail.

See Also

Elements: | InetFtpGetCurrentDir method, InetFtpChangeDir method, InetFtpCreateDir method
Topics: | Working with FTP: Directory Manipulation Over an FTP Connection


InetFtpDeleteFile method (ILEADRasterFTP)

InetFtpDeleteFile method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpDeleteFile(BSTR pszRemote);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Deletes a file stored on the FTP server.

See Also

Elements: | InetFtpRenameFile method, InetFtpSendFile method, InetFtpGetFile method
Topics: | Working with FTP: File Manipulation and Sending Bitmaps Over an FTP Connection


InetFtpDisconnect method (ILEADRasterFTP)

InetFtpDisconnect method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpDisconnect()
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Closes a single FTP connection.

The method terminates any pending operations on the handle and discards any outstanding data.

See Also

Elements: | InetFtpConnect method
Topics: | Working with FTP: FTP Connections


InetFtpGetCurrentDir method (ILEADRasterFTP)

InetFtpGetCurrentDir method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR InetFtpGetCurrentDir()
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Retrieves the current directory for the FTP connection.

See Also

Elements: | InetFtpDeleteDir method, InetFtpChangeDir method, InetFtpCreateDir method
Topics: | Working with FTP: Directory Manipulation Over an FTP Connection


InetFtpGetFile method (ILEADRasterFTP)

InetFtpGetFile method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpGetFile (BSTR pszRemote, BSTR pszLocal, VARIANT_BOOL bOverwrite, long uSendAs);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Retrieves a file from the FTP server and stores it under the specified file name, locally.

See Also

Elements: | InetFtpSendFile method, InetFtpRenameFile method, InetFtpDeleteFile method
Topics: | Working with FTP: File Manipulation and Sending Bitmaps Over an FTP Connection


InetFtpRenameFile method (ILEADRasterFTP)

InetFtpRenameFile method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpRenameFile(BSTR pszOld, BSTR pszNew);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Renames a file stored on the FTP server.

If the file specified in pszNew already exists, this method will fail.

See Also

Elements: | InetFtpGetFile method, InetFtpSendFile method, InetFtpDeleteFile method
Topics: | Working with FTP: File Manipulation and Sending Bitmaps Over an FTP Connection


InetFtpSendBitmap method (ILEADRasterFTP)

InetFtpSendBitmap method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpSendBitmap(ILEADRaster * pRaster, short nFormat, short nBitsPerPixel, short nQFactor, BSTR pszRemote, long uSendAs);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Saves a bitmap to an FTP server. The output can be in any of the supported, compressed or uncompressed, file formats.

If the file specified in pszRemote already exists, this method will fail.

See Also

Elements: | InetFtpSendFile method
Topics: | Working with FTP: File Manipulation and Sending Bitmaps Over an FTP Connection


InetFtpSendFile method (ILEADRasterFTP)

InetFtpSendFile method (LEADRasterFTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetFtpSendFile (BSTR pszLocal, BSTR pszRemote, long uSendAs);
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Sends a file on the local system to the FTP server for storage.

If the file specified in pszRemote already exists, this method will fail.

See Also

Elements: | InetFtpGetFile method, InetFtpRenameFile method, InetFtpDeleteFile method
Topics: | Working with FTP: File Manipulation and Sending Bitmaps Over an FTP Connection


InetHttpConnect method (ILEADRasterHTTP)

InetHttpConnect method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpConnect(BSTR pszServer, long nPort, BSTR pszUserName, BSTR pszPassword);
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

This method establishes a connection with an HTTP Server. To connect anonymously, pass NULL for pszUserName and pszPassword.

See Also

Elements: | InetHttpDisconnect method, InetHttpCloseRequest method
Topics: | Working with HTTP: HTTP Connections


InetHttpCloseRequest method (ILEADRasterHTTP)

InetHttpCloseRequest method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpCloseRequest();
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Closes an HTTP request that was opened with the InetHttpOpenRequest method.

This method should be called after finishing a request.

See Also

Elements: | InetHttpOpenRequest method, InetHttpDisConnect method
Topics: | Working with HTTP: HTTP Connections


InetHttpDisconnect method (ILEADRasterHTTP)

InetHttpDisconnect method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpDisconnect();
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Disconnects the HTTP connection.

Use this method to terminate a connection to an HTTP server.

See Also

Elements: | InetHttpConnect method, InetHttpCloseRequest method
Topics: | Working with HTTP: HTTP Connections


InetHttpFormValueCount property (ILEADRasterHTTP)

InetHttpFormValueCount property (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | long InetHttpFormValueCount
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Contains the number of name/value pairs in the InetHttpFormValues property.

Set the InetHttpFormValueCount property to allocate storage for the InetHttpFormValues property (an array), prior to setting the form values.

Set this property to 0 at any time to free the memory used for the InetHttpFormValues property.

See Also

Elements: | InetHttpSendForm method, InetHttpFormValues property
Topics: | Working with HTTP: Sending Data Over an HTTP Connection


InetHttpFormValues property (ILEADRasterHTTP)

InetHttpFormValues property (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | NAMEVALUEItem InetHttpFormValues(long nIndex);
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Contains an array of name/value pairs used by the InetHttpSendForm method. The size of this array is determined by the InetHttpFormValueCount property.

The InetHttpFormValues property has the following properties:

Property | Description
BSTR pszName | Name of a HTTP form item.
BSTR pszValue | Value of an HTTP form item.

This information corresponds to the name and value you would provide if programming in HTML.

You can set the InetHttpFormValueCount property to allocate storage for the InetHttpFormValues property, prior to setting the values.

Set the InetHttpFormValueCount property to 0 at any time to free the memory used for the InetHttpFormValues property.

See Also

Elements: | InetHttpSendForm method, InetHttpFormValueCount property
Topics: | Working with HTTP: Sending Data Over an HTTP Connection


InetHttpGetResponse method (ILEADRasterHTTP)

InetHttpGetResponse method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR InetHttpGetResponse();
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Retrieves the response from an HTTP server. This information should be read after you submit a request to an HTTP server.

See Also

Elements: | InetHttpSendRequest method, InetHttpGetServerStatus method, InetHttpConnect method
Topics: | Working with HTTP: HTTP Connections


InetHttpGetServerStatus method (ILEADRasterHTTP)

InetHttpGetServerStatus method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpGetServerStatus(long *nStatus);
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Retrieves the current status of the HTTP server

See Also

Elements: | InetHttpConnect method, InetHttpDisconnect method, InetHttpOpenRequest method, InetHttpCloseRequest method.
Topics: | Working with HTTP: HTTP Connections


InetHttpOpenRequest method (ILEADRasterHTTP)

InetHttpOpenRequest method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpOpenRequest(long nType, BSTR pszTarget, BSTR pszReferer, BSTR pszVersion);
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Creates a new HTTP request to be sent to the server.

An HTTP request holds a request to be sent to an HTTP server and contains all RFC822/MIME/HTTP headers to be sent as part of the request.

The InetHttpOpenRequest method must be called before calling the following methods InetHttpSendBitmap, InetHttpSendData, InetHttpSendForm and InetHttpSendRequest.

See Also

Elements: | InetHttpCloseRequest method, InetHttpSendRequest method, InetHttpConnect method
Topics: | Working with HTTP: HTTP Connections


InetHttpSendBitmap method (ILEADRasterHTTP)

InetHttpSendBitmap method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpSendBitmap(ILEADRaster * pRaster, long nFormat, long nBitsPerPixel, long nQFactor, BSTR pszContentType, INAMEVALUEItem * pNameValue);
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Sends a Bitmap to an HTTP server. It is up to a script on the server side to process the data when it is received. This script is specified in the InetHttpOpenRequest method. The script can be any type of file that is recognized by the Web Server.

Note:

The LEADTOOLS Upload component can be used in an ASP page to extract the uploaded data.

See Also

Elements: | InetHttpOpenRequest method, InetHttpSendRequest method, InetHttpSendData method, InetHttpSendForm method
Topics: | Working with HTTP: Sending Data Over an HTTP Connection


InetHttpSendData method (ILEADRasterHTTP)

InetHttpSendData method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpSendData(ILEADRasterVariant * pData, long uSize, BSTR pszContentType, INAMEVALUEItem * pNameValue);
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Sends raw data to an HTTP server. It is up to a script on the server side to process the data when it is received. This script is specified in the InetHttpOpenRequest method. The script can be any type of file that is recognized by the HTTP Server.

Note:

The LEADTOOLS Upload component can be used in an ASP page to extract the uploaded data.

See Also

Elements: | InetHttpOpenRequest method, InetHttpSendBitmap method, InetHttpSendForm method, InetHttpSendRequest method
Topics: | Working with HTTP: Sending Data Over an HTTP Connection


InetHttpSendForm method (ILEADRasterHTTP)

InetHttpSendForm method (LEADRasterHTTP Object)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpSendForm();
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Sends a form to an HTTP Server.

This method allows you to simulate submitting a form to an Internet browser. You do not need an Internet browser to use this method.

Prior to calling InetHttpSendForm, you should allocate and fill and array of Name/Value pairs using the InetHttpFormValueCount and InetHttpFormValues properties.

See Also

Elements: | InetHttpFormValueCount property, InetHttpFormValues property, InetHttpSendBitmap method, InetHttpSendData method, InetHttpSendRequest method
Topics: | Working with HTTP: Sending Data Over an HTTP Connection


InetHttpSendRequest method (ILEADRasterHTTP)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetHttpSendRequest(ILEADRasterVariant * Header, long nHeaderSize, ILEADRasterVariant * Optional, long nOptionalSize);
Overview | Refer to How to Program with the LEAD Raster HTTP Object

Remarks

Sends an HTTP request to the HTTP server.

This method can be used to send a request when it is not necessary to send additional data.

See Also

Elements: | InetHttpOpenRequest method, InetHttpSendBitmap method, InetHttpSendData method, InetHttpSendForm method
Topics: | Working with HTTP: Sending Data Over an HTTP Connection


StopFtpBrowseEvent property (ILEADRasterFTP)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL StopFtpBrowseEvent;
Overview | Refer to How to Program with the LEAD Raster FTP Object

Remarks

Specifies whether the browsing process should be stopped. Set this property during the FtpBrowse event to abort browsing. Possible values are:

Setting | Description
VARIANT_TRUE | Abort browsing.
VARIANT_FALSE | Continue browsing. This is the default value.

See Also

Elements: | FtpBrowse event, InetFtpBrowseDir method, InetFtpChangeDir method, InetFtpCreateDir method.
Topics: | Working with FTP: Directory Manipulation Over an FTP Connection


Raster Pro/Document/Medical Features

Raster Pro:

LEADTOOLS Raster Imaging Pro provides some imaging capabilities that are not available in the LEADTOOLS Raster Imaging product. In order to access these features, you must unlock them by calling UnlockSupport (L_SUPPORT_LTPRO, L_KEY_LTPRO). L_KEY_LTPRO can be found in ltkey.h.

If you are a licensed user of LEADTOOLS Raster Imaging, and would like to access Raster Imaging Pro features, you must contact Tech Support for information on obtaining a license and the unlock key for calling LSettings::UnlockSupport.

Document/Medical:

LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite are the most comprehensive imaging toolkits on the market. No other toolkit provides as many imaging features for color, gray-scale and black & white images in one development package, and for one price. These toolkits comprise LEAD's best code and are designed for the programmer who is looking for the fastest performance, and/or the most extensive color, document, and medical imaging capabilities available.

These toolkits contain powerful annotation capabilities and optimized document image processing filters, and high performance compression, decompression and viewing of JPEG, LEAD CMP, MRC and CCITT G3/G4. The annotation capabilities enable the programmer to add text, highlights, sticky notes, audio, ellipses, buttons, lines, arrows, rectangles, polygons, redaction (blackout), hotspots, freehand scribble, pointers, bitmap and text stamps, to black & white and color images. Programmers working with document imaging will also find special processing filters such as despeckle, deskew, favor black, and scale to gray to enhance their black and white 1 bit images. Additionally, you can achieve faster rotation in 90-degree increments by applying a rotated view perspective to the bitmap. These LEADTOOLS toolkits offer the fastest software-only JPEG decoder available.

LEADTOOLS Document Imaging

The LEADTOOLS Document Imaging toolkit contains all the features available in the LEADTOOLS Raster Imaging Pro. In addition, it contains the following capabilities:

Special functions for Document (bitonal) images. The LEADTOOLS functions for bitonal images are especially useful for working with images from black-and-white scanners or FAX machines. These functions let you do things such as automatically straighten (deskew) an image, remove spots (despeckle), or clarify a scaled display (using scale-to-gray and favor-black features).

Annotation. LEADTOOLS supports annotation of images by letting you overlay images with text, lines, shapes, arrows, buttons, highlights, hot spots, sticky notes, stamps, buttons, and sounds.

Fast rotation. LEADTOOLS achieves fast rotation in 90-degree increments by applying a rotated view perspective to the bitmap.

ISIS support. LEADTOOLS supports ISIS interfaces for driving scanning devices.

Faster compression and decompression. The Document/Medical editions work faster when loading and saving LEAD CMP, JPEG, and CCITT Group 3 and Group 4 images. The LEADTOOLS functions for loading and saving are the same in all products. The only difference is in performance.

1-bit Image Clean-up. The Document toolkits include support for removing dots, blobs, holes, inverted text, lines, borders, bumps and nicks from 1-bit images.

Region Clean-up. [Document/Medical] Remove all the holes from a region.

Embedded Messages. The Document toolkits include support for embedding messages in lossless image formats like bmp, tiff, lossless jpeg, etc. The message is embedded without any visible changes to the image, and does not appreciably increase the size of the image. The message is password-protected.

Image Conversion. The Document toolkits include support for transforming a bitmap into a binary image using specified thresholds or a threshold calculated automatically based on statistical features of the bitmap.

12 and 16 bit grayscale images. [Document/Medical] Load, process, display, window level and save 12 and 16 bit grayscale images (including support for 16-bit grayscale TIFF).

48 and 64 bit color images. [Document/Medical] Load, process, display, and save 48 and 64 bit color images.

MRC Support. [Document/Medical] LEADTOOLS supports the Mixed Raster Content format for color documents containing mixed image and text components. For more information, refer to the ..

Halftoning. [Document/Medical] Convert 1-, 4-, 8-, 16-, 24-, or 32-bit bitmaps to a halftoned bitmap, with a specified pattern rotation. A halftoned bitmap is a 1-bit bitmap that has been dithered for black and white printing or display.

LEADTOOLS Document Imaging Suite

The LEADTOOLS Document Imaging Suite toolkit contains all the capabilities of LEADTOOLS Document Imaging, and includes the features listed below. Please note that the OCR features are included in this toolkit, however they can also be purchased as a plug-in for the LEADTOOLS Document Imaging toolkit. Also, JBIG support is provided in this toolkit, however a JBIG Module may be added on to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite.

OCR features. [Document/Medical] LEAD offers OCR features that use Scansoft Textbridge technology. Support for these features is included in the LEADTOOLS Document Imaging Suite, and can be added, via plug-in to the LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite toolkits. The OCR features allow you to perform optical character recognition and turn images into documents. Features include preset confidence and accuracy levels for controlling how sensitive the engine is to unrecognized text, artificial intelligence for improving recognition on documents of the same type, and built-in and user-defined lexicons for limiting the type of text to recognize within a particular zone. LEADTOOLS provides the ability to verify or correct text during, and (using LEAD's unique OCR editor) after recognition. LEAD's OCR editor ties the text being edited directly to the image, providing a visual reference to the original bitmap data. The OCR engine can perform Automatic area segmentation creating multi-layered zones, recognizing areas such as tables, rules, images and text. Or, you can manually designate up to 250 such zones. The OCR features support different fonts, sizes (5 to 72 point) and styles. Fax, dot matrix and halftones can be preprocessed to improve recognition results. The OCR Engine supports major European and Scandinavian languages (Danish, Dutch, Finnish, French, German, Italian, Norwegian, Portuguese, Russian, Spanish, and Swedish) as well as English. Support for dialects such as US. English, French Canadian, Latin American Spanish, Swiss German, and Brazilian Portuguese is also provided.

Recognized text can be exported to more than 40 different formats, including MS Word, MS Excel, Dbase andWordPerfect. The LEADTOOLS OCR features contain superior OCR processing speeds, for use in form recognition and processing applications.

LEAD's JBIG filter. [Document/Medical] LEAD includes support for this filter in the LEADTOOLS Document Imaging Suite toolkit. Support for this filter can be added to LEADTOOLS Document Imaging, LEADTOOLS Medical Imaging or LEADTOOLS Medical Imaging Suite by purchasing the JBIG Module. JBIG defines a method for lossless compression encoding of a bi-level image (two-color image). This method can also be used for coding grayscale and color images. LEADTOOLS completely supports all three types of images, giving you the ability to make full use of this powerful compression technology. LEADTOOLS also supports the progressive capability of JBIG, allowing you to store and send multiple representations of images at different resolutions without any extra storage overhead.

LEADTOOLS Medical Imaging

LEADTOOLS Medical Imaging contains all the capabilities of LEADTOOLS Document Imaging. It also includes general medical imaging technologies (1-16,24,32 bit color, 1-16 bit grayscale and window leveling of 12 and 16-bit grayscale images) and support for the DICOM file format.

DICOM file support. [Medical] LEADTOOLS Medical Imaging provides COMPLETE support for the DICOM 3.0 specification, including all standard IOD classes and modalities (CR, CT, MR, NM, US, RF, SC, VL, etc.) and complete DICOM Basic Directory support.

Window leveling. [Document/Medical] Detect and set LowBit and HighBit for image data, display images with automatic LUT intensity expansion, or set LUT entries and ranges with specific values and gradients. Display images through the LUT without changing the data, or process the image data using the LUT. Linearize the number of pixels locally in a bitmap, based on the specified color space in order to bring out the detail in dark areas of an image, and smooth the edges between blocks.

Medical Imaging Processing. [Medical] LEADTOOLS Medical Imaging provides image processing functionality designed specifically to allow you to examine and improve the quality of medical images.

LEADTOOLS Medical Imaging Suite

LEADTOOLS Medical Imaging Suite contains all the capabilities of LEADTOOLS Medical Imaging. In addition, it supports the following:

DICOM Communication support. [Medical Suite] LEADTOOLS provides COMPLETE support for DICOM Communications, including all Service Classes (Verification, Storage, Query/Retrieve, Patient Management, etc), and contains high-level communications functions simplifying the creation of DICOM client/server applications.

(Document/Medical) is used in the documentation to designate the features that are available in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. Those features that are available only in the Medical toolkits are indicated in the documentation by (Medical). Features available only in the LEADTOOLS Medical Imaging Suite toolkit are indicated in the documentation by (Medical Suite).

(Internet only) is used in the documentation to designate the features that are available only in the LEADTOOLS Internet toolkit.

For more information, refer to Document/Medical Edition Support and Licensing Requirements.


Document/Medical Support and Licensing Requirements

Document/Medical Licensing and Royalty Agreements:

Congratulations! You have licensed one of the LEADTOOLS Document/Medical software products, the most comprehensive imaging toolkits on the market, enabling you to create powerful imaging applications. The license terms for LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite require runtime licensing based on the number of copies of your application that you deploy (i.e., distribute or install and use internally).

By paying the initial box price for the applicable LEADTOOLS product, you have obtained a development license, which entitles you to develop your application and test it. Once completed, if you wish to distribute the application or deploy it internally on multiple machines, you are required to enter into a duplication and distribution agreement with LEAD. You have the ability to choose from several licensing options depending on your volume needs.

The product you are installing is a fully functional working version and includes support for all features in LEADTOOLS Document Imaging, LEADTOOLS Document Imaging Suite, LEADTOOLS Medical Imaging and LEADTOOLS Medical Imaging Suite. (Depending on which product you have licensed, some of the features may ultimately not be available to you. See the on-line help file for a product feature comparison.) Until you sign and return the correct licensing agreement, your application will display a "nag" message. Once LEAD receives the executed contract, we will provide you a password that will permit you to terminate the "nag" message for the product that you have licensed. In addition to providing the password, you must also use the no nag version of the LTKRN14N.DLL, found in the REDIST\NONAGLTKRN directory. This is also the version you must redistribute.

Duplication and Distribution Agreements

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.


Syntax

This is the internal syntax of the property, method, or event. The external syntax depends on the development system you are using. Refer to the code example for your system, or for general information, refer to the following:

Visual Basic Syntax

Visual C++ 5.0 Syntax


Topic Selection

LEAD Technologies, Inc.
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

Sales@Leadtools.com
www.leadtools.com

(704) 332-5532
FAX: (704) 372-8161
Tech Support: (704) 372-9681

LEADTOOLS is ideal for developers involved in still frame, multimedia, document, medical, and vector imaging projects, including Internet/Intranet applications. Independent of the specific application requirement – scanning, file format support/conversion, compression, image processing, annotation, database support, multimedia, etc. – LEADTOOLS provides the most comprehensive, robust, flexible, and powerful imaging solution available.

Click this button to start the Licensing help file to review the License Agreements governing your use of the software.

Click this button to start the Products help file to review the full line of LEADTOOLS Products.

Click this button to start the Imaging help file to review the full line of LEADTOOLS Image Categories.


AccessTime Parameter For FtpBrowse

AccessTime

Specifies a VARIANT containing the time that the file was last accessed.


CreateTime Parameter For FtpBrowse

CreateTime

Specifies a VARIANT containing the time the file was created.


FileAttrib Parameter For FtpBrowse

FileAttrib

Specifies the file attributes of the file that was found. Possible values are:

Value | Meaning
FTP_FILE_ATTRIBUTE_ARCHIVE | The file or directory is an archive file or directory. Applications use this attribute to mark files for backup or removal.
FTP_FILE_ATTRIBUTE_COMPRESSED | The file or directory is compressed. For a file, this means that all of the data in the file is compressed. For a directory, this means that compression is the default for newly created files and subdirectories.
FTP_FILE_ATTRIBUTE_DIRECTORY | The handle identifies a directory.
FTP_FILE_ATTRIBUTE_ENCRYPTED | The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and subdirectories.
FTP_FILE_ATTRIBUTE_HIDDEN | The file or directory is hidden. It is not included in an ordinary directory listing.
FTP_FILE_ATTRIBUTENORMAL | The file or directory has no other attributes set. This attribute is valid only if used alone.
FTP_FILE_ATTRIBUTE_OFFLINE | The file data is not immediately available. This attribute indicates that the file data has been physically moved to offline storage. This attribute is used by Remote Storage, the hierarchical storage management software in Windows 2000. Applications should not arbitrarily change this attribute.
FTP_FILE_ATTRIBUTE_READONLY | The file or directory is read-only. Applications can read the file but cannot write to it or delete it. In the case of a directory, applications cannot delete it.
FTP_FILE_ATTRIBUTE_REPARSE_POINT | The file has an associated reparse point.
FTP_FILE_ATTRIBUTE_SPARSE_FILE | The file is a sparse file.
FTP_FILE_ATTRIBUTE_SYSTEM | The file or directory is part of the operating system or is used exclusively by the operating system.
FTP_FILE_ATTRIBUTE_TEMPORARY | The file is being used for temporary storage. File systems attempt to keep all of the data in memory for quicker access, rather than flushing it back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed.


LastWriteTime Parameter For FtpBrowse

LastWriteTime

Specifies a VARIANT containing the time that the file was last written to.


pszFile Parameter For FtpBrowse

pszFile

String that contains the file name.


uFileSize Parameter For FtpBrowse

uFileSize

Specifies the file size in bytes.


pszSearch Parameter For InetFtpBrowseDir

pszSearch

String that specifies a valid directory path or file name for the FTP server's file system. The string can contain wildcards, but no blank spaces are allowed. If the value of pszSearch is NULL or if it is an empty string, it will find the first file in the current directory on the server.


Return for InetFtpBrowseDir

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


pszDirectory Parameter For InetFtpChangeDir

pszDirectory

String that contains the name of the directory to change to on the remote system. This can be either a fully qualified path or a name relative to the current directory.


Return for InetFtpChangeDir

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


nPort Parameter For InetFtpConnect

nPort

Number of the TCP/IP port on the server to connect to.

These flags set only the port that will be used. Use the default port for FTP servers INTERNET_DEFAULT_FTP_PORT (port 21).


pszPassword Parameter For InetFtpConnect

pszPassword

String that contains the password to use when logging on. If both pszPassword and pszUserName are NULL, the method uses the default "anonymous" password.


pszServer Parameter For InetFtpConnect

pszServer

String that contains the host name of an FTP server. This can be a URL, like www.leadtools.com, or it can contain the IP number of the site, in ASCII dotted-decimal format (for example, "11.0.1.45").


pszUserName Parameter For InetFtpConnect

pszUserName

String that contains the name of the user logging on. If this parameter is NULL, the method uses the default "anonymous".


Return for InetFtpConnect

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


pszRemoteDir Parameter For InetFtpCreateDir

pszRemoteDir

String that contains the name of the directory to create on the FTP server. This can be either a fully qualified path or a name relative to the current directory.


Return for InetFtpCreateDir

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


pszRemoteDir Parameter For InetFtpDeleteDir

pszRemoteDir

String that contains the name of the directory to remove on the FTP server. This can be either a fully qualified path or a name relative to the current directory.


Return for InetFtpDeleteDir

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


pszRemote Parameter For InetFtpDeleteFile

pszRemote

String that contains the name of the file to delete on the FTP server.


Return for InetFtpDeleteFile

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


Return for InetFtpDisconnect

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


Return for InetFtpGetCurrentDir

Return Value

String that contains the absolute path to the current directory.


bOverwrite Parameter For InetFtpGetFile

bOverwrite

Boolean flag that indicates whether the method should proceed if a local file of the specified name already exists. Possible values are:

Value | Meaning
TRUE | The local file will be overwritten.
FALSE | If the file already exists locally, then do not store the file locally.


pszLocal Parameter For InetFtpGetFile

pszLocal

String that contains the name of the file to create on the local system.


pszRemote Parameter For InetFtpGetFile

pszRemote

String that contains the name of the file to retrieve from the FTP server.


Return for InetFtpGetFile

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


uSendAs Parameter For InetFtpGetFile

uSendAs

Flag that indicates the conditions under which the transfers occur. Valid values are:

Value | Meaning
SENDAS_ASCII | The file is sent using FTP's ASCII transfer method. Formatting information is translated to local equivalents.
SENDAS_BINARY | The file is sent using FTP's Image transfer method. No conversion is performed.


pszNew Parameter For InetFtpRenameFile

pszNew

String that contains the new name for the remote file.


pszOld Parameter For InetFtpRenameFile

pszOld

String that contains the name of the file that will have its name changed on the remote FTP server.


Return for InetFtpRenameFile

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


nBitsPerPixel Parameter For InetFtpSendBitmap

nBitsPerPixel

Resulting file's pixel depth.

Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files


nFormat Parameter For InetFtpSendBitmap

nFormat

Output file format. For valid values, refer to Formats of Output Files


nQFactor Parameter For InetFtpSendBitmap

nQFactor

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors


pRaster Parameter For InetFtpSendBitmap

pRaster

LEAD Raster Object containing the bitmap to send.


pszRemote Parameter For InetFtpSendBitmap

pszRemote

String that contains the name of the file to create on the remote system.


Return for InetFtpSendBitmap

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


uSendAs Parameter For InetFtpSendBitmap

uSendAs

Flag that indicates the conditions under which the transfers occur. Valid values are:

Value | Meaning
SENDAS_ASCII | The file is sent using FTP's ASCII transfer method. Formatting information is translated to local equivalents.
SENDAS_BINARY | The file is sent using FTP's Image transfer method. No conversion is performed.


pszLocal Parameter For InetFtpSendFile

pszLocal

String that contains the name of the file to send from the local system.


pszRemote Parameter For InetFtpSendFile

pszRemote

String that contains the name of the file to create on the FTP server.


Return for InetFtpSendFile

Return Value

Return | Meaning
0 | The function was successful.
<>0 | an error occurred. Refer to Error Codes


uSendAs Parameter For InetFtpSendFile

uSendAs

Flag that indicates the conditions under which the transfers occur. Valid values are:

Value | Meaning
SENDAS_ASCII | The file is sent using FTP's ASCII transfer method. Formatting information is translated to local equivalents.
SENDAS_BINARY | The file is sent using FTP's Image transfer method. No conversion is performed.


Return for InetHttpCloseRequest

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


nPort Parameter For InetHttpConnect

nPort

Number of the port to which to connect. The default port assignment for internet servers is 80.


pszPassword Parameter For InetHttpConnect

pszPassword

String containing the password to be used for authentication.


pszServer Parameter For InetHttpConnect

pszServer

String that contains the name of the server to which to connect. The name can be a network name, an IP address, or a domain name (e.g. www.leadtools.com).


pszUserName Parameter For InetHttpConnect

pszUserName

String containing the username to be used for authentication.


Return for InetHttpConnect

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


Return for InetHttpDisconnect

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


nIndex Parameter For InetHttpFormValues

nIndex

Index into the array.


Return for InetHttpGetResponse

Return Value

String containing the server's last response information.


nStatus Parameter For InetHttpGetServerStatus

nStatus

Variable to be updated with the status of the HTTP server. Possible values are:

Value | Description
HTTP_STATUS_OK | (200) request completed
HTTP_STATUS_CREATED | (201) object created, reason = new URI
HTTP_STATUS_ACCEPTED | (202) asynchronous completion (TBS)
HTTP_STATUS_PARTIAL | (203) partial completion
HTTP_STATUS_NO_CONTENT | (204) no info to return
HTTP_STATUS_RESET_CONTENT | (205) request completed, but clear form
HTTP_STATUS_PARTIAL_CONTENT | (206) partial GET fulfilled
HTTP_STATUS_AMBIGUOUS | (300) server couldn't decide what to return
HTTP_STATUS_MOVED | (301) object permanently moved
HTTP_STATUS_REDIRECT | (302) object temporarily moved
HTTP_STATUS_REDIRECT_METHOD | (303) redirection w/ new access method
HTTP_STATUS_NOT_MODIFIED | (304) if-modified-since was not modified
HTTP_STATUS_USE_PROXY | (305) redirection to proxy, location header specifies proxy to use
HTTP_STATUS_REDIRECT_KEEP_VERB | (307) HTTP/1.1: keep same verb
HTTP_STATUS_BAD_REQUEST | (400) invalid syntax
HTTP_STATUS_DENIED | (401) access denied
HTTP_STATUS_PAYMENT_REQ | (402) payment required
HTTP_STATUS_FORBIDDEN | (403) request forbidden
HTTP_STATUS_NOT_FOUND | (404) object not found
HTTP_STATUS_BAD_METHOD | (405) method is not allowed
HTTP_STATUS_NONE_ACCEPTABLE | (406) no response acceptable to client found
HTTP_STATUS_PROXY_AUTH_REQ | (407) proxy authentication required
HTTP_STATUS_REQUEST_TIMEOUT | (408) server timed out waiting for request
HTTP_STATUS_CONFLICT | (409) user should resubmit with more info
HTTP_STATUS_GONE | (410) the resource is no longer available
HTTP_STATUS_LENGTH_REQUIRED | (411) the server refused to accept request w/o a length
HTTP_STATUS_PRECOND_FAILED | (412) precondition given in request failed
HTTP_STATUS_REQUEST_TOO_LARGE | (413) request entity was too large
HTTP_STATUS_URI_TOO_LONG | (414) request URI too long
HTTP_STATUS_UNSUPPORTED_MEDIA | (415) unsupported media type
HTTP_STATUS_SERVER_ERROR | (500) internal server error
HTTP_STATUS_NOT_SUPPORTED | (501) required not supported
HTTP_STATUS_BAD_GATEWAY | (502) error response received from gateway
HTTP_STATUS_SERVICE_UNAVAIL | (503) temporarily overloaded
HTTP_STATUS_GATEWAY_TIMEOUT | (504) timed out waiting for gateway
HTTP_STATUS_VERSION_NOT_SUP | (505) HTTP version not supported


Return for InetHttpGetServerStatus

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


nType Parameter For InetHttpOpenRequest

nType

Specifies the type of request. Possible values are:

Value | Meaning
HTTP_RQST_GET | Send an HTTP-GET Request
HTTP_RQST_PUT | Send an HTTP-PUT Request
HTTP_RQST_POST | Send an HTTP- POST Request


pszReferer Parameter For InetHttpOpenRequest

pszReferer

String that specifies the address (URL) of the document on which the link is found. If this parameter is NULL, no "referrer" is specified.


pszTarget Parameter For InetHttpOpenRequest

pszTarget

String that contains the name of the file, executable module, or search specifier to get, put or post.


pszVersion Parameter For InetHttpOpenRequest

pszVersion

String that contains the HTTP version. If this parameter is NULL, "HTTP/1.0" is used as the version.


Return for InetHttpOpenRequest

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


nBitsPerPixel Parameter For InetHttpSendBitmap

nBitsPerPixel

Resulting file's pixel depth. Note that not all bits per pixel are available to all file formats. For valid values, refer to Formats of Output Files


nFormat Parameter For InetHttpSendBitmap

nFormat

Output file format. For valid values, refer to Formats of Output Files


nQFactor Parameter For InetHttpSendBitmap

nQFactor

This parameter is used when saving an image file to LEAD or JPEG formats. Qfactor is a number that determines the degree of loss in the compression process.

For possible values, refer to Compression Quality Factors .


pNameValue Parameter For InetHttpSendBitmap

pNameValue

The name/value pair for this image, sent as a NAMEVALUEItem object. This argument is used to get the information from a script on the server machine. The NAMEVALUEItem object has 2 properties:

Property | Description
BSTR pszName | This name is usually some user defined name.
BSTR pszValue | This value is usually the filename of the image.


pRaster Parameter For InetHttpSendBitmap

pRaster

LEAD Raster Object containing the bitmap to be saved.


pszContentType Parameter For InetHttpSendBitmap

pszContentType

A string describing the content type. This string is usually formatted type/subtype where type is the general content category and subtype is the specific content type. For a full list of supported content types, see your Internet browser documentation or the current HTTP specification.


Return for InetHttpSendBitmap

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


pData Parameter For InetHttpSendData

pData

An ILEADRasterVariant object that contains the data to send in the HTTP request.


pNameValue Parameter For InetHttpSendData

pNameValue

The name/value pair for this image, sent as a NAMEVALUEItem object. This argument is used to get the information from a script on the server machine. This name is usually some user-defined name and the value is a filename of the data. The NAMEVALUEItem object has 2 properties:

Property | Description
BSTR pszName | This name is usually some user defined name.
BSTR pszValue | This value is usually the filename of the image.


pszContentType Parameter For InetHttpSendData

pszContentType

A string describing the content type. This string is usually formatted type/subtype where type is the general content category and subtype is the specific content type. For a full list of supported content types, see your Internet browser documentation or the current HTTP specification.


Return for InetHttpSendData

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


uSize Parameter For InetHttpSendData

uSize

Size of pData.


Return for InetHttpSendForm

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes


Header Parameter For InetHttpSendRequest

Header

Specifies any additional header data to be sent along with the request. This value can be NULL.


nHeaderSize Parameter For InetHttpSendRequest

nHeaderSize

Size of the header information.


nOptionalSize Parameter For InetHttpSendRequest

nOptionalSize

Size of the optional data.


Optional Parameter For InetHttpSendRequest

Optional

Specifies any optional data to be sent after the HTTP header.


Return for InetHttpSendRequest

Return Value

Return | Meaning
0 | The function was successful.
<>0 | An error occurred. Refer to Error Codes