Introduction

The LEADTOOLS Internet features are included as part of the LEADTOOLS Raster Pro and above toolkits. The LEADTOOLS Internet Class Library provides C++ classes, which provide the ability to add Internet functionality to your application. LEADTOOLS Internet Class Library includes the following dynamic link library developed by LEAD Technologies, Inc.:

LTNET14N.DLL is a dynamic link library for incorporating Internet functionality, including video conferencing, into your applications.

The Internet functionality requires Winsock 2.0 to be installed.

Executable demos are included in all LEADTOOLS products. The executable demos provide a quick and easy way to evaluate the Internet features and performance.

NOTE: Please note that the LTNET14N.DLL and this help file also contain functions for sending and responding to messages between local and remote computers.

The Internet features come in a WIN32 edition so that it can support development of software applications for any of the following environments:

Windows 3.x NT
Windows 4.x NT
Windows 95


Example Programs

The following example programs are in separate EXAMPLES\CLASSLIB\ subdirectories (such as C:\LEAD14\EXAMPLES\CLASSLIB\MSVC5). The executable files for these examples were compiled with Document/Medical editions capabilities of the toolkit. To get Document/Medical editions capabilities, you must buy a LEADTOOLS Document/Medical toolkit. Otherwise, if you recompile the examples, the resulting executable files will not have the Document/Medical editions capabilities.

Note: | You can run the example programs on your system by clicking the appropriate buttons in online help. If you try to run an example program that is not on your system, an error message will appear.
NETCAP | Internet/Capture Demo demonstrates the Capture and Internet capabilities of the LEADTOOLS Internet features in one application.
NETCMD | Internet Commands Demo demonstrates how to send commands over the Internet.


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

Changes from Version 12 to Version 12.1

Changes from Version 11.5 to Version 12

Version 11.5


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS Internet Class Library has not changed from Version 14.


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS Internet Class Library has changed from Version 13 as follows:

LEADTOOLS Internet Class Library now supports UNICODE.


Changes from Version 12.1 to Version 13

Version 13 of the LEADTOOLS Internet Class Library has not changed from Version 12.1.


Changes from Version 12 to Version 12.1

Version 12.1 of the LEADTOOLS Internet Class Library has not changed from Version 12. Please note that the Internet functions contained in this help file were previously located in the LEADTOOLS Multimedia Class Library help file.

The LEADTOOLS Multimedia toolkits currently include many of the functions documented in the Ltnetlibn.hlp help file. This is the final version of the LEADTOOLS Multimedia toolkit that will contain those functions. In future releases, the functions documented in the Ltnetlibn.hlp help file will only be available in the LEADTOOLS Internet Imaging toolkits.


Changes from Version 11.5 to Version 12

Version 12 of the LEADTOOLS Internet Class Library has changed from version 11.5 as follows:

LEADTOOLS now provides functions for sending commands and responses between local and remote computers. This provides a means of using a "super computer" to store and process large numbers of images, while using a smaller, remote computer to send commands indicating which process to perform and which image to use.

Now uses DirectShow 6.0

Programmatic configuration of video/audio codes has been added.

More control over saving audiostreams has been added.

Additional Windows NT compatibility is now provided.

The rest of this topic lists the new functions in version 12.

LInet::CommandCallback

LInet::ResponseCallback

LInet::SendAttachBitmapCmd

LInet::SendAttachBitmapRsp

LInet::SendCloseWinCmd

LInet::SendCloseWinRsp

LInet::SendCmd

LInet::SendCreateWinCmd

LInet::SendCreateWinRsp

LInet::SendFreeBitmapCmd

LInet::SendFreeBitmapRsp

LInet::SendLoadCmd

LInet::SendLoadRsp

LInet::SendRsp

LInet::SendSaveCmd

LInet::SendSaveRsp

LInet::SendSetRectCmd

LInet::SendSetRectRsp

LInet::SendShowWinCmd

LInet::SendShowWinRsp

LInet::SendSizeWinCmd

LInet::SendSizeWinRsp

LInetPacket::SetExtraData

LInetPacket::SetFormats


Version 11.5

Version 11.5 is the first version of the LEADTOOLS Internet Class Library.

LEADTOOLS now supports a Multimedia class (LMultimedia), a Multimedia Internet class (LInet) and a Multimedia Capture class (LMMCapture).

The rest of this topic lists the new functions by class.

LInet

LInet::LInet

LInet::~LInet

LInet::AcceptConnect

LInet::AddWndItem

LInet::ClearQueue

LInet::Close

LInet::CloseAll

LInet::Connect

LInet::CreateWnd

LInet::EnableAutoProcess

LInet::EnableAutoWnd

LInet::ExistsItem

LInet::ExpandWnd

LInet::GetFirstItem

LInet::GetHandle

LInet::GetHostName

LInet::GetItem

LInet::GetItemsCount

LInet::GetLastItem

LInet::GetNextItem

LInet::GetPrevItem

LInet::GetQueueSize

LInet::IsAutoProcessEnabled

LInet::IsAutoWndEnabled

LInet::IsValid

LInet::IsWndItem

LInet::m_pUserDataEx

LInet::OnClose

LInet::OnConnect

LInet::OnConnectRequest

LInet::OnDataReady

LInet::OnDataReceiving

LInet::OnDataSending

LInet::OnDataSent

LInet::OnDataStart

LInet::OnImageReceived

LInet::OnMMediaReceived

LInet::OnSoundReceived

LInet::OnUser1Received

LInet::OnUser2Received

LInet::OnUser3Received

LInet::OnUser4Received

LInet::operator =

LInet::ReadData

LInet::RemoveAllWndItems

LInet::RemoveWndItem

LInet::SendBitmap

LInet::SendData

LInet::SendRawData

LInet::SendSound

LInet::ServerInit

LInet::ServerShutDown

LInet::SetImageWindow

LInet::ShutDown

LInet::StartUp


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.

Address and Contact Information

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

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


Implementing Internet Functionality

The LEADTOOLS Internet features provide Internet functions that allow you to create client server applications that transfer data over the Internet or local intranets. The first step to implementing network capabilities is to initialize the LEADTOOLS Internet DLL using LInet::StartUp. All of the LEADTOOLS Internet functions require that a network connection be established. You can connect to a remote computer using LInet::Connect. This generates a call to LInet::OnConnectRequest on the server. You can setup a local computer to act as a server and listen for incoming connection requests using LInet::ServerInit. If your application is acting as a server, it can accept connection requests using LInet::AcceptConnect. This generates a call to LInet::OnConnect on the client. You can determine who is connected to your server using LInet::GetHostname. To close an open network connection or to shutdown a local server, use LInet::Close.

While a network connection is open, you can:

1. transfer data and sound between local and remote computers

2. send commands and responses between a local and a remote computer

The LInet class provides users the functionality to retrieve any remote computer connected to the user's computer, either client or server, through the LInet class internal list. To get an LInet class pointer for a remote computer use LInet::GetItem by passing the index of the desired computer or its handle. You can: get the next remote computer by calling LInet::GetNextItem, get the prevoius remote computer by calling LInet::GetPrevItem, get the last remote computer in the connection list by calling LInet::GetLastItem, and get the first remote computer by calling LInet::GetFirstItem. In addition, you can view the list of the connections by calling LInet::CreateWnd and expanding or collapsing the window (since the window is a tree view control), using LInet::ExpandWnd. Items may be added to the window by calling LInet::AddWndItem, or removed from the window using LInet::RemoveWndItem. To determine whether an item is in the window, call LInet::IsWndItem.


Sending Commands and Responses

LEADTOOLS provides a number of functions that allow you to send commands and responses between a local and a remote computer. This provides a means of using a "super computer" to store and process large numbers of images, while using a smaller, remote computer to send commands indicating which process to perform and which image to use.

In order to receive commands, a class must be derived from LInet and the CommandCallBack member function overridden, on the computer that will be receiving commands. The supported command functions include the following:

LInet::SendCmd

LInet::SendLoadCmd

LInet::SendSaveCmd

LInet::SendCreateWinCmd

LInet::SendAttachBitmapCmd

LInet::SendSizeWinCmd

LInet::SendCloseWinCmd

LInet::SendShowWinCmd

LInet::SendSetRectCmd

LInet::SendFreeBitmapCmd

When a computer receives a command, the CommandCallBack function is called. The computer that receives the command should then send a response to the computer that sent the command. The supported response functions include the following:

LInet::SendRsp

LInet::SendLoadRsp

LInet::SendSaveRsp

LInet::SendCreateWinRsp

LInet::SendAttachBitmapRsp

LInet::SendSizeWinRsp

LInet::SendCloseWinRsp

LInet::SendShowWinRsp

LInet::SendSetRectRsp

LInet::SendFreeBitmapRsp

To receive responses, the computer that sent the original command must derive a class from LInet and override the ResponseCallback member function.

While the LInet::SendLoadCmd, LInet::SendLoadRsp, LInet::SendSaveCmd, LInet::SendSaveRsp, etc. provide standard image processing commands and responses, the LInet::SendCmd and LInet::SendRspfunctions provide a means of creating user-defined commands and responses. These commands and responses may require sending extra data, in the form of a packet, along with the command or the response. LEADTOOLS provides functions in the LInetPacket class for creating packets and adding or setting extra data and parameter data. These functions are LInetPacket::LInetPacket, LInetPacket::~LInetPacket, LInetPacket::SetExtraData and LInetPacket::SetFormats. For a diagram of a client server set-up for sending commands and responses, refer to A Client-Server Diagram: Sending Commands and Responses.


A Client Server Diagram: Sending Commands and Responses

The diagram given below shows a simple example of a Client - Server connection and a series of function calls used to send commands and responses.

Client | Action | Server
LInet::StartUp | Initialize the LEADTOOLS Internet DLL. | LInet::StartUp
 | Set the computer to act as a server and listen for connection requests | LInet::ServerInit
LInet::Connect | --------------------------------------------------> The client requests a connection with the server. This generates a call to the LInet::OnConnectRequest on the server. |
LInet::OnConnect | <-------------------------------------------------- The server accepts the connection request. This generates a call to the LInet::OnConnect function on the client. | LInet::AcceptConnect
 | The server must override the LInet::CommandCallBack function so it will be notified of commands received from the client. The client must override the LInet::ResponseCallBack function so it will be notified of responses received from the server. |
LInet::SendLoadCmd | --------------------------------------------------> The client sends a load command to the server to load a specific image. This generates a call to the LInet::CommandCallBack on the server. | LInet::CommandCallBack
LInet::ResponseCallBack | <-------------------------------------------------- The server receives the load command and responds by calling LInet::SendLoadRsp . This generates a call to the LInet::ResponseCallBack function on the client. | LInet::SendLoadRsp
LInet::SendCmd | --------------------------------------------------> The client sends a flip command using the LInet::SendCmd function. This generates another call to the LInet::CommandCallBack function on the server. | LInet::CommandCallBack
LInet::ResponseCallBack | <-------------------------------------------------- The server calls LInet::SendRsp in response to receiving the LInet::SendCmd call from the client. This generates another call to the LInet::ResponseCallBack function on the client. | LInet::SendRsp
LInet::SendSaveCmd | --------------------------------------------------> The client sends a save command using the LInet::SendSaveCmd function. This generates another call to the LInet::CommandCallBack function on the server. | LInet::CommandCallBack
LInet::ResponseCallBack | <-------------------------------------------------- The server calls LInet::SendSaveRsp in response to receiving the LInet::SendSaveCmd call from the client. This generates another call to the LInet::ResponseCallBack function on the client. | LInet::SendSaveRsp
LInet::Close | The client has finished sending all the commands and closes the connection to the server. | LInet::OnClose


Transferring Data and Sound

A Transferring Data and Sound

While a network connection is open, you can transfer data and sound between local and remote computers. There are two ways to send data, with LEADTOOLS header information and without LEADTOOLS header information (raw). To send data in any of the LEADTOOLS supported image file formats with LEADTOOLS' header information, use LInet::SendData. You can enable auto processing for the receiving computer by calling LInet::EnableAutoProcess to allow LEADTOOLS to check the received data and automatically load it into the appropriate data structure if LEADTOOLS' headers are found. To send data without LEADTOOLS's header information, use LInet::SendRawData. Transferred data will be received by the remote computer in the INETCALLBACK function. If auto process is disabled, the data must be manually read and processed using LInet::ReadData. To send sound data, use LInet::SendSound.

To abort a data transfer use LInet::ClearQueue. Use LInet::GetQueueSize to find out how much data is currently in the LEADTOOLS internal network send queue. When the Internet session is finished, call LInet::ShutDown to shut down the LEADTOOLS Internet DLL and free any memory associated with the Internet DLL.


Sending and Receiving Data

The diagram given below shows a simple example of an Internet connection between two computers and a series of function calls used when sending and receiving data.

Computer A

Action

Computer B

LInet::Connect

LInet::OnConnect

Step 1.

---------------------------------->
Computer A requests a connection with Computer B. This generates a call to the OnConnect callback function on the Computer A. Side.

If the connection process from the Computer A side was successful go to step 2.

Step 2.

OnConnectRequest callback function will be generated on Computer B. side in response to the connection request from Computer A.

LInet::OnConnectRequest

Step 3.

<-----------------------------------
Computer B accepts the connection request by calling AcceptConnect.

LInet::AcceptConnect

LInet::SendBitmap

Connection established.

And

Computer A wants to send some kind of data, for example image data:

Step 4.

---------------------------------->

LInet::OnDataSending

LInet::OnDataSent

Step 5.

On the Computer A side, the following callback functions are generated to let Computer A know the data is being sent or has been sent:
LInet::OnDataSending and
LInet::OnDataSent

------------------------------------>
Calls to the following functions are generated on Computer B.

LInet::OnDataStart
LInet::OnDataReceiving
LInet::OnDataReady
LInet::OnImageReceived

LInet::OnDataStart
LInet::OnDataReceiving

LInet::OnDataReady

LInet::OnImageReceived


Internet 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 Internet features is created:

REDIST\VIDEO

Redistributable Internet features files.

The LEADTOOLS Internet features require Microsoft DirectShow 6.0 for the Internet functionality and it requires Winsock 2.0 for the Internet functionality. You will be given the opportunity to install one, both or neither of these during installation. If you do not install these during installation, you may install them later using the DirectShow 6.0 Installation and the Winsock 2.0 Installation under LEADTOOLS 14 ActiveXs Registration.

Note: | The Internet 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.
Note: | You may not distribute the header files with your application, and you may not provide software development capabilities in your application.

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

Please note that LTKRN and LTWVC are required for ALL Class Library applications. For more information on LTKRN, LTWVC and other files for the Main Class Library, 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:
LTNET | Internet support. LTNET14N.DLL is the LEADTOOLS Internet Support DLL. Also requires the LTFIL DLL and the LEAD file format DLLs. Additional required files are installed by WS2SETUP.EXE (Winsock 2.0). | DLL: LTNET14N.DLL Library: LTNET_N.LIB. | DLL: LTNET14NU.DLL Library: LTNET_NU.LIB. | DLL: LTNET14E.DLL Library: LTNET_E.LIB. | DLL: LTNET14EU.DLL Library: LTNET_EU.LIB.


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.


LInet

Description

The LInet class provides Internet functions that allow you to create client server applications that transfer data over the Internet or local intranets. It includes functions for handling connections via network, and reading and sending data. This class also includes functions to control a list of computers connected to the local computer.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Class Members, Class Hierarchy Chart


LInet::Class Members

Data Members

Member Functions

Return to LInet


LInet::Data Members

LInet::m_pUserDataEx


LInet::Member Functions

Constructors/Destructors

Connection Operations

Starting/Closing Network Session

Reading/Seding Data

Information

Operator

Connection List Item Operations

Connection List Control Operations & Image window

Overridables

Command Messages

Response Messages

Constructors / Destructors

LInet::LInet

LInet::~LInet

Connection Operations

LInet::Connect

LInet::GetHostName

LInet::Close

LInet::CloseAll

LInet::AcceptConnect

LInet::ServerInit

LInet::ServerShutdown

Starting/Closing a Network Session

LInet::StartUp

LInet::ShutDown

Reading / Sending Data

LInet::EnableAutoProcess

LInet::IsAutoProcessEnabled

LInet::ReadData

LInet::SendBitmap

LInet::SendData

LInet::SendRawData

LInet::SendSound

LInet::GetQueueSize

LInet::ClearQueue

General Information

LInet::GetHandle

LInet::IsValid

Operators

LInet::operator=

Connection List Item Operations

LInet::ExistsItem

LInet::GetItem

LInet::GetFirstItem

LInet::GetLastItem

LInet::GetNextItem

LInet::GetPrevItem

LInet::GetItemsCount

Connection List Control Operations and Image Window

LInet::CreateWnd

LInet::ExpandWnd

LInet::AddWndItem

LInet::RemoveWndItem

LInet::RemoveAllWndItems

LInet::EnableAutoWnd

LInet::IsAutoWndEnabled

LInet::IsWndItem

LInet::SetImageWindow

Overridables

LInet::OnConnect

LInet::OnDataReady

LInet::OnClose

LInet::OnConnectRequest

LInet::OnDataSent

LInet::OnDataSending

LInet::OnDataStart

LInet::OnDataReceiving

LInet::OnImageReceived

LInet::OnMMediaReceived

LInet::OnSoundReceived

LInet::OnUser1Received

LInet::OnUser2Received

LInet::OnUser3Received

LInet::OnUser4Received

LInet::CommandCallBack

LInet::ResponseCallBack

Return to LInet

Command Messages

LInet::CommandCallBack

LInet::SendCmd

LInet::SendLoadCmd

LInet::SendSaveCmd

LInet::SendCreateWinCmd

LInet::SendAttachBitmapCmd

LInet::SendSizeWinCmd

LInet::SendCloseWinCmd

LInet::SendShowWinCmd

LInet::SendSetRectCmd

LInet::SendFreeBitmapCmd

Response Messages

LInet::ResponseCallBack

LInet::SendRsp

LInet::SendLoadRsp

LInet::SendSaveRsp

LInet::SendCreateWinRsp

LInet::SendAttachBitmapRsp

LInet::SendSizeWinRsp

LInet::SendCloseWinRsp

LInet::SendShowWinRsp

LInet::SendSetRectRsp

LInet::SendFreeBitmapRsp


LInetPacket

Description

The LInetPacket class provides Internet packet functions that allow you to create packet objects that contain information used in sending commands and responses. It includes functions for setting a binary chunk of data and setting a variable number of parameters and their associated types. Both the binary chunk of data and the parameter data are optional.

Required Libraries

You must load all required libraries using LBase::LoadLibraries before using the classes.

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Class Members, Class Hierarchy Chart


LInetPacket::Class Members

Member Functions

Return to LInet


LInetPacket::Member Functions

Constructors/Destructors

Setting Data

Constructors / Destructors

LInetPacket::LInetPacket

LInetPacket::~LInetPacket

Setting Data

LInetPacket::SetExtraData

LInetPacket::SetFormats


Technical Support

As a registered user, free technical support is available. You must register your software to receive any technical support. Technical support is available 9 a.m. through 6 p.m. Eastern Standard Time. If you are calling by phone, please be at your computer. You can also contact us through the following methods:

Phone: | (704) 372-9681
E-mail: | support@leadtools.com
FAX: | (704) 372-8161
Home page: | http://www.leadtools.com
FTP: | ftp.leadtools.com

You can also contact LEAD by mail at:

LEAD Technologies, Inc.
Attn: Technical Support
Suite 400
1201 Greenwood Cliff
Charlotte, NC 28204

Before calling technical support, please look in the online documentation and the example programs for an answer to your question.


Internet Features Function Groups

Internet Functions

LInet Class Members

LInetPacket Class Members

Support Functions

Callbacks

Version and License Information


Support Functions: Callbacks

Support Functions:
Callbacks

Detecting the progress of a function:

LInet::OnConnect

LInet::OnDataReady

LInet::OnClose

LInet::OnConnectRequest

LInet::OnDataSent

LInet::OnDataSending

LInet::OnDataStart

LInet::OnDataReceiving

LInet::OnImageReceived

LInet::OnMMediaReceived

LInet::OnSoundReceived

LInet::OnUser1Received

LInet::OnUser2Received

LInet::OnUser3Received

LInet::OnUser4Received


Support Functions: Version and License Information

Support Functions:
Version and License Information

 LSettings::IsSupportLocked

LSettings::UnlockSupport

LBase::VersionInfo


Data Types

Basic Data Types and Keywords

LEADTOOLS Basic Data Types

Keywords Used in Declarations

Image and Toolkit Information Structures

BITMAPHANDLE

Structures Used with Input and Output Functions

WINDOWS Structures

List and Animation Data Types

HBITMAPLIST

Internet Command Structures

CMDTYPE

RECTTYPE

PARAMETER

PARMTYPE

COMMAND

RESPONSE

NAMEVALUE


LEADTOOLS Basic Data Types

LEADTOOLS has defined the following basic data types for portability:

Data Type | Definition and Usage
L_BITFIELD | Defined as L_UINT; used as a bit field.
L_BOOL | Defined as L_UINT; used as a boolean value.
L_CHAR | Defined as char; used as a signed 8-bit integer.
L_DOUBLE | Defined as double; used as a double precision floating point number.
L_FLOAT | Defined as float; used as a floating point number.
L_INT | Defined as int; used as a signed integer, 16-bits or larger.
L_INT16 | Defined as short; used as a signed 16-bit integer.
L_INT32 | Defined as long; used as a signed 32-bit integer.
L_UCHAR | Defined as unsigned char; used as an unsigned 8-bit integer.
L_UINT | Defined as unsigned; used as an unsigned integer, 16-bits or larger.
L_UINT16 | Defined as unsigned short; used as an unsigned 16-bit integer.
L_UINT32 | Defined as unsigned long; used as an unsigned 32-bit integer.
L_VOID | Defined as void; used as a void.
L_COMP | Defined as L_UINT; used as a handle to a computer
L_MEDIA | Defined as L_VOID L_FAR *; used as a void pointer
L_TCHAR | Defined as either char or TCHAR. If FOR_UNICODE is defined, then L_TCHAR will be defined as TCHAR.


Keywords Used in Declarations

LEADTOOLS uses the following keywords in declarations of functions, structures, and datatypes:

Keyword | Definition and Usage
L_FAR | Defined as nothing; used as a placeholder.
L_HUGE | Defined as nothing; used as a placeholder.
L_EXPORT | Defined as nothing; used as a placeholder.
L_PASCAL | Defined as nothing; used as a placeholder.
EXT_FUNCTION | Defined as WINAPI; used as an attribute for all toolkit functions.
pEXT_FUNCTION | Defined as EXT_FUNCTION L_FAR *; used as an attribute when defining pointers to toolkit functions.
EXT_CALLBACK | Defined as _cdecl L_FAR; used as an attribute for all toolkit callback functions.
pEXT_CALLBACK | Defined as EXT_CALLBACK L_FAR *; used as an attribute when defining pointers to toolkit callback functions.


BITMAPHANDLE

The BITMAPHANDLE structure serves as a working area for image manipulation and conversion. LEADTOOLS functions use this structure as a bitmap handle for accessing the image in memory and for maintaining the characteristics of the image.

Note:

Fields intended for internal use, such as the pointer to the bitmap, are omitted from the table. If necessary, you can refer to the LTKRN.H header file which describes the entire structure.

Member | Data Type | Description
Width | L_INT | Image width in pixels.
Height | L_INT | Image height in pixels.
BitsPerPixel | L_INT | Number of bits per pixel.
BytesPerLine | L_UINT | Bytes per line, rounded upward to the nearest multiple of four.
Flags.Allocated | L_BITFIELD | TRUE if the bitmap is allocated.
Flags.ConventionalMemory | L_BITFIELD | TRUE if the bitmap is allocated using conventional memory.
Flags.DiskMemory | L_BITFIELD | TRUE if the bitmap is allocated using LEAD's own virtual memory.
Flags.LockedMemory | L_BITFIELD | TRUE if the bitmap memory is locked down.
Flags.Progressive | L_BITFIELD | TRUE if an image is being loaded from a progressive JPEG file.
Flags.Tiled | L_BOOL | TRUE if the bitmap is a tiled bitmap.
Flags.WaitUserInput | L_BITFIELD | TRUE if the animation playback waits for user input.
Flags.Transparency | L_BITFIELD | TRUE if the animation playback uses transparency.
Flags.Compressed | L_BITFIELD | TRUE if the current bitmap is in 1-bit RLE-compressed format. For information about this format, refer to Speeding Up 1-Bit Documents .
Flags.Signed | L_BITFIELD | TRUE if the pixel values in the bitmap are signed.
nColors | L_INT | Number of colors (256 or less) that the bitmap has. If the image has more than 256 colors, this value is zero.
hPalette | HPALETTE | Handle to the image's palette. It can be an optimized palette or a fixed palette.
ViewPerspective | L_INT | Where the beginning of the image is stored. Valid values are TOP_LEFT, BOTTOM_LEFT, TOP_RIGHT, BOTTOM_RIGHT, TOP_LEFT90, and TOP_LEFT270. For descriptions, refer to Accounting for View Perspective .
Order | L_INT | Color order of the bitmap. Possible values are ORDER_RGB, ORDER_BGR and ORDER_GRAY.
Size | L_UINT32 | Size of the bitmap image data, in bytes.
DitheringMethod | L_UINT | Dithering method (referenced by some functions). For possible values, refer to the LBitmapSettings::DefaultDithering function.
XResolution | L_INT | Horizontal resolution, in dots per inch. Some file formats save this value in the file header.
YResolution | L_INT | Vertical resolution, in dots per inch. Some file formats save this value in the file header.
Left | L_INT | Left offset for animation playback.
Top | L_INT | Top offset for animation playback, based on a TOP_LEFT view perspective.
Delay | L_UINT32 | Animation playback delay in milliseconds (ms).
Background | COLORREF | Background color for animation playback. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
Transparency | COLORREF | Transparent color for animation playback. You can specify a COLORREF value, such as the return value of the Windows RGB macro, or you can use the PALETTEINDEX macro to specify a palette color.
DisposalMethod | L_UINT | Animation playback disposal method. For possible values, refer to Animation Disposal Methods .
LowBit | L_INT | Value indicating the low bit used for window leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale). A value of -1 will be treated as 0.
HighBit | L_INT | Value indicating the high bit used for window leveling. 0 <= nLowBit <= nHighBit <= (11 for 12-bit grayscale or 15 for 16-bit grayscale). A value of -1 will be treated as BitsPerPixel -1.
MinVal | L_INT32 | Minimum grayscale value. For every value between 0 and MinVal, Black (RGB(0,0,0)) will be used. For values between MinVal and MaxVal, the gray value to be displayed is calculated by : gray = (index - MinVal) * 255 / (MaxVal - MinVal).(See * below)
MaxVal | L_UINT | Maximum grayscale value. For every value larger than MaxVal, White (RGB(255,255,255)) will be used. For values between MinVal and MaxVal, the gray value to be displayed is calculated by : gray = (index - MinVal) * 255 / (MaxVal - MinVal). (See * below)

* index is the intensity value of the pixel. If the intensity value is > MaxVal, the color will be White. If the intensity value is < MinVal, the color will be Black. For those intensity values between MinVal and MaxVal, the above equation is used to determine the color, with index equal to the intensity value.

Comments

pBITMAPHANDLE is a pointer to a BITMAPHANDLE structure. Generally, where a function parameter type is pBITMAPHANDLE, you can declare a BITMAPHANDLE variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pBITMAPHANDLE variable is necessary only if your program requires a pointer.

In most cases, the values of fields in the BITMAPHANDLE structure are maintained by LEADTOOLS functions.

Note: A 16-bpp image may be color or grayscale. If you are working with a 16-bit grayscale image, explicitly set BITMAPHANDLE.Order to ORDER_GRAY. By default, the Order for a 16-bit image will be set to ORDER_BGR.

Please note that tiled bitmaps will have Flags.ConventionalMemory set, since the bitmap is allocated in conventional memory. To determine whether a bitmap is "regular memory", do the following:

if(!pBitmap->Flags.Compressed && !pBitmap->Flags.Tiled)
{
// regular bitmap. It is not compressed and it is not
 tiled.
}


CMDTYPE

typedef enum

{
/* predefined commands */

   CMD_LOAD =
 0, /* load a file */
CMD_SAVE = 1, /* save a file */
CMD_CREATE_WIN = 2, /* create a window */
CMD_SIZE_WIN = 3, /* size a new window */
CMD_CLOSE_WIN = 4, /* close a window */
CMD_SHOW_WIN = 5, /* show/hide the window */
CMD_SET_RECT = 6, /* set bitmap display rectangles */
CMD_USER_REG = 10000, /* start of registered user command
 values */
CMD_USER_CUSTOM = 20000, /* start of custom user command
 values */
} CMDTYPE, *pCMDTYPE;

The CMDTYPE data type contains the predefined commands used by the Internet command functions.

Comments

Users are encouraged to register their commands with LEAD. The registered commands will go in the 10000-19999 interval. Registering commands will help avoid conflicts when two different applications talk to each other.

The custom user commands will be known only by the application that sent them.


COMMAND

typedef struct tagCOMMAND
{
CMDTYPE uCmd;
L_UINT32 uNumParams;
pPARAMETER pParams;
L_UINT32 ulLength;
L_CHAR L_FAR
 *pData;
} INETCMD, L_FAR *pINETCMD;

The COMMAND structure is used internally by LEADTOOLS functions.

Member | Description
uCmd | Command id.
uNumParams | Number of parameters for command
pParams | Pointer to a list of parameters.
ulLength | Length of additional data associated with command.
pData | Additional data associated with command.


HBITMAPLIST

LEADTOOLS has defined the following data types for referencing a list of bitmaps:

Data Type | Definition and Usage
HBITMAPLIST | Defined as HANDLE; used as a handle to a list of bitmaps.
pHBITMAPLIST | Defined as HBITMAPLIST L_FAR *; used as a pointer to an HBITMAPLIST variable.


NAMEVALUE

typedef struct tagNAMEVALUE

{
L_TCHAR L_FAR *pszName;
L_TCHAR L_FAR *pszValue;
} NAMEVALUE, L_FAR *pNAMEVALUE;

The NAMEVALUE structure serves as the working structure for name items on a form. When sending a form or bitmap it allows you to specify the HTTP form element.

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

Comments

pNAMEVALUE is a pointer to a NAMEVALUE structure. Generally, where a function parameter type is pNAMEVALUE, you can declare a NAMEVALUE variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pNAMEVALUE variable is necessary only if your program requires a pointer.


PARAMETER

typedef struct tagPARAMETER

{
PARMTYPE uType;
L_UINT32 uLength;
union
{
L_CHAR
 L_FAR *pValue;
L_CHAR
 cValue;
L_UCHAR
 ucValue;
L_INT16
 sValue;
L_UINT16
 usValue;
L_INT32
 iValue;
L_UINT32
 uiValue;
};
} PARAMETER, L_FAR *pPARAMETER;

The PARAMETER structure is used to contain parameter information sent to the LInet::CommandCallBackand LInet::ResponseCallBack functions by the calling function.

Member | Description
uType | Type of variable. This has to be one of the LEADTOOLS defined types.
uLength | Length of pValue.
pValue | Actual value of parameter (if the type is PARAM_STRING).
cValue | Actual value of parameter (if the type is PARAM_CHAR).
ucValue | Actual value of parameter (if the type is PARAM_UCHAR).
sValue | Actual value of parameter (if the type is PARAM_INT16).
usValue | Actual value of parameter (if the type is PARAM_UINT16).
iValue | Actual value of parameter (if the type is PARAM_INT32).
uiValue | Actual value of parameter (if the type is PARAM_UINT32).

Comments

For the LInet::SendXXX functions, the parameter information is passed to the callback function in the pParams parameter. For information on the exact location of the parameter information within the pParams array, refer to the appropriate LInet::SendXXX function.

See Also

Functions:

LInet::CommandCallBack, LInet::ResponseCallBack, LInet::SendCmd, LInet::SendRsp, LInet::SendLoadCmd, LInet::SendLoadRsp, LInet::SendSaveCmd, LInet::SendSaveRsp, LInet::SendCreateWinCmd, LInet::SendCreateWinRsp, LInet::SendAttachBitmapCmd, LInet::SendAttachBitmapRsp, LInet::SendSizeWinCmd, LInet::SendSizeWinRsp, LInet::SendCloseWinCmd, LInet::SendCloseWinRsp, LInet::SendShowWinCmd, LInet::SendShowWinRsp, LInet::SendSetRectCmd, LInet::SendSetRectRsp, LInet::SendFreeBitmapCmd, LInet::SendFreeBitmapRsp


PARMTYPE

typedef enum tagPARMTYPE
{
PARAM_STRING, /* strings */
PARAM_CHAR, /* signed character */
PARAM_UCHAR, /* unsigned character */
PARAM_INT16, /* signed short */
PARAM_UINT16, /* unsigned short */
PARAM_INT32, /* signed integer */
PARAM_UINT32, /* unsigned integer */
PARAM_USTRING, /* unsigned string */
} PARMTYPE, *pPARMTYPE;

The PARMTYPE data type contains the parameter types used by the Internet command functions.


RECTTYPE

typedef enum tagRECTTYPE
{
RECT_SRC, /* source */
RECT_SRCCLIP, /* source clip */
RECT_SRCALL, /* source and source clip */
RECT_DST, /* destination */
RECT_DSTCLIP, /* destination clip */
RECT_DSTALL, /* destination and destination clip */
} RECTTYPE;

The RECTTYPE data type contains the parameter types used by the Internet command functions.


RESPONSE

typedef struct tagRESPONSE
{
L_UINT uNumParams;
pPARAMETER pParams;
L_UINT32 ulLength;
L_CHAR L_FAR
 *pData;
} INETRSP, L_FAR *pINETRSP;

The RESPONSE structure is used internally by LEADTOOLS functions.

Member | Description
uNumParams | Number of parameters for response
pParams | Pointer to a list of parameters.
ulLength | Length of additional data associated with command.
pData | Additional data associated with command.


WINDOWS Structures

BITMAPINFO

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for BITMAPINFO.

COLORREF

COLORREF is a Windows data type. For further information concerning COLORREF, please refer to the Microsoft SDK documentation.

DWORD

DWORD is a Windows data type, 32 bit unsigned int. For further information concerning DWORD, please refer to the Microsoft SDK documentation.

HANDLE

Handle is a standard Windows structure. For further information concerning HANDLE, please refer to the Microsoft SDK documentation or your compiler's documentation.

HDC

HDC is a standard Windows structure. For further information concerning HDC, please refer to the Microsoft SDK documentation or your compiler's documentation.

HGLOBAL

HGLOBAL is a standard Windows data type. For further information concerning HGLOBAL, please refer to the Microsoft SDK documentation or your compiler's documentation.

HWND

HWND is a standard Windows data type. For further information concerning HWND, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPBYTE

LPBYTE is a standard Windows data type. For further information concerning LPBYTE, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPRECT

LPRECT is a standard Windows structure. For further information concerning LPRECT, please refer to the Microsoft SDK documentation or your compiler's documentation.

LPSTR

LPSTR is a standard Windows data type. For further information concerning LPSTR, please refer to the Microsoft SDK documentation or your compiler's documentation.

OPENFILENAME

This is a Microsoft Windows structure as documented in the Microsoft SDK documentation. For complete documentation on this structure please refer to the Microsoft SDK documentation for OPENFILENAME.


Return Codes

For a list of all possible error codes for LEADTOOLS Internet Class Library, refer to LEADTOOLS Class Library Error Codes in the Main Class Library help file.


LInet::LInet

#include "ltwrappr.h"

L_VOID LInet::LInet(L_VOID)

Constructs and initializes the member variables of the LInet object.

Returns

None

Comments

LInet::LInet () is a constructor for the LInet object.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::~LInet, Class Members

Example

//This will call the default constructor and destructor when it is out of scope

LInet Inet;

Inet.StartUp();
Inet.ServerInit(1000);

if (Inet.IsValid())
MessageBox(NULL, TEXT("Server successfully started"), TEXT(""), MB_OK);

// other operations

Inet.ShutDown();


LInet::~LInet

#include "ltwrappr.h"

virtual L_VOID LInet::~LInet(L_VOID)

Destroys the class object, connection list and connection window, and frees any resources associated with them.

Returns

None

Comments

This is the destructor for the LInet class.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::LInet, Class Members

Example

For an example, refer to LInet::LInet().


LInet::AcceptConnect

#include "ltwrappr.h"

virtual L_INT LInet::AcceptConnect(plRemoteComp)

LInet L_FAR * plRemoteComp;

/* remote computer class instance */

Accepts an incoming connection from a remote computer.

Parameter | Description
plRemoteComp | Address of the LInet object that contains the remote computer information.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must call LInet::ServerInit to get a valid LInet class object before any connections can be accepted using this function.

After this function returns, the plRemoteComp class object will be updated with the computer that was requesting the connection.

You can use LInet::GetHostName to see who is trying to connect to hHost, after you accept the connection, using this function. If you then wish to restrict access, you can disconnect plRemoteComp after examining the hostname.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::ServerInit, LInet::Connect, LInet::Close, LInet::GetHostName, LInet::StartUp, LInet::ShutDown, Class Members
Topics: | Sending and Receiving Data

Example

For an example, refer to LInet::ServerInit.


LInet::AddWndItem

#include "ltwrappr.h"

L_BOOL * LInet::AddWndItem(plRemoteComp)

LInet L_FAR * plRemoteComp;

/* instance of a remote computer */

Add a remote computer to the connection list window.

Parameter | Description
plRemoteComp | Instance of a remote computer to be added to the connection list window.

Returns

TRUE | Remote computer has been added.
FALSE | Remote computer was not added.

Comments

If the user uses LInet::EnableAutoWnd, then the remote computer will be added automatically to the window.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::RemoveWndItem, LInet::RemoveAllWndItems, LInet::IsWndItem, Class Members

Example

// A user defined class derived from LInet should be used to support the OnConnect
// and OnClose callback functions.
// Suppose it was named as LUserInet

LUserInet UserInet;
LInet *plRemote = NULL;

// other operations

// connect to LEAD.
UserInet.Connect("207.238.49.190", 1000);

// other operations

// Close connection with LEAD.
plRemote = UserInet.GetLastItem();
if( plRemote == NULL)
return;

UserInet.Close(plRemote);

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
if ( nError != SUCCESS)
return nError;

if (IsWndItem(plConnection) > -1)
{
LBase::DisplayError(NULL, TEXT("Remote computer already exists in connection list."));
return FAILURE;
}

if (AddWndItem(plConnection) == FALSE);
return FAILURE;

return SUCCESS;
}

L_INT LUserInet::OnClose(LInet L_FAR *plConnection, L_INT nError)
{
if ( nError != SUCCESS)
return nError;

RemoveWndItem(plConnection);

return SUCCESS;
}


LInet::ClearQueue

#include "ltwrappr.h"

L_INT LInet::ClearQueue(L_VOID)

Clears the LEADTOOLS internal queue used for sending data.

Returns

SUCCESS The function was successful.

< 1 An error occurred. Refer to Return Codes.

Comments

You can use this function to abort data transfers. This function should be used with care because the remote end has no way of knowing that the send queue has been cleared.

If after using this function you send data using LInet::SendData, LInet::SendBitmap, or LInet::SendSound, then the remote end will be able to detect that new data is being sent and it will abort the previous download. However, if you send data using LInet::SendRawData, you must implement your own mechanism to synchronize the local and remote computers and recover from aborted sends.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::GetQueueSize, LInet::SendData, LInet::SendBitmap, LInet::SendRawData, LInet::SendSound, LInet::StartUp, LInet::ShutDown, Class Members

Example

For an example, refer to LInet::GetQueueSize.


LInet::Close

#include "ltwrappr.h"

virtual L_INT LInet::Close(plRemoteComp, bGraceful=FALSE)

LInet L_FAR *plRemoteComp; | /* remote computer class instance */
L_BOOL bGraceful; | /* disconnect flag */

Closes a connection with a remote computer.

Parameter | Description
plRemoteComp | An instance of the remote computer for which connection is to be closed.
bGraceful | Flag that determines when the connection is closed. Possible values are:
 | Value | Meaning
 | TRUE | allow all data to be sent before connection is closed.
 | FALSE | close the connection now.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If bGraceful is TRUE, then the connection will be closed after all the data has been sent. If you have sent a large chunk of data immediately before calling LInet::Close, then there is a high probability that not every byte has been sent. Closing with bGraceful = FALSE means that the connection is closed without delay, and with the possibility that the data you sent will be truncated. Closing with bGraceful = TRUE means that the close will be delayed until all the data has been sent. You will be notified of the disconnection in the LInet::OnClose function.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::Connect, LInet::ServerInit, LInet::ServerShutdown, LInet::SendData, LInet::StartUp, LInet::ShutDown, Class Members

Example

For an example, refer to LInet::Connect.


LInet::CloseAll

#include "ltwrappr.h"

virtual L_INT LInet::CloseAll(bByType=FALSE)

L_BOOL bByType;

/* disconnect type */

Closes all connections with a remote computer, either servers or clients.

Parameter | Description
bByType | Flag that determines the type of connection to close. Possible values are:
 | Value | Meaning
 | SERVER | close all servers connections.
 | CLIENT | close all clients connections.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The user can combine the two values to close all connections.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::Connect, LInet::ServerInit, LInet::ServerShutdown, LInet::SendData, LInet::StartUp, LInet::ShutDown, Class Members

Example

LInet Inet;

// connect to LEAD.
Inet.Connect("207.238.49.190", 1000);

// other operations

Inet.CloseAll();


LInet::CommandCallBack

#include " ltwrappr.h "

virtual L_INT LInet::CommandCallBack(plConnection, uCommand, uCommandID, nError, uParams, pParams, uExtra, pExtra)

LInet L_FAR * plConnection; | /* instance of a remote computer */
CMDTYPE uCommand; | /* command type */
L_UINT uCommandID; | /* command id */
L_INT nError; | /* status of the received data */
L_UINT uParams; | /* number of parameters */
pPARAMETER pParams; | /* pointer to an array of parameters */
L_UINT uExtra; | /* length */
L_CHAR L_FAR * pExtra; | /* pointer to extra data */

Notifies a computer that a command has been received. This function is only available in the Internet toolkit.

Parameter | Description
plConnection | Instance of the remote computer from which the command was sent.
uCommand | Command received from the remote computer. For a list of possible values, refer to CMDTYPE.
uCommandID | Command Id. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several messages, this ID allows that member to identify when a specific request has been completed.
nError | Determines whether the command was received properly. If not all the parameters were received properly, then nError will be set to an error code (usually ERROR_TRANSFER_ABORTED).
uParams | The number of parameters for this command.
pParams | Pointer to an array of PARAMETER structures that contain the parameters for the command.
uExtra | Length of any extra data sent with the command.
pExtra | Pointer to the extra data sent with the command.

Returns

SUCCESS | This function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

A call to this overridable function is generated when a computer receives a command request from a remote computer.

To process commands, a class must be derived from LInet and this member function must be overridden.

When a command request is received, this function should respond by calling the corresponding response function. For example, if a SendLoadCmd request is received from a remote computer, this function should respond by calling LInet::SendLoadRsp.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::ResponseCallBack, LInet::SendCmd, LInet::SendLoadCmd, LInet::SendCreateWinCmd, LInet::SendAttachBitmapCmd, LInet::SendSaveCmd, LInet::SendSizeWinCmd, LInet::SendShowWinCmd, LInet::SendCloseWinCmd, LInet::SendFreeBitmapCmd, LInet::SendSetRectCmd
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

/*Below is a sample CommandCallBack function that can be used to process various commands sent to a server*/
//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects

L_INT CMyNet::CommandCallBack(LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CString strMsg;

strMsg.Format(TEXT("%s, id=%d, nError=%d, uParams=%d%s received"),
GetCommandString(uCommand),
uCommandID,
nError,
uParams,
uExtra ? TEXT(", uExtra") : TEXT(""));
UpdateStatusbar(strMsg, 0);

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_LOAD:
{
L_INT nIndex;

nIndex = m_BitmapList.AddBitmap (
pParams[0].pValue, //file name
pParams[1].iValue, //nBitsPerPixel
pParams[2].iValue //nOrder
);

if (nIndex >=0)
{
nStatus = SUCCESS;
pMain->m_uBitmapID = uBitmapID = nIndex;
}

return pMain->m_Inet.SendLoadRsp (plConnection, uCommandID, uBitmapID, 0, NULL, nStatus);
}
break;

case CMD_CREATE_WIN:
{
pMain->m_bCreateBitmapWindow = FALSE; //Do not allocate LBitmapWindow
pMain->m_pInetRemoteServer = plConnection;
theApp.OnFileNew ();
pMain->m_bCreateBitmapWindow = TRUE;
pMain->m_pInetRemoteServer = NULL;
nStatus = SUCCESS;

// Get the active MDI child window.CMDIChildWnd
CMDIChildWnd *pChild = (CMDIChildWnd *) pMain->GetActiveFrame();
CView *pView = pChild->GetActiveView();

// Get the active view attached to the active MDI child window.
pChild->SetWindowPos(NULL, 0, 0, pParams[5].iValue,pParams[6].iValue, SWP_NOOWNERZORDER + SWP_NOMOVE );
pMain->m_uWindowID = (L_UINT)pView->m_hWnd;

return pMain->m_Inet.SendCreateWinRsp (
plConnection,
uCommandID,
(L_UINT)pView->m_hWnd,
0,
NULL,
SUCCESS);
}
break;

case CMD_ATTACH_BITMAP:
{
L_UINT32 uBitmapID = pParams[0].uiValue;
HWND uWindowID = (HWND)pParams[1].uiValue;

//pParams[0] uBitmapID
//pParams[1] uWindowID

//Need to attach bitmap to BitmapWindow
if (IsWndValid((HWND)uWindowID))
{
LBitmapWindow *pBitmapWindow;
pBitmapWindow = m_BitmapList[uBitmapID];
if (pBitmapWindow != NULL)
{
pBitmapWindow->SetWndHandle (uWindowID);
CNetDoc *pNetDoc = (CNetDoc*)GetDocFromHWnd((HWND)uWindowID);
if (pNetDoc != NULL)
{
pNetDoc->m_pBitmapWindow = pBitmapWindow;
pNetDoc->m_bBitmapWindowInList = TRUE;
}
}
}
return pMain->m_Inet.SendAttachBitmapRsp (plConnection, uCommandID, 0, NULL, nStatus);
}
break;

case CMD_FLIP:
{
uBitmapID = pParams->uiValue;

//Make sure bitmap ID is valid
LBitmapWindow *pBitmapWindow = m_BitmapList[uBitmapID];
if (pBitmapWindow != NULL)
{
nStatus = pBitmapWindow->Flip ();
}
}
break;

case CMD_SAVE:
{
uBitmapID = pParams[1].uiValue;
//Make sure bitmap ID is valid
LBitmapWindow *pBitmapWindow = m_BitmapList[uBitmapID];

//pParams[0] file name
//pParams[1] bitmap id
//pParams[2] nFormat
//pParams[3] nBitsPerPixel
//pparams[4] nQFactor
//pParams[5] uFlags

if (pBitmapWindow != NULL)
{
L_INT nRet;
nRet = pBitmapWindow->Save(
pParams[0].pValue,
pParams[2].iValue,
pParams[3].iValue,
pParams[4].iValue,
pParams[5].iValue
);
if (nRet != SUCCESS)
nStatus = FAILURE;
}
}
return pMain->m_Inet.SendSaveRsp (plConnection, uCommandID,0, NULL, nStatus);
break;

case CMD_GET:
{
L_UINT uBitmapID = pParams->uiValue;

//is it a valid bitmap ID?
LBitmapWindow *pBitmapWindow = m_BitmapList[uBitmapID];
if (pBitmapWindow != NULL)
{
//nStatus = m_Inet.SendBitmap (pBitmapWindow);
nStatus = pMain->m_Inet.SendBitmap (plConnection, pBitmapWindow->GetHandle(), FILE_CMP, 24, QS, NULL);
}
}
break;

case CMD_SIZE_WIN:
{
L_INT nStatus = SUCCESS;
L_INT nRet;
HWND uWindowID = (HWND)pParams[0].uiValue;
L_UINT uLeft = pParams[1].uiValue;
L_UINT uTop = pParams[2].uiValue;
L_UINT uWidth = pParams[3].uiValue;
L_UINT uHeight = pParams[4].uiValue;

if (IsWndValid((HWND)uWindowID))
{
nRet = ::SetWindowPos(
::GetParent((HWND)uWindowID),
NULL,
uLeft,
uTop,
uWidth,
uHeight,
SWP_NOOWNERZORDER
);
if (nRet == 0)
nStatus = FAILURE;
}
else
{
nStatus = ERROR_INV_PARAMETER;
}
return pMain->m_Inet.SendSizeWinRsp (plConnection, uCommandID, 0, NULL, nStatus);
}
break;

case CMD_SHOW_WIN:
{
L_INT nStatus = SUCCESS;
L_INT nRet;
HWND uWindowID = (HWND)pParams[0].uiValue;
L_INT nCmdShow = pParams[1].iValue;

if (IsWndValid((HWND)uWindowID))
{
nRet = ::ShowWindow(
::GetParent((HWND)uWindowID),
nCmdShow
);
if (nRet == 0)
nStatus = FAILURE;
}
else
{
nStatus = ERROR_INV_PARAMETER;
}
return pMain->m_Inet.SendShowWinRsp (plConnection, uCommandID, 0, NULL, nStatus);
}
break;

case CMD_CLOSE_WIN:
{
L_INT nStatus = SUCCESS;
HWND uWindowID = (HWND)pParams[0].uiValue;

if (!CloseDocument((HWND)uWindowID))
{
nStatus = ERROR_INV_PARAMETER;
}
return pMain->m_Inet.SendCloseWinRsp (plConnection, uCommandID, 0, NULL, nStatus);
}
break;

case CMD_FREE_BITMAP:
{
L_INT nStatus = SUCCESS;
L_UINT uBitmapID = pParams[0].uiValue;

nStatus = m_BitmapList.DeleteBitmap (uBitmapID);
pMain->UpdateWindow();
return pMain->m_Inet.SendFreeBitmapRsp (plConnection, uCommandID, 0, NULL, nStatus);
}
break;

case CMD_SET_RECT:
{
L_INT nStatus = FAILURE;
uBitmapID = pParams->uiValue;

CNetDoc *pNetDoc = (CNetDoc*)GetDocFromHWnd(HWND(pParams[0].uiValue));

if (pNetDoc != NULL)
{
RECT rcRect;
rcRect.left = pParams[2].iValue;
rcRect.top = pParams[3].iValue;
rcRect.right = rcRect.left + pParams[4].iValue;
rcRect.bottom = rcRect.top + pParams[5].iValue;
pNetDoc->m_pBitmapWindow->EnableCallBack(TRUE);
nStatus = pNetDoc->m_pBitmapWindow->ZoomToRect(rcRect);
}
return pMain->m_Inet.SendSetRectRsp (plConnection, uCommandID,0,0,nStatus);
}
}

return pMain->m_Inet.SendRsp (
plConnection,
uCommand,
uCommandID,
NULL,
nStatus
);
}


LInet::Connect

#include "ltwrappr.h"

virtual L_INT LInet::Connect(pszAddress, nPort)

const L_CHAR L_FAR * pszAddress; | /* address of the computer to which to connect */
L_INT nPort; | /* port on remote computer to which to connect */

Connects to a remote computer.

Parameter | Description
pszAddress | Character string containing the address of the computer to which you want to connect
nPort | Port on the remote computer to which to connect

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function requests a connection to a remote computer. The remote computer must accept the connection by calling LInet::AcceptConnect.

pszAddress can be any URL or an IP address in the Internet dot notation. Ex. http://www.leadtools.com or 207.238.49.130.

A call to LInet::OnConnect will be generated when a connection request is successfully accepted by the remote computer.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::Close, LInet::ReadData, LInet::SendData, LInet::SendBitmap, LInet::SendSound, LInet::AutoProcess, LInet::ServerInit, LInet::ServerShutDown, LInet::GetHostName, LInet::AcceptConnect, LInet::StartUp, LInet::ShutDown, Class Members
Topics: | Sending and Receiving Data

Example

// the user should derive a class from LInet to support the OnConnect callback function
// suppose it was named as LUserInet

LUserInet UserInet;
UserInet.StartUp();

// connect to LEAD.
UserInet.Connect("207.238.49.190", 1000);

// other operations

UserInet.ShutDown();

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
L_CHAR *pName;
L_INT nRet = SUCCESS;
L_TCHAR szString[150] = TEXT("\0");

if (nError != SUCCESS)
return nError;

// retreive the remote computer name
if ((pName = plConnection->GetHostName(HOST_NAME_IP)) == NULL)
return FAILURE;

wsprintf(szString, TEXT("You have successfully connected to %s"), pName);
MessageBox(NULL, szString, TEXT(""), MB_OK);

// other operations

// close the connection
Close(plConnection);

return nRet;
}


LInet::CreateWnd

#include "ltwrappr.h"

L_INT LInet::CreateWnd(hParentWnd, pOptions, nID, uStyles=WS_VISIBLE, nX=0, nY=0, nCx=320, nCy=200)

HWND hParentWnd; | /* handle of the parent window */
pCONLISTOPTIONS pOptions; | /* options for the window control */
L_INT nID; | /* the control’s ID */
DWORD uStyles; | /* control’s style */
L_INT nX; | /* x coordinate for the window */
L_INT nY; | /* y coordinate for the window */
L_INT nCx; | /* width of the window */
L_INT nCy; | /* height of the window */

Creates the connection window control using the specified parameters.

Parameter | Description
hParentWnd | Handle of the parent window.
pOptions | Options of the connction list window control.
nID | The control’s ID.
uStyles | The style of the window control. Apply any combination of window styles and tree view styles. For more information on Windows styles, refer to your compiler’s help file. For more information window styles, refer to MICROSOFT WINDOWS styles.
nX | X coordinate for the origin of the connection window.
nY | Y coordinate for the origin of the connection window.
nCx | The width of the connection window.
nCy | The height of the connection window.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function causes the class object to create the control window using the specified parameters.

If the control window has been created, it will have a tree view appearance with two branches, one for the server that my computer connected to them, and the other for clients were connected to my computer.

If the user passed pOptions->hServerIcon or pOptions->hClientIcon as NULL, then the function will load the default icons.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ExpandWnd, Class Members

Example

LInet Inet;
HWND hParentWnd;

// other operations

Inet.CreateWnd(hParentWnd, NULL);
Inet.ExpandWnd();


LInet::EnableAutoProcess

#include "ltwrappr.h"

L_INT LInet::EnableAutoProcess(bProcess=TRUE)

L_BOOL bProcess;

/* TRUE to auto process received data */

Enables or disables auto processing of received data for a computer.

Parameter | Description
bProcess | Flag that controls auto processing. Set bProcess to TRUE to enable auto process of received data, or FALSE to disable it.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If auto process is enabled when data is received, that data will be checked for LEADTOOLS' headers. If no header is recognized, the data will be treated as user defined data, and the OnUser1Received function will be called.

If auto process is disabled when data is received, that data will not be checked for LEADTOOLS' headers. In this case, you must read the data using LInet::ReadData and OnDataReady.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ReadData, LInet::SendRawData, LInet::SendData, LInet::SendBitmap, LInet::SendSound, LInet::StartUp, LInet::ShutDown, LInet::OnDataReady, Class Members

Example

For an example, refer to LInet::ReadData.


LInet::EnableAutoWnd

#include "ltwrappr.h"

L_VOID LInet::EnableAutoWnd(bFlag=TRUE)

L_BOOL bFlag;

/* flag that indicates whether to enable automatic processing */

Enables or disables auto processing for adding or removing remote computers to or from the connection list window.

Parameter | Description
bFlag | Flag that indicates whether to enable or disable automatic processing for adding and removing remote computers from the connection list window. Possible values are:
 | Value | Meaning
 | TRUE | Enable auto processing.
 | FALSE | Disable auto processing.

Returns

None.

Comments

If auto process is enabled, then adding and removing remote computers to and from the connection list window will be performed automatically.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::AddWndItem, LInet::RemoveWndItem, LInet::RemoveAllWndItems, LInet::IsWndItem, LInet::IsAutoWndEnabled, Class Members

Example

LInet Inet;

if (Inet.IsAutoWndEnabled() == FALSE)
Inet.EnableAutoWnd();


LInet::ExistsItem

#include "ltwrappr.h"

L_INT LInet::ExistsItem(plRemoteComp)

LInet L_FAR * plRemoteComp;

/* instance of a remote computer */

Determines whether the specified remote computer is in the internal connection list.

Parameter | Description
plRemoteComp | Instance of a remote computer. This function will determine whether this remote computer is in the internal connection list.

Returns

>= 0 | Index of the remote computer in the internal connection list.
-1 | Remote computer not found.
<-1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::GetItem, LInet::GetFirstItem, LInet::GetLastItem, LInet::GetNextItem, LInet::GetPrevItem, LInet::GetItemsCount, Class Members

Example

LInet Inet;
LInet L_FAR *pInet;

// other operations

if( Inet.ExistsItem(pInet) == -1)
return;
else pInet = Inet.GetLastItem(pInet);


LInet::ExpandWnd

#include "ltwrappr.h"

L_INT LInet::ExpandWnd(bFlag=TRUE)

L_BOOL bFlag;

/* flag that indicates whether to expand the tree */

Expands or collapses the connection list tree.

Parameter | Description
bFlag | Flag that indicates whether to expand or collapse the connection list tree. Possible values are:
 | Value | Meaning
 | TRUE | Expand the connection list tree.
 | FALSE | Collapse the connection list tree.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::CreateWnd, Class Members

Example

For an example, refer to LInet::CreateWnd.


LInet::GetFirstItem

#include "ltwrappr.h"

LInet L_FAR * LInet::GetFirstItem(plRemoteComp=NULL)

LInet L_FAR * plRemoteComp;

/* instance of a remote computer */

Retrieves the first remote computer in the internal connection list based on plRemoteComp.

Parameter | Description
plRemoteComp | Instance of a remote computer.

Returns

Pointer to an LInet class object that contains the retrieved remote computer.

Comments

If plRemoteComp = NULL, the function will retrieve the first remote computer in the internal connection list.

If plRemoteComp <> NULL, the function will retrieve the first remote computer in the internal connection list that has the same type (Server or client), as plRemoteComp.

Do not delete the returned instance pointer.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ExistsItem, LInet::GetItem, LInet::GetLastItem, LInet::GetNextItem, LInet::GetPrevItem, LInet::GetItemsCount, Class Members

Example

// a user defined class derived from LInet should be used to support the OnConnect callback functions
// suppose it was named as LUserInet
LUserInet UserInet;

// other operations

// connect to LEAD
UserInet.Connect(TEXT("207.238.49.190"), 1000);

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
LInet L_FAR *plRemote = NULL;
L_TCHAR *pName;
L_TCHAR szString[256];

plRemote = GetFirstItem(plConnection);
if (plRemote != NULL)
{
pName = plRemote->GetHostName();
wsprintf(szString, TEXT("Host name of the first server connection: %s"), pName);
MessageBox(NULL, szString, TEXT(""), MB_OK);
}
return SUCCESS;}


LInet::GetHandle

#include "ltwrappr.h"

L_COMP L_FAR LInet::GetHandle(L_VOID)

Retrieves the internal LEAD computer handle for this LInet class object.

Returns

A pointer to a computer handle.

Comments

Use this function to retrieve the internal LEAD bitmap handle for this LInet class object.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Elements

Class Members

Example

LInet Inet;
LInet L_FAR *plRemote;

plRemote = Inet.GetFirstItem();

if( *plRemote.GetHandle() == 35)
return;


LInet::GetHostName

#include "ltwrappr.h"

L_CHAR L_FAR * LInet::GetHostName(nType=HOST_NAME_DESC)

L_INT nType;

/* type of name to retrieve */

Gets either the descriptive name (URL) or the IP address of a remote computer.

Parameter | Description
nType | Value indicating the type of name to retrieve. Possible values include:
 | Value | Meaning
 | HOST_NAME_DESCRP | Descriptive name of remote computer
 | HOST_NAME_IP | IP address of remote computer

Returns

!NULL | Pointer to a character string that contains the host.
NULL | An error occurred.

Comments

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::Connect, LInet::ServerInit, LInet::Close, LInet::StartUp, LInet::ShutDown, Class Members

Example

For an example, refer to LInet::Connect.


LInet::GetItem

#include "ltwrappr.h"

LInet L_FAR * LInet::GetItem(uIndex)

LInet L_FAR * LInet::GetItem(phComputer)

L_COMP * phComputer; | /* address of a remote computer handle */
L_UINT uIndex; | /* index of a remote computer */

LInet::GetItem(uIndex) retrieves a pointer to an instance of the remote computer at the specified index in the internal connection list.

LInet::GetItem(phComputer) retrieves a pointer to an instance of the remote computer specified by the given computer handle.

Parameter | Description
phComputer | Pointer to the remote computer handle.
uIndex | Index of a remote computer.

Returns

A pointer to the LInet object that referances the specified remote computer.

Comments

The index is zero-based.

Do not delete the returned class instance pointer.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ExistsItem, LInet::GetFirstItem, LInet::GetLastItem, LInet::GetNextItem, LInet::GetPrevItem, LInet::GetItemsCount, Class Members

Example

//This is the example for LInet::GetItem(uIndex):

LInet Inet;
LInet L_FAR *plRemote = NULL;

// other operations

plRemote = Inet.GetItem(2);
Inet.Close(plRemote);

//This is the example for LInet::GetItem(phComputer):

LInet Inet;
L_COMP *phComp;
LInet L_FAR *plRemote = NULL;

// other operations

plRemote = Inet.GetItem(phComp);
Inet.Close(plRemote);


LInet::GetItemsCount

#include "ltwrappr.h"

L_UINT LInet::GetItemsCount(L_VOID)

Retrieves the number of remote computers in the internal connection list.

Returns

> 0 | Number of remote computers.
0 | No remote computers.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions

LInet::ExistsItem, LInet::GetItem, LInet::GetFirstItem, LInet::GetLastItem, LInet::GetNextItem, LInet::GetPrevItem, Class Members

Example

LInet Inet;
L_UINT uItems;

// other operations

uItems = Inet.GetItemsCount();

if (uItems == 0)
MessageBox(NULL, TEXT("No connections"), TEXT(""), MB_OK);


LInet::GetLastItem

#include "ltwrappr.h"

LInet L_FAR * LInet::GetLastItem(plRemoteComp=NULL)

LInet L_FAR * plRemoteComp;

/* instance of a remote computer */

Retrieves the last remote computer in the internal connection list, based on plRemoteComp.

Parameter | Description
plRemoteComp | Instance of a remote computer.

Returns

Pointer to an LInet class object that contains the retrieved remote computer.

Comments

If plRemoteComp = NULL, the function will retrieve the last remote computer in the internal connection list.

If plRemoteComp <> NULL, the function will retrieve the last remote computer in the internal connection list that has the same type (Server or client) as plRemoteComp.

Do not delete the retrieved pointer to the LInet class object.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ExistsItem, LInet::GetItem, LInet::GetFirstItem, LInet::GetNextItem, LInet::GetPrevItem, LInet::GetItemsCount, Class Members

Example

For an example, refer to LInet::AddWndItem.


LInet::GetNextItem

#include "ltwrappr.h"

LInet L_FAR * LInet::GetNextItem(plRemoteComp, bByType=FALSE)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_BOOL bByType; | /* flag that indicates the next item to get */

Retrieves the next remote computer in the connection list, based on the specified parameters.

Parameter | Description
plRemoteComp | Instance of the remote computer currently referenced in the connection list.
bByType | Flag that indicates the next item to get. Possible values are:
 | Value | Meaning
 | TRUE | Get the next remote computer in the connection list that has the same type (server or client) as plRemoteComp.
 | FALSE | Get the next remote computer in the connection list, regardless of type.

Returns

A pointer to an LInet object that references the next remote computer.

Comments

If bByType = FALSE, this function will get the next remote computer in the internal connection list, either SERVER or CLIENT.

If bByType = TRUE, this function will get the next remote computer in the internal connection list that has the same type as plRemoteComp.

Do not delete plRemoteComp.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ExistsItem, LInet::GetItem, LInet::GetFirstItem, LInet::GetLastItem, LInet::GetPrevItem, LInet::GetItemsCount, Class Members

Example

LInet Inet;
LInet L_FAR *plRemote;

// other operations

plRemote = Inet.GetNextItem(plRemote);

// other operations


LInet::GetPrevItem

#include "ltwrappr.h"

LInet L_FAR * LInet::GetPrevItem(plRemoteComp, bByType=FALSE)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_BOOL bByType; | /* flag that indicates the previous item to get */

Retrieves the previous remote computer in the connection list, based on the specified parameters.

Parameter | Description
plRemoteComp | Instance of the remote computer currently referenced in the connection list.
bByType | Flag that indicates the next item to get. Possible values are:
 | Value | Meaning
 | TRUE | Get the previous remote computer in the internal connection list that has the same type (server or client) as plRemoteComp.
 | FALSE | Get the previous remote computer in the internal connection list, regardless of type.

Returns

A pointer to an LInet object that references the previous remote computer.

Comments

If bByType = FALSE, this function will get the previous remote computer in the internal connection list, either SERVER or CLIENT.

If bByType = TRUE, this function will get the previous remote computer in the internal connection list that has the same type as plRemoteComp.

Do not delete plRemoteComp.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ExistsItem, LInet::GetItem, LInet::GetFirstItem, LInet::GetLastItem, LInet::GetNextItem, LInet::GetItemsCount, Class Members

Example

// a user defined class derived from LInet should be used to support the OnConnect callback functions
// suppose it was named as LUserInet
LUserInet UserInet;

// other operations

// connect to LEAD
UserInet.Connect("207.238.49.190", 1000);

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
LInet L_FAR *plRemote = NULL;
L_CHAR *pName;
L_TCHAR szString[256];

plRemote = GetPrevItem(plConnection);
if (plRemote != NULL)
{
pName = plRemote->GetHostName();
wsprintf(szString, TEXT("Host name for pervious connection: %s"), pName);
MessageBox(NULL, szString, TEXT(""), MB_OK);
}

return SUCCESS;
}


LInet::GetQueueSize

#include "ltwrappr.h"

L_INT32 LInet::GetQueueSize(L_VOID)

Returns the size of the LEADTOOLS internal send queue.

Returns

>=0 | If return value is between 1 and 0xFFFFFFFE, then it represents the number of bytes in the queue, not counting any LEADTOOLS headers. If 0 is returned, then there is no data in the queue.
< 0 | An error occurred. Refer to Return Codes.

Comments

Only actual data will be counted. The LEADTOOLS' headers which pad the data are not counted.

If QUEUE_NO_DATA (0xFFFFFFFF) is returned, then there is no data, but the queue is not empty and consists only of LEADTOOLS' headers used for auto process.

NOTE: Even if the return value is 0, there is no guarantee that all bytes have been sent and you can do a hard close (i.e. LInet::Close(FALSE) ).

Winsock (which LEADTOOLS uses) has its own internal queue and we have no access to it. Therefore we have no way of knowing how much data has been sent.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ClearQueue, LInet::SendData, LInet::SendBitmap, LInet::SendRawData, LInet::SendSound, LInet::StartUp, LInet::ShutDown, Class Members

Example

// a user defined class from LInet should be used to support OnConnect callback function
// suppose it was named as LUserInet

LUserInet UserInet;
UserInet.StartUp();

// connect to LEAD.
UserInet.Connect("207.238.49.190", 1000);

// other operationsDat

UserInet.ShutDown();

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
static L_CHAR aData[50000] = "Some Data";
L_UINT32 ulDataSize;
L_INT nRet = SUCCESS;

if (nError != SUCCESS)
return nError;

ulDataSize = sizeof(aData);
nRet = SendData(plConnection, aData, &ulDataSize, IDATA_USER1);

ulDataSize = plConnection->GetQueueSize();
// abort the current send if less than 25k have been sent
if ( ulDataSize > 0 && ulDataSize < 25000)
plConnection->ClearQueue();

// other operations

// we can close the connection without data loss with a graceful connection.
//The closing will be trminated immediatlly
// and all the data will not be sent. remove the next line if you want to keep the connection open
Close(plConnection);

return nRet;
}


LInet::IsAutoProcessEnabled

#include "ltwrappr.h"

L_BOOL LInet::IsAutoProcessEnabled(L_VOID)const

Determines whether auto processing of received data is enabled or disabled.

Returns

TRUE | Auto processing is enabled.
FALSE | Auto processing is disabled.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::EnableAutoProcess, Class Members

Example

For an example, refer to LInet::ReadData.


LInet::IsAutoWndEnabled

#include "ltwrappr.h"

L_BOOL LInet::IsAutoWndEnabled(L_VOID)

Determines whether auto processing is enabled or disabled for the connection list window.

Returns

TRUE | Auto processing is enabled.
FALSE | Auto processing is disabled.

Comments

If auto processing is enabled, adding and removing remote computers to and from the connection list window will be performed automatically.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::AddWndItem, LInet::RemoveWndItem, LInet::RemoveAllWndItems, LInet::IsWndItem, LInet::EnableAutoWnd, Class Members

Example

For an example, refer to LInet::EnableAutoWnd.


LInet::IsValid

#include "ltwrappr.h"

virtual L_BOOL LInet::IsValid(L_VOID)

Checks to see if the LInet class object is valid.

Returns

TRUE | The Inet class object is valid.
FALSE | The Inet class object is not valid.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

Class Members

Example

For an example, refer to LInet::LInet.


LInet::IsWndItem

#include "ltwrappr.h"

L_BOOL LInet::IsWndItem(plRemoteComp)

LInet L_FAR * plRemoteComp;

/* instance of a remote computer */

Checks to see if the specified remote computer is in the connection list window.

Parameter | Description
plRemoteComp | Instance of a remote computer. This function will determine whether this remote computer is in the connection list window.

Returns

TRUE | Remote computer in the connection list window.
FALSE | Remote computer not in the connection list window.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::AddWndItem, LInet::RemoveWndItem, LInet::RemoveAllWndItems, Class Members

Example

For an example, refer to LInet::AddWndItem.


LInet::m_pUserDataEx

#include "ltwrappr.h"

L_VOID *LInet::m_pUserDataEx

Comments

A void pointer to be used for any extra data the user needs.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Example

class LUserInet : public LInet
{
protected:
virtual L_INT OnConnect(LInet L_FAR *plConnection, L_INT nError);
virtual L_INT OnClose(LInet L_FAR *plConnection, L_INT nError);
};

LUserInet UserInet;
UserInet.StartUp();

// connect to LEAD.
UserInet.Connect("207.238.49.190", 1000);

// … other operations;

LInet L_FAR *plConnection = UserInet.GetFirstItem();
if(plConnection)
{
plConnection->Close(FALSE);

if(plConnection->m_pUserDataEx)
{
MessageBox(NULL,TEXT(" User Data "), (L_TCHAR *)plConnection->m_pUserDataEx,MB_OK|
MB_APPLMODAL);
// free the m_pUserDataEx;

delete []plConnection->m_pUserDataEx;
plConnection->m_pUserDataEx = NULL;
}
}

// Callback functions
L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
if(plConnection)
{
L_TCHAR* name = TEXT("This is Data for user");
plConnection->m_pUserDataEx = (L_VOID *)new L_TCHAR[50];
memcpy(plConnection->m_pUserDataEx, name, lstrlen(name));
}
return 0;

}

L_INT LUserInet::OnClose(LInet L_FAR *plConnection, L_INT nError)
{
if(plConnection && plConnection->m_pUserDataEx)
{
MessageBox(NULL,TEXT(" User Data "), (L_TCHAR *)plConnection->m_pUserDataEx,MB_OK|
MB_APPLMODAL);

delete []plConnection->m_pUserDataEx;
plConnection->m_pUserDataEx = NULL;
}
return 0;

}


LInet::OnClose

#include "ltwrappr.h"

virtual L_INT LInet::OnClose(plConnection, nError)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */

Overridable function that notifies a computer that a connection has been terminated.

Parameter | Description
plConnection | Pointer to the instance of the remote computer whose connection has been terminated.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function will be called after LInet::Close is called.

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::Close, Class Members

Example

For an example, refer to LInet::AddWndItem.


LInet::OnConnect

#include "ltwrappr.h"

L_INT LInet::OnConnect(plConnection, nError)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */

Overridable function that notifies a computer that a connection has been established..

Parameter | Description
plConnection | Pointer to an instance of the remote computer to which you have connected.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

A call to this function will be generated by a call to LInet::Connect.

Do not delete the pointer plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::Connect, Class Members
Topics: | Sending and Receiving Data

Example

For an example, refer to LInet::Connect.


LInet::OnConnectRequest

#include "ltwrappr.h"

virtual L_INT LInet::OnConnectRequest(plConnection, nError)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */

Overridable function that notifies a computer that a connection request has been received from a remote computer.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that requests a connection.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::Connect, LInet::AcceptConnect, Class Members
Topics: | Sending and Receiving Data

Example

For an example, refer to LInet::ServerInit.


LInet::OnDataReady

#include "ltwrappr.h"

L_INT LInet::OnDataReady(plConnection, nError, pBuffer, ulSize)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
L_CHAR L_FAR pBuffer; | /* buffer containing data */
L_UINT32 ulSize; | /* size of the buffer */

Overridable function that notifies a computer that the data that has been received is ready to be read.

Parameter | Description
plConnection | Pointer to the instance of the remote computer from which to read the data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred. If nError is < SUCCESS, pBuffer should be ignored.
pBuffer | Pointer to a data buffer.
ulSize | The size of the data pointed to by pBuffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Immediately after successfully connecting to a LEADTOOLS server started with LInet::ServerInit, if auto process is not enabled, this function will be the first function called and pBuffer will contain a NULL terminated string containing "LEAD Technologies Server X.X" where X.X is the server version number. The user should read the data using LInet::ReadData.

This function is called before the LInet::OnImageReceived, LInet::OnMMediaReceived or LInet::OnUserXReceived functions are called, so that you can determine the total amount of data that will be received.

If auto process was not enabled for plConnection, pBuffer will be NULL, and you should read the data by calling LInet::ReadData.

The buffer pointed to by pBuffer will be freed upon returning from the function.

Do not delete plConnection or pBuffer.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::ReadData, Class Members
Topics: | Sending and Receiving Data

Example

For an example, refer to LInet::ReadData.


LInet::OnDataReceiving

#include "ltwrappr.h"

L_INT LInet::OnDataReceiving(plConnection, nError, pBuffer, ulSize)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
L_CHAR L_FAR pBuffer; | /* buffer containing data */
L_UINT32 ulSize; | /* size of the buffer */

Overridable function that notifies a computer that data is being received from a remote connection.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that is sending the data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.
pBuffer | Pointer to the buffer that contains the data.
ulSize | Size of pBuffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If nError is < SUCCESS, pBuffer should be ignored.

The buffer pointed to by pBuffer will be freed upon returning from this function.

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

// a user defined class derived from LInet should be used to support the
// OnDataReceiving callback functions
// suppose it was named as LUserInet

LUserInet UserInet;
LInet L_FAR *plRemote;

// connect to LEAD
UserInet.Connect("207.238.49.190", 1000);

L_INT LUserInet::OnDataReceiving(LInet L_FAR plConnection, L_INT nError, L_CHAR L_FAR
pBuffer, L_UINT32 ulSize)
{
// other operations
return SUCCESS;
}


LInet::OnDataSending

#include "ltwrappr.h"

L_INT LInet::OnDataSending(plConnection, nError)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */

Overridable function that notifies a computer that queued data is being sent.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that is receiving data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

For an example, refer to LInet::OnDataSent.


LInet::OnDataSent

#include "ltwrappr.h"

virtual L_INT LInet::OnDataSent(plConnection, nError)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */

Overridable function that notifies a computer that data has been sent.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that will receive data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

// a user defined class derived from LInet should be used to support the
// OnDataSent and OnDataSending callback functions
// suppose it was named as LUserInet

LUserInet UserInet;
LInet L_FAR *plRemote;
L_CHAR L_FAR *pBuffer;
L_UINT32 L_FAR * pulBufferLength;

// connect to LEAD
UserInet.Connect("207.238.49.190", 1000);
UserInet.SendData(plRemote, pBuffer, pulBufferLength, IDATA_USER1);

L_INT LUserInet::OnDataSent(LInet L_FAR plConnection, L_INT nError)
{
// other operations
return SUCCESS;
}

L_INT LUserInet::OnDataSending(LInet L_FAR plConnection, L_INT nError)
{
// other operations
return SUCCESS;
}


LInet::OnDataStart

#include "ltwrappr.h"

L_INT LInet::OnDataStart(plConnection, nError)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */

Overridable function that notifies the computer that it has started to receive data.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that is sending the data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

// a user defined class derived from LInet should be used to support the OnDataStart callback function
// suppose it was named as LUserInet

LUserInet UserInet;
LInet L_FAR *plRemote;

// connect to LEAD
UserInet.Connect("207.238.49.190", 1000);

L_INT LUserInet::OnDataStart(LInet L_FAR plConnection, L_INT nError)
{
// other operations
return SUCCESS;
}


LInet::OnImageReceived

#include "ltwrappr.h"

virtual L_INT LInet::OnImageReceived(plConnection, nError, pBitmap)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
LBitmapBase L_FAR * pBitmap; | /* pointer to an LBitmapBase object */

Overridable function that notifies a computer that an image has been received.

Parameter | Description
plConnection | Pointer to the instance of remote computer that sent the image.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.
pBitmap | Pointer to the LBitmapBase object that references the received image.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Do not free or delete plConnection or pBitmap.

If this callback function is not derived, but an image window is set using LInet::SetImageWindow, the received image will be displayed on that window.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

For an example, refer to the NETCAP demo.


LInet::OnMMediaReceived

#include "ltwrappr.h"

L_INT LInet::OnMMediaReceived(plConnection, nError, pMedia)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
LMultimedia L_FAR * pMedia; | /* buffer containing data */

Overridable function that notifies a computer that multimedia data has been received.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that sent the multimedia data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.
pMedia | Pointer to the multimedia class instance that references the multimedia data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Do not free or delete plConnection or pMedia.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

// a user defined class derived from LInet should be used to support the
// OnMMediaReceiving callback functions
// suppose it was named as LUserInet

LUserInet UserInet;
LInet L_FAR *plRemote;

// connect to LEAD
UserInet.Connect("207.238.49.190", 1000);

L_INT LUserInet::OnMMediaReceived(LInet L_FAR plConnection, L_INT nError, LMultimedia L_FAR *pMedia)
{
// other operations
return SUCCESS;
}


LInet::OnSoundReceived

#include "ltwrappr.h"

L_INT LInet::OnSoundReceived(plConnection, nError, pWaveFormatData, ulWaveFormatSize, pWaveData)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
LPWAVEFORMATDATA pWaveFormatData; | /* pointer to a WAVEFORMATDATA structure */
L_UINT32 ulWaveFormatSize; | /* size of the WAVEFORMATDATA structure*/
LPWAVEDATA pWaveData; | /* pointer to a WAVEDATA structure */

Overridable function that notifies a computer that sound data has been received.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that sent the sound.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.
pWaveFormatData | Pointer to the WAVEFORMATDATA structure that contains information about the sound data.
ulWaveFormatSize | Size of the sound data that was sent.
pWaveData | Pointer to a WAVEDATA structure that contains the sound data.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

Do not delete any passed pointers.

If this callback function is not derived, the sound will be heard when it is received.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

Class Members

Example

For an example, refer to the NETCAP demo.


LInet::OnUser1Received

#include "ltwrappr.h"

L_INT LInet::OnUser1Received(plConnection, nError, pBuffer, ulSize)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
L_CHAR L_FAR * pBuffer; | /* buffer containing data */
L_UINT32 ulSize; | /* size of the buffer */

Overridable function that notifies a computer that user defined data has been received.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that sent the user-defined data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.
pBuffer | Pointer to the buffer that contains the data of a user-defined format.
ulSize | Size of pBuffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If nError is < SUCCESS, pBuffer should be ignored.

Immediately after successfully connecting to a LEADTOOLS server started with LInet::ServerInit, if auto process is enabled, this callback function will be the first one called and pBuffer will contain a NULL terminated string containing "LEAD Technologies Server X.X" where X.X is the server version number.

The buffer pointed to by pBuffer will be freed upon returning from the function.

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

For an example, refer to NETCAP demo.


LInet::OnUser2Received

#include "ltwrappr.h"

L_INT LInet::OnUser2Received(plConnection, nError, pBuffer, ulSize)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
L_CHAR L_FAR * pBuffer; | /* buffer containing data */
L_UINT32 ulSize; | /* size of the buffer */

Overridable function that notifies a computer that user defined data has been received.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that sent the user-defined data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.
pBuffer | Pointer to the buffer that contains the data of a user-defined format.
ulSize | Size of pBuffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If nError is < SUCCESS, pBuffer should be ignored.

The buffer pointed to by pBuffer will be freed upon returning from this function.

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

// a user defined class derived from LInet should be used to support the
// OnUser2Received, OnUser3Received and OnUser4Received callback functions
// suppose it was named as LUserInet

LUserInet UserInet;
LInet L_FAR *plRemote;
L_CHAR L_FAR *pBuffer;
L_UINT32 L_FAR * pulBufferLength;

// connect to LEAD
UserInet.Connect("207.238.49.190", 1000);
UserInet.SendData(plRemote, pBuffer, pulBufferLength, IDATA_USER2);
UserInet.SendData(plRemote, pBuffer, pulBufferLength, IDATA_USER3);
UserInet.SendData(plRemote, pBuffer, pulBufferLength, IDATA_USER4);

L_INT LUserInet::OnUser2Received(LInet L_FAR plConnection, L_INT nError, L_CHAR L_FAR *pBuffer, L_UINT32 ulSize)
{
// other operations
return SUCCESS;
}

L_INT LUserInet::OnUser3Received(LInet L_FAR plConnection, L_INT nError, L_CHAR L_FAR
pBuffer, L_UINT32 ulSize)
{
// other operations
return SUCCESS;
}

L_INT LUserInet::OnUser4Received(LInet L_FAR plConnection, L_INT nError, L_CHAR L_FAR *pBuffer, L_UINT32 ulSize)
{
// other operations
return SUCCESS;
}


LInet::OnUser3Received

#include "ltwrappr.h"

L_INT LInet::OnUser3Received(plConnection, nError, pBuffer, ulSize)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
L_CHAR L_FAR * pBuffer; | /* buffer containing data */
L_UINT32 ulSize; | /* size of the buffer */

Overridable function that notifies a computer that user defined data has been received.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that sent the user-defined data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.
pBuffer | Pointer to the buffer that contains the data of a user-defined format.
ulSize | Size of pBuffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If nError is < SUCCESS, pBuffer should be ignored.

The buffer pointed to by pBuffer will be freed upon returning from this function.

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

For a complete example, refer to the NETCAP demo.

For a short example, refer to LInet::OnUser2Received.


LInet::OnUser4Received

#include "ltwrappr.h"

L_INT LInet::OnUser4Received(plConnection, nError, pBuffer, ulSize)

LInet L_FAR * plConnection; | /* instance of a remote computer */
L_INT nError; | /* error code */
L_CHAR L_FAR * pBuffer; | /* buffer containing data */
L_UINT32 ulSize; | /* size of the buffer */

Overridable function that notifies a computer that user defined data has been received.

Parameter | Description
plConnection | Pointer to the instance of the remote computer that sent the user-defined data.
nError | If no error has occurred, nError will be SUCCESS. If nError is < SUCCESS, an error has occurred.
pBuffer | Pointer to the buffer that contains the data of a user-defined format.
ulSize | Size of pBuffer.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

If nError is < SUCCESS, pBuffer should be ignored.

The buffer pointed to by pBuffer will be freed upon returning from this function.

Do not delete plConnection.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | Class Members
Topics: | Sending and Receiving Data

Example

For a complete example, refer to the NETCAP demo.

For a short example, refer to LInet::OnUser2Received.


LInet::operator =

#include "ltwrappr.h"

LInet& LInet::operator =(LInetSrc)

LInet& LInetSrc;

/* the LInet object to copy */

Copies an LInet object from another LInet object.

Parameter | Description
LInetSrc | The LInet object to copy.

Returns

The LInet object.

Comments

Use this operator to make a copy of an LInet object from another LInet object. Only the LInet handle will be copied, all other data members of the destination object will not be changed.

The LInetSrc parameter is passed by reference, and is a required parameter.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

Class Members

Example

LInet MyInet1, MyInet2;

// other operations

//now copy the Inet
MyInet2 = MyInet1;


LInet::ReadData

#include "ltwrappr.h"

L_INT LInet::ReadData(plRemoteComp, pBuffer, pulBufferLength)

LInet plRemoteComp; | /* remote computer instance */
L_CHAR L_FAR * pBuffer; | /* pointer to the data buffer */
L_INT32 L_FAR * pulBufferLength; | /* address of length of buffer */

Reads data from a remote computer.

Parameter | Description
plRemoteComp | An instance of the remote computer from which data is being sent.
pBuffer | Address of the buffer to be filled with the read data
pulBufferLength | Address of the variable to be updated with the size of the read data

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

After this function returns, pulBufferLength will be updated with the actual length of read data. This function should only be used if auto process is disabled. You should call this function in response to the LInet::OnDataReady function.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::EnableAutoProcess, LInet::SendData, LInet::SendBitmap, LInet::SendSound, LInet::Connect, LInet::Close, LInet::ReadData, LInet::ServerInit, LInet::OnDataReady, LInet::StartUp, LInet::ShutDown, Class Members

Example

// The user should derive a class from LInet to support the OnConnect and OnDataReady callback functions
// Suppose it was named as LUserInet

LUserInet UserInet;
UserInet.StartUp();

// connect to LEAD.
UserInet.Connect("207.238.49.190", 1000);

// other operations

UserInet.ShutDown();

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
L_INT nRet = SUCCESS;

if (nError != SUCCESS)
return nError;

// set auto process to False to receive OnDataReady
if ( !plConnection->IsAutoProcessEnabled())
nRet = plConnection->EnableAutoProcess(FALSE);

return nRet;

}

L_INT LUserInet::OnDataReady(LInet L_FAR *plConnection, L_INT nError, L_VOID L_FAR *pBuffer, L_UINT32 ulSize)
{
HGLOBAL hData = NULL;
L_CHAR L_FAR *pData;
L_INT nRet = SUCCESS;

if (nError != SUCCESS)
return nError;

hData = GlobalAlloc(GHND, ulSize + 1);
pData = (L_CHAR L_FAR *)GlobalLock(hData);
if ( !pData)
{
GlobalUnlock(hData);
return FAILURE;
}

nRet = ReadData(plConnection, pData, &ulSize);
pData[ulSize] = 0; // make the data NULL-terminated
MessageBox(NULL, (L_TCHAR*)pData, TEXT("Data received"), MB_OK);

GlobalUnlock(hData);
GlobalFree(hData);

return nRet;
}


LInet::RemoveAllWndItems

#include "ltwrappr.h"

L_VOID LInet::RemoveAllWndItems(L_VOID)

Removes all the remote computer items from the connection list window.

Returns

None.

Comments

If the user calls LInet::EnableAutoWnd, then all the remote computers will be removed automatically from the window.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

win32

LInet::AddWndItem, LInet::RemoveWndItem, LInet::IsWndItem, Class Members

Example

LInet Inet;

// other operations

Inet.RemoveAllWndItems();


LInet::RemoveWndItem

#include "ltwrappr.h"

L_VOID LInet::RemoveWndItem(plRemoteComp)

LInet L_FAR * plRemoteComp;

/* instance of a remote computer */

Removes a remote computer from the connection list window.

Parameter | Description
plRemoteComp | Instance of the remote computer to be removed from connection list window.

Returns

None.

Comments

If the user calls LInet::EnableAutoWnd(TRUE), then the remote computer will be removed automatically from the window.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::AddWndItem, LInet::RemoveAllWndItems, LInet::IsWndItem, Class Members

Example

For an example, refer to LInet::AddWndItem.


LInet::ResponseCallBack

#include " ltwrappr.h "

virtual L_INT LInet::ResponseCallBack (plConnection, uCommand, uCommandID, nError, nStatus, uParams, pParams, uExtra, pExtra)

LInet L_FAR * plConnection; | /* instance of a remote computer */
CMDTYPE uCommand; | /* command type */
L_UINT uCommandID; | /* command id */
L_INT nError; | /* status of the received data */
L_INT nStatus; | /* status */
L_UINT uParams; | /* number of parameters */
pPARAMETER pParams; | /* pointer to parameters */
L_UINT uExtra; | /* length */
L_CHAR L_FAR * pExtra; | /* pointer to extra data */

Notifies a computer that a response has been received.

Parameter | Description
plConnection | Instance of the remote computer from which the command was sent.
uCommand | The command type which prompted this response. For a list of possible values, refer to CMDTYPE.
uCommandID | Command Id. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific request has been completed.
nError | Determines whether the response was received properly. If not all the parameters were received properly, then nStatus will be set to an error code (most likely ERROR_TRANSFER_ABORTED). Note that this is not the status of the command. This is only an indication of whether this response has been received properly. nStatus indicates whether the command has executed properly or not.
nStatus | Status of the original command. It indicates whether the command has executed properly on the remote end. If the command completes successfully, this should be SUCCESS. Otherwise the value should be one of the Return Codes.
uParams | The number of parameters for this response.
pParams | Pointer to an array of PARAMETER structures that contain the parameters for the response.
uExtra | Length of any extra data sent with the response.
pExtra | Pointer to the extra data sent with the response.

Returns

SUCCESS | This function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

A call to this overridable function is generated when a computer receives a response from a remote computer.

To process responses to commands, a class must be derived from LInet and this member function must be overridden.

Note: The parameters (uParams, pParams) and the extra data (uExtra, pExtra) for this response are not the parameters of the original command! They are only sent if this response needs to send some data to the computer that originally sent the command. An example of a response that needs to send a parameter back is the response for the CMD_CREATE_WIN command. In this case, the response will need to send back the window handle of the newly created window. Most of the responses will only send back the status of the command (nStatus).

The string parameters and pExtra are only valid during this call. Do not free these pointers and don’t try to keep references to the strings. If the data is needed outside this function, allocate buffers and copy the data into them.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::CommandCallBack, LInet::SendRsp, LInet::SendLoadRsp, LInet::SendCreateWinRsp, LInet::SendAttachBitmapRsp, LInet::SendSaveRsp, LInet::SendSizeWinRsp, LInet::SendShowWinRsp, LInet::SendCloseWinRsp, LInet::SendFreeBitmapRsp, LInet::SendSetRectRsp
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

L_INT CMyNet::ResponseCallBack(
LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_INT nStatus,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra
)
{
CString strMsg;

L_TCHAR *pszString=TEXT("INVALID CMD");

switch (uCommand)
{
case CMD_LOAD:
pszString = TEXT("CMD_LOAD");
break;

case CMD_SAVE:
pszString = TEXT("CMD_SAVE");
break;

case CMD_CREATE_WIN:
pszString = TEXT("CMD_CREATE_WIN");
break;

case CMD_SIZE_WIN:
pszString = TEXT("CMD_SIZE_WIN");
break;

case CMD_CLOSE_WIN:
pszString = TEXT("CMD_CLOSE_WIN");
break;

case CMD_SHOW_WIN:
pszString = TEXT("CMD_SHOW_WIN");
break;

case CMD_SET_RECT:
pszString = TEXT("CMD_SET_RECT");
break;

case CMD_SEND_ANN:
pszString = TEXT("CMD_SEND_ANN");
break;

case CMD_ATTACH_BITMAP:
pszString = TEXT("CMD_ATTACH_BITMAP");
break;

case CMD_FREE_BITMAP:
pszString = TEXT("CMD_FREE_BITMAP");
break;

case CMD_FLIP:
pszString = TEXT("CMD_FLIP");
break;

case CMD_GET:
pszString = TEXT("CMD_GET");
break;
}

strMsg.Format(TEXT("Response to %s, id=%d, nError=%d, uParams=%d, nStatus=%d%s received"),
pszString,
uCommandID,
nError,
uParams,
nStatus, uExtra ? TEXT(", uExtra") : TEXT("")
);
MessageBox(NULL, strMsg, TEXT(""), MB_OK);

return SUCCESS;
}


LInet::SendAttachBitmapCmd

#include " ltwrappr.h "

L_INT LInet::SendAttachBitmapCmd (plRemoteComp, uCommandID, uBitmapID, uWindowID)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uBitmapID; | /* bitmap id */
L_UINT uWindowID; | /* window id */

Sends an attach bitmap command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uBitmapID | The ID of the bitmap being attached. If the bitmap is successfully attached, then this bitmap will be painted whenever the window paints itself.
uWindowID | The id of the window that was just created.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendAttachBitmapRsp in its LInet::CommandCallBack function.

Once the remote computer receives this command it should always paint the specified bitmap inside the specified window. Both the bitmap and the window should exist on the remote computer. The remote computer will most likely paint the window at 1:1 ratio, adding scrollbars if possible. To change the way the bitmap is painted, call LInet::SendSetRectCmd.

The LInet::CommandCallBackfunction will receive the uBitmapID and uWindowID information in the pParams parameter. The uBitmapID information will be in pParams[0] and the uWindowID information will be in pParams[1].

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendAttachBitmapRsp, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to attach a loaded bitmap to a created window.
//It is assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class LInet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uWindowID is a window id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendCreateWinCmd()
//7. m_uBitmapID is a bitmap id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendLoadCmd()
void CMainFrame::OnRemoteAttachbitmaptowindow ()
{
L_INT nRet = SUCCESS;

nRet = m_Inet.SendAttachBitmapCmd(
m_pInetRemoteServer,
GetNextCommandID(),
m_uBitmapID,
m_uWindowID);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
{
UpdateStatusbar(TEXT("Error[%d]: OnRemoteLoadbitmap"), nRet);
}
else
{
UpdateStatusbar(TEXT("Success: OnRemoteLoadbitmap"), nRet);
}
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_ATTACH_BITMAP:
{
L_UINT32 uBitmapID = pParams[0].uiValue;
HWND uWindowID = (HWND)pParams[1].uiValue;

//pParams[0] uBitmapID
//pParams[1] uWindowID

//Need to attach bitmap to BitmapWindow
if (IsWndValid((HWND)uWindowID))
{
//Here you look up the uBitmapID in a list of
//BitmapWindow objects to verify
//that it is a valid ID. If it is, set the
//window handle of the BitmapWindow object
//to uWindowID

//Something like this...
/*
LBitmapWindow *pBitmapWindow;
pBitmapWindow = m_BitmapList[uBitmapID];
if (pBitmapWindow != NULL)
{
pBitmapWindow->SetWndHandle(uWindowID);
}
*/
}
}
return pMain->m_Inet.SendAttachBitmapRsp(
plConnection,
uCommandID,
0,
NULL,
nStatus);
break;

default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendAttachBitmapRsp

#include " ltwrappr.h "

L_INT LInet::SendAttachBitmapRsp (plRemoteComp, uCommandID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uExtra; | /* length of any extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* status */

Sends an attach bitmap response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uExtra | The size of the extra data (pExtra). Unused if pExtra is NULL.
pExtra | Pointer to any extra data needed by the response. Pass NULL if the response does not need to pass any extra data.
nStatus | Status of the original command. If the command completes successfully, this should be SUCCESS. Otherwise, it should be one of the Return Codes.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sends a response to an attach bitmap command that was sent from a remote computer using the LInet::SendAttachBitmapCmd.

To process commands, a class must be derived from LInet and the LInet::CommandCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendAttachBitmapCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendAttachBitmapCmd.


LInet::SendBitmap

#include "ltwrappr.h"

L_INT LInet::SendBitmap(plRemoteComp, pBitmap, nFormat, nBitsPerPixel, nQFactor, pulImageLength)

LInet L_FAR *plRemoteComp; | /* instance of a remote computer */
pBITMAPHANDLE pBitmap; | /* pointer to the bitmap handle */
L_INT nFormat; | /* output file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_UINT32 L_FAR *pulImageLength; | /* address of variable to update */

Saves a LEADTOOLS bitmap to a file in memory, and then sends the resulting memory file to a remote computer.

Parameter | Description
plRemoteComp | Instance of the remote computer to which bitmap data is to be sent.
pBitmap | Pointer to the bitmap handle referencing the bitmap to send.
nFormat | Value indicating the output file format of the file to send. For valid values, refer to Formats of Output Files .
nBitsPerPixel | Value indicating the 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 If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the pBitmap->BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the pBitmap->BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JFIF, FILE_LEAD1JFIF, FILE_LEAD2JFIF, FILE_JTIF, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process. For possible values, refer to Compression Quality Factors .
pulImageLength | Address of the variable to be updated with the size of the output image file. Pass NULL if you are not interested in the resulting file's size in memory.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The image in pBitmap is saved into a memory file in the format specified by nFormat. Then, the data is sent to the remote computer. LEADTOOLS headers are added to the beginning of the data before it is sent.

If the remote computer has enabled auto process by calling LInet::EnableAutoProcess, then the bitmap will be automatically loaded at the other end and the remote computer's LInet::OnImageReceived function will be called. If auto process is disabled by the remote computer, then the LEADTOOLS headers must be stripped by the receiver. The remote computer can then call LMemoryFile::LoadMemory to load the image, or the data can be saved directly into a file. In this case, the format of the file would be the value of nFormat.

If pulImageLength is not NULL, then the size of the resulting file in memory after it was saved is returned in pulImageLength.

Note that in most cases, the data will not be completely sent by the time this function returns. Only when the LInet::OnDataSent function is called can you be assured that all of the data has been sent to the remote computer.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendData, LInet::SendSound, LInet::Connect, LInet::Close, LInet::ReadData, LInet::EnableAutoProcess, LInet::ServerInit, LInet::ServerShutdown, LInet::ClearQueue, LInet::GetQueueSize, LInet::OnImageReceived, LInet::StartUp, LInet::ShutDown, Class Members
Topics: | Sending and Receiving Data

Example

// The user should derive a class from LInet to support the OnConnect callback function.
// Suppose it was named as LUserInet

LUserInet UserInet;
UserInet.StartUp();

// connect to LEAD.
UserInet.Connect("207.238.49.190", 1000);

// other operations

UserInet.ShutDown();

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
L_INT nRet = SUCCESS;
LBitmapBase Bitmap;

if (nError != SUCCESS)
return nError;

nRet = Bitmap.Load(TEXT("c:\\image1.cmp"), 0, ORDER_BGR);
if(nRet != SUCCESS)
{
LBase::DisplayError(NULL, TEXT("Error loading image!"));
return nRet;
}

// now you can assume you are connected to remote computer
nRet = SendBitmap(plConnection, Bitmap.GetHandle(), FILE_CMP, 24, 2, NULL);
if (nRet != SUCCESS)
LBase::DisplayError(NULL, TEXT("Error sending bitmap"));

// other operations

// close connection
Close(plConnection);

return nRet;
}


LInet::SendCloseWinCmd

#include " ltwrappr.h "

L_INT LInet::SendCloseWinCmd (plRemoteComp, uCommandID, uWindowID)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uWindowID; | /* window id */

Sends a close window command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uWindowID | The id of the window to close.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendCloseWinRsp in its LInet::CommandCallBack function.

The LInet::CommandCallBackfunction will receive the uWindowID information in the pParams parameter. The uWindowID information will be in pParams[0].

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendCloseWinRsp, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to close a window
//It is assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class LInet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uWindowID is a window id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendCreateWinCmd()
void CMainFrame::OnRemoteSendclosewincmd ()
{
L_INT nRet = SUCCESS;

nRet = m_Inet.SendCloseWinCmd(
m_pInetRemoteServer,
GetNextCommandID(),
m_uWindowID
);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
UpdateStatusbar(TEXT("Error[%d] OnRemoteSendclosewincmd"), nRet);
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_CLOSE_WIN:
{
L_INT nStatus = SUCCESS;
HWND uWindowID = (HWND)pParams[0].uiValue;

if (!CloseDocument((HWND)uWindowID))
{
nStatus = ERROR_INV_PARAMETER;
}
return pMain->m_Inet.SendCloseWinRsp (plConnection, uCommandID, 0, NULL, nStatus);
}
break;
default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendCloseWinRsp

#include " ltwrappr.h "

L_INT LInet::SendCloseWinRsp (plRemoteComp, uCommandID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uExtra; | /* length of extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* status */

Sends a close window response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uExtra | The size of the extra data (pExtra). Unused if pExtra is NULL.
pExtra | Pointer to any extra data needed by the response. Pass NULL if the response does not need to pass any extra data.
nStatus | Status of the original command. If the command completes successfully this should be SUCCESS. Otherwise, it should be one of the Return Codes.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sends a response to a close window command that was sent from a remote computer using the LInet::SendCloseWinCmd.

To process commands, a class must be derived from LInet and the LInet::CommandCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendCloseWinCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendCloseWinCmd.


LInet::SendCmd

#include " ltwrappr.h "

L_INT LInet::SendCmd (plRemoteComp, uCommand, uCommandID, pInetPacket=NULL)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
CMDTYPE uCommand; | /* command type */
L_UINT uCommandID; | /* command id */
LlnetPacket * plnetPacket=NULL; | /* pointer to an LlnetPacket object */

Sends a command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommand | The command to send. For a list of possible values, refer to CMDTYPE.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
plnetPacket | Pointer to an LlnetPacket object containing the parameters for the command. You can pass NULL if the command doesn't need any parameters.

Returns

SUCCESS | This function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendRsp in its LInet::CommandCallBack function.

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBack member function must be overridden.

Some commands will send back only the command’s status (indicating whether the command succeeded or not). But some commands will send back additional information if the command succeeds. For example, responses to LInet::SendLoadCmd will send the bitmap ID while responses to LInet::SendCreateWinCmd will send the window identifier (which can be used to resize or close the window).

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Funtions: | LInet::SendRsp, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to flip a bitmap
//It assumed that:
//1. m_Inet is an object of the class LInet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uWindowID is a window id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendCreateWinCmd()
//7. m_uBitmapID is a bitmap id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendLoadCmd()
void CMainFrame::OnRemoteFlipbitmap()
{
L_INT nRet;

CMDTYPE CMD_FLIP;
LInetPacket InetPacket(NULL, NULL, "%ud", m_uBitmapID);

nRet = m_Inet.SendCmd(m_pInetRemoteServer, CMD_FLIP, GetNextCommandID(), &InetPacket);
if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
{
UpdateStatusbar(TEXT("Error[%d]: OnRemoteFlipbitmap"), nRet);
}
else
{
UpdateStatusbar(TEXT("Success: OnRemoteFlipbitmap"), nRet);
}

//LInetPacket::~LInetPacket() destructor gets called here ...
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack(LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_FLIP:
{
uBitmapID = pParams->uiValue;

//Here you would look up the uBitmapID in a table to
//get the corresponding BitmapWindow object
//If the BitmapWindow object is valid, then flip the bitmap

/* Something like this
LBitmapWindow *pBitmapWindow = m_BitmapList[uBitmapID];
if (pBitmapWindow != NULL)
{
nStatus = pBitmapWindow->Flip();
}
*/
}
break;
}
return pMain->m_Inet.SendRsp(
plConnection,
uCommand,
uCommandID,
NULL,
nStatus
);
}


LInet::SendCreateWinCmd

#include " ltwrappr.h "

L_INT LInet::SendCreateWinCmd (plRemoteComp, uCommandID, pszClassName, pszWindowName, ulFlags, nLeft, nTop, nWidth, nHeight, uParentID)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_TCHAR L_FAR * pszClassName; | /* window class name */
L_TCHAR L_FAR * pszWindowName; | /* name of window */
L_UINT ulFlags; | /* window creation flags */
L_INT nLeft; | /* x coordinate */
L_INT nTop; | /* y coordinate */
L_INT nWidth; | /* width */
L_INT nHeight; | /* height */
L_UINT uParentID; | /* parent id */

Sends a create win command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
pszClassName | Character string containing the class name for which to register the window. This must be a valid string, and should be related to your application, to avoid conflicting with an existing registered window class name.
pszWindowName | Character string containing the name of the window. This parameter can be an empty string ("").
ulFlags | Flags that indicate how to create the window. It is recommended to use the same flags shown in CreateWindow in the Microsoft SDK. However, you can pass 0 if you do not wish to use ulFlags, or you can define your own flags.
nLeft | X coordinate for the origin of the window to create.
nTop | Y coordinate for the origin of the window to create.
nWidth | Requested width of the window's client area.
nHeight | Requested height of the window's client area.
uParentID | Id of the parent or owner window of the window being created.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendCreateWinRsp in its LInet::CommandCallBack function.

With this command, the local computer will signal the remote computer to create a window using the specified parameters. The window identifier will be sent in the response to this command.

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

The LInet::CommandCallBackfunction will receive the pszClassName, pszWindowName, ulFlags, nLeft, nTop, nWidth, nHeight and uParentID information in the pParams parameter. The pszClassName information will be in pParams[0]. The pszWindowName information will be in pParams[1], the ulFlags information will be in pParams[2], and so forth.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendCreateWinRsp, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to create a window.
//It is assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class LInet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uWindowID is a window id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendCreateWinCmd()
void CMainFrame::OnRemoteCreatewindow ()
{
L_INT nRet = SUCCESS;
L_INT nNotUsed = 0;

nRet = m_Inet.SendCreateWinCmd(
m_pInetRemoteServer,
GetNextCommandID(),
TEXT(""),
TEXT("Window created by remote computer"),
nNotUsed, nNotUsed, nNotUsed, 300, 300, 0);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
UpdateStatusbar(TEXT("Error[%d] OnRemoteCreatewindow"), nRet);
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_CREATE_WIN:
{
//Code to create a new window on the server goes here
//m_hWnd contains the window handle of the new window
//m_hWnd is returned in the response

//Your m_hWnd would be an actual window handle
HWND m_hWnd = 0;

return m_Inet.SendCreateWinRsp(
plConnection,
uCommandID,
(L_UINT)m_hWnd,
0,
NULL,
SUCCESS);
}
break;
default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendCreateWinRsp

#include " ltwrappr.h "

L_INT LInet::SendCreateWinRsp (plRemoteComp, uCommandID, uWindowID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uWindowID; | /* window id */
L_UINT uExtra; | /* length of extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* extra data */

Sends a create window response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uWindowID | The id of the window that was just created. This id should be unique for each create request.
uExtra | The size of the extra data (pExtra). Unused if pExtra is NULL.
pExtra | Pointer to any extra data needed by the response. Pass NULL if the response does not need to pass any extra data.
nStatus | Status of the original command. If the command completes successfully, this should be SUCCESS. Otherwise, it should be one of the Return Codes.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sends a response to a create window command that was sent from a remote computer using the LInet::SendCreateWinCmd.

To process commands, a class must be derived from LInet and the LInet::CommandCallBackmember function must be overridden.

The LInet::ResponseCallBackfunction will receive the uWindowID information in the pParams parameter. The uWindowID information will be in pParams[0].

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendCreateWinCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendCreateWinCmd.


LInet::SendData

#include "ltwrappr.h"

L_INT LInet::SendData(plRemoteComp, pBuffer, pulBufferLength, uDataType)

LInet plRemoteComp; | /* instance of a remote computer */
L_CHAR L_FAR * pBuffer; | /* pointer to the data buffer to send */
L_UINT32 L_FAR * pulBufferLength; | /* address of a variable to be updated with the length of the buffer */
L_UINT uDataType; | /* data type */

Sends data to a remote computer.

Parameter | Description
plRemoteComp | Instance of remote computer to which data will be sent
pBuffer | Pointer to the buffer that contains the data to send
pulBufferLength | Address of a variable that contains the length of buffer, and which will be updated with the amount of data actually sent.
uDataType | Value indicating the type of data being sent. This value determines the type of headers added to the data. Possible values are:
 | Value | Meaning
 | IDATA_IMAGE | [0x0000] image data
 | IDATA_MMEDIA | [0x0001] multimedia object
 | IDATA_USER1 | [0x0002] user data
 | IDATA_USER2 | [0x0003] user data
 | IDATA_USER3 | [0x0004] user data
 | IDATA_USER4 | [0x0005] user data
 | The receiving computer will receive the appropriate Callback functions as follows:
 | On Send: | On Receive:
 | IDATA_IMAGE | LInet::OnImageReceived
 | IDATA_MMEDIA | LInet::OnMMediaReceived
 | IDATA_USER1 | LInet::OnUser1Received
 | IDATA_USER2 | LInet::OnUser2Received
 | IDATA_USER3 | LInet::OnUser3Received
 | IDATA_USER4 | LInet::OnUser4Received
 | Note: If an error occurs during sending or receiving and the headers become corrupted, then LInet::OnUser1Received will be called on the receiving computer. This means that to differentiate your own user-defined data from bad frames, you can use IDATA_USER2, IDATA_USER3 or IDATA_USER4.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

After this function returns, pulBufferLength will be updated with the amount of data that was actually sent. If pulBufferLength is less than the original value, then the rest of the data is queued, and will be sent at a later time. You do not need to re-send the data.

Note: With this function, LEADTOOLS adds its own headers to the data being sent. These headers need to be stripped by the remote computer, in order for the actual data to be processed. The remote computer can set auto process by calling LInet::EnableAutoProcess in order for the headers to be stripped.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendRawData, LInet::Connect, LInet::Close, LInet::ReadData, LInet::SendBitmap, LInet::SendSound, LInet::EnableAutoProcess, LInet::ServerInit, LInet::ClearQueue, LInet::GetQueueSize, LInet::StartUp, LInet::ShutDown, Class Members
Topics: | Sending and Receiving Data

Example

For an example, refer to LInet::GetQueueSize.


LInet::SendFreeBitmapCmd

#include " ltwrappr.h "

L_INT LInet::SendFreeBitmapCmd (plRemoteComp, uCommandID, uBitmapID)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uBitmapID; | /* bitmap id */

Sends a free bitmap command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uBitmapID | The ID of the bitmap that should be freed.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The remote computer should free the bitmap associated with uBitmapID and respond by calling LInet::SendFreeBitmapRspin its LInet::CommandCallBackfunction.

The LInet::CommandCallBackfunction will receive the uBitmapID information in the pParams parameter. The uBitmapID information will be in pParams[0].

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendFreeBitmapRsp, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to free a bitmap
//It is assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class LInet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uBitmapID is a bitmap id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendLoadCmd()
void CMainFrame::OnRemoteSendfreebitmapcmd ()
{
L_INT nRet = SUCCESS;

nRet = m_Inet.SendFreeBitmapCmd(
m_pInetRemoteServer,
GetNextCommandID(),
m_uBitmapID
);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
UpdateStatusbar(TEXT("Error[%d] OnRemoteSendfreebitmapcmd"), nRet);
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_FREE_BITMAP:
{
L_INT nStatus = SUCCESS;
L_UINT uBitmapID = pParams[0].uiValue;

nStatus = m_BitmapList.DeleteBitmap (uBitmapID);
pMain->UpdateWindow();
return pMain->m_Inet.SendFreeBitmapRsp (plConnection, uCommandID, 0, NULL, nStatus);
}
break;
default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendFreeBitmapRsp

#include " ltwrappr.h "

L_INT LInet::SendFreeBitmapRsp (plRemoteComp, uCommandID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uExtra; | /* length of extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* status */

Sends a free bitmap response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Id of command. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uExtra | Length of extra data.
pExtra | Pointer to extra data associated with this response.
nStatus | Status of the original command. If the command completes successfully, this should be SUCCESS. Otherwise, it should be one of the Return Codes.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sends a response to a free bitmap command that was sent from a remote computer using the LInet::SendFreeBitmapCmd.

To process commands, a class must be derived from LInet and the LInet::CommandCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendFreeBitmapCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendFreeBitmapCmd.


LInet::SendLoadCmd

#include " ltwrappr.h "

L_INT LInet::SendLoadCmd (plRemoteComp, uCommandID, pszFile, nBitsPerPixel=0, nOrder=ORDER_BGR, uFlags=LOADFILE_ALLOCATE|LOADFILE_STORE)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_TCHAR L_FAR * pszFile; | /* filename */
L_INT nBitsPerPixel; | /* resulting bitmap pixel depth */
L_INT nOrder; | /* desired color order */
L_UINT uFlags; | /* flags that determine function behavior */

Sends a load command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed .
pszFile | Character string containing the name of the image file to load. This should be the name of a file on the computer receiving the command.
nBitsPerPixel | Resulting bitmap pixel depth. The following are valid values:
 | Value | Meaning
 | 0 | Keep the original file's pixel depth (Do not convert).
 | 1 to 8 | The specified bits per pixel in the resultant bitmap
 | 12 | 12 bits per pixel in the resultant bitmap.
 | 16 | 16 bits per pixel in the resultant bitmap
 | 24 | 24 bits per pixel in the resultant bitmap
 | 32 | 32 bits per pixel in the resultant bitmap
 | 48 | 48 bits per pixel in the resultant bitmap
 | 64 | 64 bits per pixel in the resultant bitmap
nOrder | Color order for 16-, 24-, 32-, 48-, and 64-bit bitmaps. If the resultant bitmap is less than 16 bits per pixel, this will have no effect since palettized images have no order. The following are valid values:
 | Value | Meaning
 | ORDER_RGB | [0] Red, green, and blue color order in memory
 | ORDER_BGR | [1] Blue, green, and red color order in memory
 | ORDER_GRAY | [2] 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are only supported in the Document/Medical Imaging editions .
 | ORDER_RGBORGRAY | [3] Load the image as red, green, blue OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
 | ORDER_BGRORGRAY | [4] Load the image as blue, green, red OR as a 12 or 16-bit grayscale image. 12 and 16-bit grayscale images are supported in the Document/Medical Imaging editions only.
uFlags | Binary flags that determine the behavior of the loading process. You can pass some user-defined flag values, or specify one or more of the following values:
 | Value | Meaning
 | LOADFILE_ALLOCATE | [0x0001] The function allocates memory for the specified bitmap. (This takes place in addition to the actions of your callback function.)
 | LOADFILE_STORE | [0x0002] The function loads data into the specified bitmap. (This takes place in addition to the actions of your callback function.)

Returns

SUCCESS | This function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendLoadRspin its LInet::CommandCallBackfunction.

With this command, the local computer will signal the remote computer to load a bitmap and send across the bitmap identifier (not the bitmap data!). The local computer can then use the bitmap identifier in other commands (like LInet::SendAttachBitmapCmd). The bitmap identifier will be sent in the response to this command.

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

The LInet::CommandCallBack function will receive the pszFile, nBitsPerPixel, nOrder and uFlags information in the pParams parameter. The pszFile information will be in pParams[0]. The nBitsPerPixel information will be in pParams[1], and so forth.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendLoadRsp, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to load a bitmap
//It assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class Linet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
void CMainFrame::OnRemoteLoadbitmap ()
{
L_INT nRet = SUCCESS;

nRet = m_Inet.SendLoadCmd(m_pInetRemoteServer, GetNextCommandID(), TEXT("..\\images\\image2.cmp"));
if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
{
UpdateStatusbar(TEXT("Error[%d]: OnRemoteLoadbitmap"), nRet);
}
else
{
UpdateStatusbar(TEXT("Success: OnRemoteLoadbitmap"), nRet);
}
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
CMainFrame *pMain;
pMain = GETMAINFRAME;

L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_LOAD:
{
//Here you would add the name bitmap to a list of bitmaps
//maintained on the server
//You must return an ID of the bitmap to the client
L_INT nIndex=0;

/* Code example
nIndex = m_BitmapList.AddBitmap(
pParams[0].pValue, //file name
pParams[1].iValue, //nBitsPerPixel
pParams[2].iValue //nOrder
);
*/

return m_Inet.SendLoadRsp(
plConnection,
uCommandID,
uBitmapID,
0,
NULL,
nStatus);
}
break;
default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendLoadRsp

#include " ltwrappr.h "

L_INT LInet::SendLoadRsp (plRemoteComp, uCommandID, uBitmapID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uBitmapID; | /* bitmap id */
L_UINT uExtra; | /* length of extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* status */

Sends a load response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uBitmapID | The id of the bitmap that was loaded. This id should be unique for each load request.
uExtra | The size of the extra data (pExtra). Unused if pExtra is NULL.
pExtra | Pointer to any extra data needed by the response. Pass NULL if the response does not need to pass any extra data.
nStatus | Status of the original command. If the command completes successfully, this should be SUCCESS. Otherwise, it should be one of the Return Codes.

Returns

SUCCESS | This function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

This function sends a response to a load command that was sent from a remote computer using the LInet::SendLoadCmd. This response provides the remote computer with an id to be used in identifying the bitmap.

To process commands, a class must be derived from LInet and the LInet::CommandCallBack member function must be overridden.

The LInet::ResponseCallBack function will receive the uBitmapID information in the pParams parameter. The uBitmapID information will be in pParams[0].

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendLoadCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendLoadCmd.


LInet::SendRawData

#include "ltwrappr.h"

L_INT LInet::SendRawData(plRemoteComp, pBuffer, pulBufferLength)

LInet L_FAR *plRemoteComp; | /* handle of remote computer */
L_CHAR L_FAR * pBuffer; | /* pointer to the data buffer to send */
L_INT32 L_FAR * pulBufferLength; | /* address of length of buffer */

Sends data to a remote computer.

Parameter | Description
plRemoteComp | Instance of remote computer to which data will be sent
pBuffer | Pointer to the buffer that contains the data to send
pulBufferLength | Address of a variable that contains the length of buffer, and which will be updated with the amount of data actually sent.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

After this function returns, pulBufferLength will be updated with the amount of data that was actually sent. If pulBufferLength is less than the original value, then the rest of the data is queued, and will be sent at a later time. You do not need to re-send the data.

Note: LEADTOOLS adds its own headers to the data being sent with LInet::SendData. LInet::SendRawData does not add any headers. The remote computer must disable auto process by calling LInet::EnableAutoProcess in order for the raw data to be received properly.

One possible use of this function, is to send raw data to a remote computer to detect if the remote is capable of handling LEADTOOLS’ headers. If the remote computer cannot handle LEADTOOLS' headers, then you can send all your data with LInet::SendRawData and keep auto process disabled on the remote computer for that connection.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendData, LInet::Connect, LInet::Close, LInet::ReadData, LInet::SendBitmap, LInet::SendSound, LInet::EnableAutoProcess, LInet::ServerInit, LInet::ClearQueue, LInet::GetQueueSize, LInet::StartUp, LInet::ShutDown, Class Members
Topics: | Sending and Receiving Data

Example

// a user defined class derived from LInet should be used to support the OnConnect callback function
// suppose it was named as LUserInet

LUserInet UserInet;
UserInet.StartUp();

// connect to LEAD.
UserInet.Connect("207.238.49.190", 1000);

// other operations
UserInet.ShutDown();

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
L_CHAR L_FAR *pData;
L_UINT32 ulDataSize;
L_INT nRet = SUCCESS;

if (nError != SUCCESS)
return nError;

pData = "Some Data";
ulDataSize = strlen(pData);

// now you can assume you are connected to remote computer
nRet = SendRawData(plConnection, pData, &ulDataSize);

// other operations

// we can close the connection without data loss with a graceful connection.
//The closing occurs immediately
// and all the data will not be sent.
Close(plConnection);

return nRet;
}


LInet::SendSaveCmd

#include " ltwrappr.h "

L_INT LInet::SendSaveCmd (plRemoteComp, uCommandID, pszFile, uBitmapID, nFormat, nBitsPerPixel, nQFactor, uFlags)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_TCHAR L_FAR * pszFile; | /* file name */
L_UINT uBitmapID; | /* bitmap id */
L_INT nFormat; | /* file format */
L_INT nBitsPerPixel; | /* resulting file's pixel depth */
L_INT nQFactor; | /* quality factor */
L_UINT uFlags; | /* flags that determine the save behavior */

Sends a save command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
pszFile | Character string containing the name of the image file to save.
uBitmapID | Id of the bitmap to save.
nFormat | Output file format. For valid values, refer to Formats of Output Files .
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 . If nBitsPerPixel is 0, the file will be stored using the closet BitsPerPixel value supported by that format. For example, if a file format supports 1, 4, and 24 BitsPerPixel, and the BitsPerPixel is 5, the file will be stored as 24 bit. Likewise, if the BitsPerPixel is 2, the file will be stored as 4 bit.
nQFactor | This parameter is used when saving an image file to FILE_CMP, FILE_JFIF, FILE_LEAD1JFIF, FILE_LEAD2JFIF, FILE_JTIF, FILE_LEAD1JTIF, FILE_LEAD2JTIF, FILE_FPX_JPEG_QFACTOR, and FILE_EXIF_JPEG. Qfactor is a number that determines the degree of loss in the compression process.For possible values, refer to Compression Quality Factors .
uFlags | Binary flags that determine the behavior of save. You can specify one of the following values listed below, or set user-defined flags.
 | Value | Meaning
 | SAVEFILE_FIXEDPALETTE | [0x0001] The function uses the fixed palette for images that are saved as 8 bits per pixel or less.
 | SAVEFILE_OPTIMIZEDPALETTE | [0x0002] The function uses the individual image's optimized palette for images that are saved as 8 bits per pixel or less. The optimized palette must be included in the bitmap handle.
 | SAVEFILE_MULTIPAGE | [0x0004] The function saves the image in a multi-page file. It appends the image as the last one in the file. You can save multi-page images in PCX, GIF, and most TIFF file formats (including JTIF, but excluding EXIF).

Returns

SUCCESS | This function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendLoadRspin its LInet::CommandCallBackfunction.

With this command, the local computer will signal the remote computer to save a bitmap.

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

The LInet::CommandCallBackfunction will receive the pszFile, uBitmapID, nFormat, nBitsPerPixel, nQFactor and uFlags information in the pParams parameter. The pszFile information will be in pParams[0]. The uBitmapID information will be in pParams[1], the nFormat information will be in pParams[2], and so forth.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendSaveRsp, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection save a loaded bitmap locally
//It is assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class LInet
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uBitmapID is a bitmap id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendLoadCmd()
void CMainFrame::OnRemoteSavebitmap ()
{
L_INT nRet;
nRet = m_Inet.SendSaveCmd(
m_pInetRemoteServer,
GetNextCommandID(),
TEXT("c:\\temp\\remote.tif"),
m_uBitmapID,
FILE_TIF);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
UpdateStatusbar(TEXT("Error[%d]: OnRemoteSavebitmap"), nRet);
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_SAVE:
{
uBitmapID = pParams[1].uiValue;

//Here you would look up the uBitmapID in a list
//of BitmapWindow objects maintained on the server.
//If the ID is valid, save as a local file on the
//server (pParams[0])

//Something like this...
/*
LBitmapWindow *pBitmapWindow = m_BitmapList[uBitmapID];

//pParams[0] file name
//pParams[1] bitmap id
//pParams[2] nFormat
//pParams[3] nBitsPerPixel
//pparams[4] nQFactor
//pParams[5] uFlags

if (pBitmapWindow != NULL)
{
L_INT nRet;
nRet = pBitmapWindow->Save(
pParams[0].pValue,
pParams[2].iValue,
pParams[3].iValue,
pParams[4].iValue,
pParams[5].iValue
);
if (nRet != SUCCESS)
nStatus = FAILURE;
}
*/
}
return pMain->m_Inet.SendSaveRsp(
plConnection,
uCommandID,
0,
NULL,
nStatus);
break;

default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendSaveRsp

#include " ltwrappr.h "

L_INT LInet::SendSaveRsp (plRemoteComp, uCommandID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uExtra; | /* length of extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* status */

Sends a save response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uExtra | The size of the extra data (pExtra). Unused if pExtra is NULL.
pExtra | Pointer to any extra data needed by the response. Pass NULL if the response does not need to pass any extra data.
nStatus | Status of the original command. If the command completes successfully, this should be SUCCESS. Otherwise, it should be one of the Return Codes.

Returns

SUCCESS | This function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

This function sends a response to a save command that was sent from a remote computer using the LInet::SendSaveCmd.

To process commands, a class must be derived from LInet and the LInet::CommandCallBack member function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendSaveCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendSaveCmd.


LInet::SendSetRectCmd

#include " ltwrappr.h "

L_INT LInet::SendSetRectCmd (plRemoteComp, uCommandID, uWindowID, nType, nLeft, nTop, nWidth, nHeight)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uWindowID; | /* window id */
RECTTYPE nType; | /* rectangle type */
L_INT nLeft; | /* horizontal position */
L_INT nTop; | /* vertical position */
L_INT nWidth; | /* vertical position */
L_INT nHeight; | /* height */

Sends a set rectangle command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uWindowID | The id of the window to receive the command.
nType | Type of rectangle to set. For possible values, refer to RECTTYPE.
nLeft | X coordinate of the origin of the display rectangle.
nTop | Y coordinate of the origin of the display rectangle.
nWidth | Width of the display rectangle.
nHeight | Height of the display rectangle.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendSetRectRspin its LInet::CommandCallBackfunction.

The LInet::CommandCallBackfunction will receive the uWindowID, nType, nLeft, nTop, nWidth and nHeight information in the pParams parameter. The uWindowID information will be in pParams[0]. The nType information will be in pParams[1], and so forth.

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

This command is only beneficial to windows that have a bitmap associated with them.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendSetRectRsp, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to zoom to the rectangle (30,30,80,80)
//It is assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class Linet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uWindowID is a window id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendCreateWinCmd()
void CMainFrame::OnRemoteSendsetrectcmd ()
{
L_INT nRet = SUCCESS;

nRet = m_Inet.SendSetRectCmdLInet::SendSetRectCmd (
m_pInetRemoteServer,
GetNextCommandID(),
m_uWindowID,
RECT_SRCALL,
30, //left
30, //top
80, //width
80 //height
);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
UpdateStatusbar(TEXT("Error[%d] OnRemoteSendsetrectcmd"), nRet);
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBackLInet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_SET_RECT:
{
L_INT nStatus = FAILURE;
uBitmapID = pParams->uiValue;

CNetDoc *pNetDoc = (CNetDoc*)GetDocFromHWnd((HWND)pParams[0].uiValue));

if (pNetDoc != NULL)
{
RECT rcRect;
rcRect.left = pParams[2].iValue;
rcRect.top = pParams[3].iValue;
rcRect.right = rcRect.left + pParams[4].iValue;
rcRect.bottom = rcRect.top + pParams[5].iValue;
pNetDoc->m_pBitmapWindow->EnableCallBack(TRUE);
nStatus = pNetDoc->m_pBitmapWindow->ZoomToRect(rcRect);
}
return pMain->m_Inet.SendSetRectRspLInet::SendSetRectRsp (plConnection, uCommandID,0,0,nStatus);
}
default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendSetRectRsp

#include " ltwrappr.h "

L_INT LInet::SendSetRectRsp (plRemoteComp, uCommandID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uExtra; | /* length of extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* status */

Sends a set rectangle response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uExtra | The size of the extra data (pExtra). Unused if pExtra is NULL.
pExtra | Pointer to any extra data needed by the response. Pass NULL if the response does not need to pass any extra data.
nStatus | Status of the original command. If the command completes successfully, this should be SUCCESS. Otherwise, it should be one of the Return Codes.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sends a response to a set rectangle command that was sent from a remote computer using the LInet::SendSetRectCmd.

To process commands, a class must be derived from LInet and the LInet::CommandCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendSetRectCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendSetRectCmd.


LInet::SendShowWinCmd

#include " ltwrappr.h "

L_INT LInet::SendShowWinCmd (plRemoteComp, uCommandID, uWindowID, nCmdShow)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uWindowID; | /* window id */
L_INT nCmdShow; | /* show flag */

Sends a show window command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uWindowID | The id of the window to show.
nCmdShow | Specifies how the window is to be shown. The possible values are the same as the nCmdShow parameter of the ShowWindow command from the Windows SDK.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendShowWinRsp in its LInet::CommandCallBack function.

The LInet::CommandCallBackfunction will receive the uWindowID and the nCmdShow information in the pParams parameter. The uWindowID information will be in pParams[0] and the nCmdShow information will be in pParams[1].

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendShowWinRsp, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to maximize a window
//It is assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class LInet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uWindowID is a window id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendCreateWinCmd()
void CMainFrame::OnRemoteSendshowwincmd ()
{
L_INT nRet = SUCCESS;

nRet = m_Inet.SendShowWinCmd(
m_pInetRemoteServer,
GetNextCommandID(),
m_uWindowID,
SW_SHOWMAXIMIZED
);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
UpdateStatusbar(TEXT("Error[%d] OnRemoteSendshowwincmd"), nRet);
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_SHOW_WIN:
{
L_INT nStatus = SUCCESS;
L_INT nRet;
HWND uWindowID = (HWND)pParams[0].uiValue;
L_INT nCmdShow = pParams[1].iValue;

if (IsWndValid((HWND)uWindowID))
{
nRet = ::ShowWindow(
::GetParent((HWND)uWindowID),
nCmdShow
);
if (nRet == 0)
nStatus = FAILURE;
}
else
{
nStatus = ERROR_INV_PARAMETER;
}
return pMain->m_Inet.SendShowWinRsp (plConnection, uCommandID, 0, NULL, nStatus);
}
break;
default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendShowWinRsp

#include " ltwrappr.h "

L_INT LInet::SendShowWinRsp (plRemoteComp, uCommandID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uExtra; | /* length of extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* status */

Sends a show window response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uExtra | The size of the extra data (pExtra). Unused if pExtra is NULL.
pExtra | Pointer to any extra data needed by the response. Pass NULL if the response does not need to pass any extra data.
nStatus | Status of the original command.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sends a response to a show window command that was sent from a remote computer using the LInet::SendShowWinCmd.

To process commands, a class must be derived from LInet and the LInet::CommandCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::SendShowWinCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members

Example

For an example, refer to LInet::SendShowWinCmd.


LInet::SendSizeWinCmd

#include " ltwrappr.h "

L_INT LInet::SendSizeWinCmd (plRemoteComp, uCommandID, uWindowID, nLeft, nTop, nWidth, nHeight)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* command id */
L_UINT uWindowID; | /* window id */
L_INT nLeft; | /* horizontal position */
L_INT nTop; | /* vertical position */
L_INT nWidth; | /* window width */
L_INT nHeight; | /* window height */

Sends a size window command to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the command will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uWindowID | The id of the window to size. This id should be unique for each window.
nLeft | X coordinate of the new origin of the window.
nTop | Y coordinate of the new origin of the window.
nWidth | New width of window.
nHeight | New height of window.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

The remote computer should respond by calling LInet::SendSizeWinRspin its LInet::CommandCallBackfunction.

With this command, the local computer will signal the remote computer to size a window using the specified parameters.

To process responses to commands, a class must be derived from LInet and the LInet::ResponseCallBackmember function must be overridden.

The LInet::CommandCallBackfunction will receive the uWindowID, nLeft, nTop, nWidth and nHeight information in the pParams parameter. The uWindowID information will be in pParams[0]. The nLeft information will be in pParams[1], and so forth.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendSizeWinRsp, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

//This example sends a message to a remote connection to resize the window
//m_uWindowID to be at (30,50) with width = 600 and height = 400.
//It is assumed that:
//1. m_Inet and m_pInetRemoteServer are an object of the class LInet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uWindowID is a window id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendCreateWinCmd()
void CMainFrame::OnRemoteSendsizewincmd ()
{
L_INT nRet = SUCCESS;

nRet = m_Inet.SendSizeWinCmd(
m_pInetRemoteServer,
GetNextCommandID(),
m_uWindowID,
30, //left
50, //top,
600, //width
400 //height
);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
UpdateStatusbar(TEXT("Error[%d] OnRemoteSendsizewincmd"), nRet);
}

//The CommandCallBack() is processed on the server
//To process the commands sent to the computer, you must:
//1. Derive a class from LInet
//2. Override the CommandCallBack member function
//
//Assume that
//1. m_Inet is an object of the class CMyNet (derived from LInet).
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote client
//4. UpdateStatusbar() displays a message in the status bar
//5. m_BitmapList maintains a list of LBitmapWindow objects
L_INT CMyNet::CommandCallBack (LInet L_FAR * plConnection,
CMDTYPE uCommand,
L_UINT uCommandID,
L_INT nError,
L_UINT uParams,
pPARAMETER pParams,
L_UINT uExtra,
L_CHAR L_FAR*pExtra)
{
L_INT nStatus = ERROR_FEATURE_NOT_SUPPORTED;
L_UINT uBitmapID = (L_UINT)-1;

CMainFrame *pMain;
pMain = GETMAINFRAME;

if(nError != SUCCESS)
nStatus = ERROR_TRANSFER_ABORTED;
else
switch(uCommand)
{
case CMD_SIZE_WIN:
{
L_INT nStatus = SUCCESS;
L_INT nRet;
HWND uWindowID = (HWND)pParams[0].uiValue;
L_UINT uLeft = pParams[1].uiValue;
L_UINT uTop = pParams[2].uiValue;
L_UINT uWidth = pParams[3].uiValue;
L_UINT uHeight = pParams[4].uiValue;

if (IsWndValid((HWND)uWindowID))
{
nRet = ::SetWindowPos(
::GetParent((HWND)uWindowID),
NULL,
uLeft,
uTop,
uWidth,
uHeight,
SWP_NOOWNERZORDER
);
if (nRet == 0)
nStatus = FAILURE;
}
else
{
nStatus = ERROR_INV_PARAMETER;
}
return pMain->m_Inet.SendSizeWinRsp(
plConnection,
uCommandID,
0,
NULL,
nStatus);
}
break;

default:
{
return nStatus;
}
}
return nStatus;
}


LInet::SendSizeWinRsp

#include " ltwrappr.h "

L_INT LInet::SendSizeWinRsp (plRemoteComp, uCommandID, uExtra, pExtra, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
L_UINT uCommandID; | /* id for command */
L_UINT uExtra; | /* length of extra data */
L_CHAR L_FAR * pExtra; | /* extra data */
L_INT nStatus; | /* status */

Sends a size window response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
uExtra | Length of any extra data associated with the response.
pExtra | Pointer to any extra data associated with the response.
nStatus | Pointer to any extra data associated with the response.

Returns

SUCCESS | This function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sends a response to a size window command that was sent from a remote computer using the LInet::SendSizeWinCmd.

To process commands, a class must be derived from LInet and the LInet::CommandCallBackmember function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendSizeWinCmd, LInet::CommandCallBack, LInet::ResponseCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendSizeWinCmd.


LInet::SendRsp

#include " ltwrappr.h "

L_INT LInet::SendRsp (plRemoteComp, uCommand, uCommandID, pInetPacket, nStatus)

LInet L_FAR * plRemoteComp; | /* instance of a remote computer */
CMDTYPE uCommand; | /* command type */
L_UINT uCommandID; | /* command id */
LlnetPacket * plnetPacket; | /* pointer to an LlnetPacket object */
L_INT nStatus; | /* status */

Sends a response to a remote computer. This function is only available in the Internet toolkit.

Parameter | Description
plRemoteComp | Instance of the remote computer to which the response will be sent.
uCommand | The command type which prompted this response. For a list of possible values, refer to CMDTYPE.
uCommandID | Command ID. Each command sent by a member of a connection should have a unique ID. Since a member of a connection may send several commands, this ID allows that member to identify when a specific command request has been completed.
plnetPacket | Pointer to an LlnetPacket object containing the parameters for the response. You can pass NULL if the command doesn't need any parameters.
nStatus | Status of the original command. If the command completes successfully, this should be SUCCESS. Otherwise, it should be one of the Return Codes.

Returns

SUCCESS | This function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

This function sends a response to a command that was sent from a remote computer using the LInet::SendCmd function.

To process commands, a class must be derived from LInet and the LInet::CommandCallBack member function must be overridden.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInet::SendCmd, LInet::ResponseCallBack, LInet::CommandCallBack, Class Members
Topics: | Sending Commands and Responses
 | A Client Server Diagram: Sending Commands and Responses

Example

For an example, refer to LInet::SendCmd.


LInet::SendSound

#include "ltwrappr.h"

L_INT LInet::SendSound(plRemoteComp, pWaveFormatData, pWaveData, pdwDataSize)

LInet plRemoteComp; | /* instance of a remote computer */
LPWAVEFORMATDATA pWaveFormatData; | /* pointer to a structure describing the sound format */
LPWAVEDATA pWaveData; | /* pointer to a structure containing the sound data */
L_UINT32 L_FAR * pdwDataSize; | /* address of a variable to be updated with the size of the data being sent */

Sends sound data to a remote computer.

Parameter | Description
plRemoteComp | Instance of a remote computer to which sound data will be sent.
pWaveFormatData | Pointer to a structure that describes the sound format.
pWaveData | Pointer to a structure containing the sound data.
pdwDataSize | Pointer to a variable which will be updated with the size of the data that was sent. This parameter is optional. You can pass NULL if you don't need this information.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function sends the pWaveFormatData structure first, including all the extra bytes needed by the format. It then sends the pWaveData structure, followed by the actual sound data.

A call to LInet::OnSoundReceived will be generated on the remote computer.

The remote end can use pWaveFormatData and pWaveData to save the sound to a file, or to play it (using LMMCapture::StartFeedSound).

The sound format is sent every time so that it will facilitate handling multiple connections to different computers that are recording sound in different formats.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::SendBitmap, LInet::SendData, LInet::Connect, LInet::Close, LInet::ReadData, LInet::EnableAutoProcess, LInet::ServerInit, LInet::ClearQueue, LInet::GetQueueSize, LInet::OnSoundReceived, LInet::StartUp, LInet::ShutDown¸ Class Members

Example

// This example contains code for both the server and the client program and shows how sound can be captured by the
// client and sent to the server.

// a user defined class derived from LInet should be used to support OnConnectRequest and
// OnSounrReceived callback function
// suppose it was named as LUserInet
// a user defined class derived from LMMCapture should be used to support RecordCallBack function
// suppose it was named as LUserMMcap;

// code on the server side
LUserInet UserServerInet;
LUserMMCapture UserServerMMcap;

UserServerInet.StartUp();

if (UserServerInet.ServerInit(1000) != SUCCESS)
LBase::DisplayError(NULL, TEXT("Error attempting to start the server"));

L_INT LUserInet::OnConnectRequest(LInet L_FAR *plConnection, L_INT nError)
{
L_INT nRet = SUCCESS;

if ( nError != SUCCESS)
return FAILURE;

nRet = AcceptConnect(plConnection);
if (nRet != SUCCESS)
{
LBase::DisplayError(NULL, TEXT("Error in accepting remote computer."));
return nRet;
}

nRet = UserServerMMcap.StopFeedSound ();
return nRet;
}

L_INT LUserInet::OnSoundReceived(LInet L_FAR *plConnection, L_INT nError, LPWAVEFORMATDATA pWaveFormatData, L_UINT32 ulWaveFormatSize, LPWAVEDATA pWaveData)
{
L_INT nRet = SUCCESS;

if ( nError != SUCCESS)
return FAILURE;

nRet = UserServerMMcap.StartFeedSound (NULL, CAP_DEVICE_MAPPER, pWaveFormatData, 0, CAP_FEED_PLAYDATA);
if (nRet != SUCCESS)
{
LBase::DisplayError(NULL, TEXT("Error starting sound."));
return nRet;
}

nRet = UserServerMMcap.FeedSound (pWaveData);
return nRet;
}

// code on the client side
LUserInet UserClientInet;
LUserMMCapture UserClientMMcap;

// connect to LEAD.
if (UserClientInet.Connect("207.238.49.190", 1000) != SUCCESS)
LBase::DisplayError(NULL, TEXT("Error attempting to connect"));

L_INT LUserMMCapture::RecordCallback (LPWAVEDATA pWaveData)
{
L_UINT32 dwTotalSize;
LPWAVEFORMATDATA pWaveFormatData;
L_INT nRet = SUCCESS;
LInet L_FAR *plRemote = NULL;

// Suppose that remote computer was the last one in my list
plRemote = UserClientInet.GetLastItem();
nRet = UserClientInet.SendSound(plRemote, pWaveFormatData, pWaveData, &dwTotalSize);

return nRet;
}

L_INT LUserInet::OnConnect(LInet L_FAR *plConnection, L_INT nError)
{
L_UINT uWaveFormatSize;
LPWAVEFORMATDATA pWaveFormatData;

if (nError != SUCCESS)
return nError;

// start recording in the current default Windows format
// get the format size
UserClientMMcap.GetDefaultAudFormat (NULL, &uWaveFormatSize, NULL, NULL);

// allocate memory and get the format
pWaveFormatData = (LPWAVEFORMATDATA)GlobalAllocPtr(GMEM_MOVEABLE, uWaveFormatSize);
UserClientMMcap.GetDefaultAudFormat (pWaveFormatData, &uWaveFormatSize, NULL, NULL);

if (UserClientMMcap.OpenRecord (CAP_DEVICE_MAPPER, pWaveFormatData, 0,
pWaveFormatData->nAvgBytesPerSec) != SUCCESS)
{
LBase::DisplayError(NULL, TEXT("Error starting recording!"));
return FAILURE;
}
UserClientMMcap.StartRecord ();

// i don't need this anymore
GlobalFreePtr(pWaveFormatData);
return SUCCESS;
}


LInet::ServerInit

#include "ltwrappr.h"

virtual L_INT LInet::ServerInit(nPort)

L_INT nPort;

/* port on which to listen */

Sets up a port to act as a server to which other computers can connect.

Parameter | Description
nPort | Port number on which to listen for incoming connections. Some commonly used values include:
 | Value | Meaning
 | 0x015 | FTP
 | 0x050 | Web server
 | 0x077 | News
 | 0x019 | Mail
 | 0x017 | Telnet

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::Connect, LInet::Close, LInet::AcceptConnect, LInet::ServerShutdown, LInet::StartUp, LInet::ShutDown, Class Members

Example

// The user should derive a class from LInet to support the OnConnectRequest callback function
// suppose it was named as LUserInet

LUserInet UserInet;
UserInet.StartUp();
UserInet.ServerInit(1000);

// other operations

UserInet.ServerShutdown();
UserInet.ShutDown();

L_INT LUserInet::OnConnectRequest(LInet L_FAR *plConnection, L_INT nError)
{
L_CHAR *pName;
L_TCHAR szString[150] = TEXT("\0");
L_INT nRet = SUCCESS;

if (nError != SUCCESS)
return nError;

// retrieve the remote computer name
if ((pName = plConnection->GetHostName(HOST_NAME_IP)) == NULL)
return FAILURE;

wsprintf(szString, TEXT("Some one requires connecting to you, his TCP/IP: %s, accept him ?"), pName);
if (IDYES == MessageBox(NULL, szString, TEXT(""), MB_YESNO))
{
if ((nRet = AcceptConnect(plConnection)) != SUCCESS)
return nRet;

MessageBox(NULL, TEXT("Remote computer accepted."), TEXT(""), MB_OK);
}

// other operations

// close the connection
Close(plConnection);

return nRet;
}


LInet::ServerShutDown

#include "ltwrappr.h"

virtual L_INT LInet::ServerShutDown(L_VOID)

Closes the server and all its connections.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

All client connections will be closed.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::Connect, LInet::ServerInit, LInet::StartUp, LInet::ShutDown, LInet::SendData, Class Members

Example

For an example, refer to LInet::ServerInit .


LInet::SetImageWindow

#include "ltwrappr.h"

L_VOID LInet::SetImageWindow(hWnd)

HWND hWnd;

/* image window handle */

Sets the window used to display a received image.

Parameter | Description
hWnd | Handle of the window used to display a received image.

Returns

None.

Comments

This function can be used to display received images.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::OnImageReceived, Class Members

Example

// a user defined class derived from LInet should be used to support the
// OnImageReceived callback function
// suppose it was named as LUserInet

LUserInet UserInet;
LInet L_FAR *plRemote;
LBitmapBase Bitmap;

// First side will send a bitmap.
// connect to LEAD
UserInet.Connect("207.238.49.190", 1000);
plRemote = UserInet.GetFirstItem();
UserInet.SendBitmap(plRemote, Bitmap.GetHandle(), FILE_CMP, 24, 2, NULL);

// Other side to receive the image
HWND hWnd;

// other operations
UserInet.SetImageWindow(hWnd);

// other operations
L_INT LUserInet:: OnImageReceived(LInet L_FAR *plConnection, L_INT nError, LBitmapBase L_FAR *pBitmap)
{
// to let the callback display the image.
LInet::OnImageReceived(plConnection, nError, pBitmap);
return SUCCESS;
}


LInet::ShutDown

#include "ltwrappr.h"

L_INT LInet::ShutDown(L_VOID)

Shuts down the LEADTOOLS Internet DLL.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

All connections will be closed. If the computer is a server, it will be stopped.

This function shuts down the LEADTOOLS Internet DLL. This must be the last function that is called to free up any memory that is associated with the Internet DLL. No other Internet function can be used after LInet::ShutDown is called. If you wish to use other functions after calling this function, LInet::StartUp must be called again.

You must initialize the LEADTOOLS Internet DLL using LInet::StartUp before calling this function.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::StartUp, LInet::SendSound, Class Members

Example

For an example, refer to LInet::ServerInit .


LInet::StartUp

#include "ltwrappr.h"

L_INT LInet::StartUp(L_VOID)

Initializes the LEADTOOLS Internet DLL.

Returns

SUCCESS | The function was successful.
< 1 | An error occurred. Refer to Return Codes.

Comments

This function initializes the LEADTOOLS Internet DLL. This must be the first function that is called before using any other Internet functions. For each call to LInet::StartUp, there needs to be a corresponding call to LInet::ShutDown.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInet::ShutDown, LInet::SendSound, Class Members

Example

For an example, refer to LInet::ServerInit.


LInetPacket::LInetPacket

#include "ltwrappr.h"

L_VOID LInetPacket::LInetPacket(L_VOID);

L_VOID LInetPacket::LInetPacket(uExtra, pExtra, pszFormat, …);

L_UINT uExtra; | /* size of the binary data */
L_VOID L_FAR * pExtra; | /* binary data to be sent */
L_CHAR L_FAR * pszFormat; | /* format describing the parameters */
… | /* variable list of parameters */

Constructs and initializes the member variables of the LlnetPacket object.

Parameter | Description
uExtra | Size of the binary data. Used only if pExtra is not NULL.
pExtra | Binary (extra) data to be sent. Use NULL if there is no binary data to send.
pszFormat | Format of the command parameters. Possible values are:
 | Value | Meaning
 | %d | decimal integer
 | %l | long signed integer
 | %c | character
 | %s | string
 | %ud | unsigned long integer
 | %us | unsigned short integer
 | %ss | signed short integer Variable list of parameters for this command.

Returns

None

Comments

LlnetPacket::LlnetPacket () is a constructor for the LlnetPacket object. It creates an LlnetPacket object with no extra data and no parameters.

Extra data can be added to the LlnetPacket object, or data can be changed by calling LlnetPacket::SetExtraData.

Parameter data can be added or changed by calling LlnetPacket::SetFormats.

LlnetPacket::LlnetPacket (uExtra, pExtra, pszFormat, ) is a constructor for the LlnetPacket object. It creates an LlnetPacket object with the specified extra data and parameters.

These functions allow the user to create a packet containing the parameters to send to a remote computer. Note that this packet can be used to send both commands and responses. The packet can contain a binary chunk (described with uExtra and pExtra) and a variable number of parameters (described by pszFormat). If there are no parameters to send, pszFormat can be either NULL or an empty string ("").

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInetPacket::~LInetPacket, Class Members

Example

For an example, refer to LInet::SendCmd.


LInetPacket::~LInetPacket

#include "ltwrappr.h"

virtual L_VOID LInetPacket::~LInetPacket(L_VOID)

Destroys the class object and frees any resources associated with it.

Returns

None

Comments

This is the destructor the for LlnetPacket class.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions:

LInetPacket::LInetPacket, Class Members

Example

For an example, refer to LInet::SendCmd.


LInetPacket::SetExtraData

#include "ltwrappr.h"

L_INT LInetPacket::SetExtraData(uExtra, pExtra)

L_UINT uExtra; | /* size of the binary data */
L_VOID L_FAR * pExtra; | /* binary data to be sent */

Sets or changes the extra data associated with the LlnetPacket object.

Parameter | Description
uExtra | Size of the binary data.
pExtra | Binary (extra) data to be set.

Returns

SUCCESS | The function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

This function allows the user to set or change the extra data associated with the LlnetPacket object. Note that this packet can be used to send both commands and responses. A packet can contain a binary chunk and a variable number of parameters.

To set or change the parameter data, call LInetPacket::SetFormats.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInetPacket::SetFormats, Class Members
Topics: | Sending Commands and Responses

Example

For an example, refer to LInetPacket::SetFormats.


LInetPacket::SetFormats

#include "ltwrappr.h"

L_INT LInetPacket::SetFormats(pszFormat)

L_CHAR L_FAR * pszFormat;

/* format describing the parameters */

Sets or changes the parameter data associated with the LlnetPacket object.

Parameter | Description
pszFormat | Format of the command parameters. Possible values are:
 | Value | Meaning
 | %d | decimal integer
 | %l | long signed integer
 | %c | character
 | %s | string
 | %ud | unsigned long integer
 | %us | unsigned short integer
 | %ss | signed short integer Variable list of parameters for this command.

Returns

SUCCESS | The function was successful.
< 1 | An occurred. Refer to Return Codes.

Comments

This function allows the user to set or change the parameter data associated with the LlnetPacket object. Note that this packet can be used to send both commands and responses. A packet can contain a binary chunk and a variable number of arguments.

To set or change the extra data, call LInetPacket::SetExtraData.

Required DLLs and Libraries

LTNET

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

See Also

Functions: | LInetPacket::SetExtraData, Class Members
Topics: | Sending Commands and Responses

Example

//This example sends a message to a remote connection to get a bitmap and send to the client
//This example also sets extra data to a sample string
//It is assumed that:
//1. m_Inet is an object of the class LInet.
//2. the network as been started (LInet::StartUp())
//3. a connection has been established with a remote server (LInet::m_Inet.Connect())
//4. GetNextCommandID() is a function that returns a unique command identifier
//5. UpdateStatusbar() is a function that displays a message in the status bar
//6. m_uWindowID is a window id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendCreateWinCmd()
//7. m_uBitmapID is a bitmap id that is received in the LInet::ResponseCallBack() as a result
// of a call to m_Inet.SendLoadCmd()
void OnRemoteGetbitmap ()
{
L_INT nRet;
LInetPacket InetPacket;
InetPacket.SetFormats("%ud", m_uBitmapID);

L_CHAR *pszExtraData = "*** Sample Extra Data ***\n";
InetPacket.SetExtraData (strlen(pszExtraData) + 1, pszExtraData );
nRet = m_Inet.SendCmd (m_pInetRemoteServer, (CMDTYPE)CMD_GET, GetNextCommandID(), &InetPacket);

if(nRet != SUCCESS && nRet != ERROR_DATA_QUEUED)
UpdateStatusbar(TEXT("Error[%d]: OnRemoteGetbitmap"), nRet);

//LInetPacket destructor called here ...
}


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 LSettings::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 .


LEADTOOLS Documentation

LEADTOOLS Reference Manuals

LEADTOOLS provides reference manuals that contain the same information as the online help. You can print them from PDF files. 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.

To print the PDF files, you must use the Adobe Acrobat Reader 3.0 or higher. You can download a copy of the Acrobat Reader from the Adobe web site (http://www.adobe.com). Note that different versions of the Acrobat Reader are available for different operating systems, but they all can read the same PDF files.


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.