Introduction

The LEADTOOLS Internet COM features are included, unlocked, in the LEADTOOLS Raster Pro and above toolkits. These features provide the ability to add Internet functionality to your application. LEADTOOLS Internet COM includes the following COM Object developed by LEAD Technologies, Inc.:

LEAD Raster Internet Object (ILEADRasterInet) is a COM Object for incorporating Internet functionality into your applications, including the ability to send and respond to messages between local and remote computers.

The Internet functionality requires Winsock 2.0 to be installed.

In the documentation, the properties, methods and events in the LEAD Internet Object are designated by (ILEADRasterInet).

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

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

You can use the LEADTOOLS Internet features in any programming environment that supports COM Objects, including the following:

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

Summary of All Supported Image File Formats

Registering the Internet COM Object


Registering the Internet COM Object

Registering COM Object

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

REGSVR32.EXE for 32-bit objects

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

EX.:

REGSVR32 LTRNT14N.DLL will register the LEAD Raster Internet Object.

Unregistering COM Object

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

REGSVR32.EXE for 32-bit objects

EX.:

REGSVR32 /u LTRNT14N.DLL will unregister the LEAD Raster Internet Object.

For a list of required DLLs for the Internet COM object, refer to Internet Files To Be Included With Your Application.


Example Programs

Note:

You can run some of the example programs on your system by clicking the appropriate buttons in online help. An error message will appear if you try to run an example program that is not on your system.

The executable files for these examples were compiled with Document/Medical capabilities. To get Document/Medical capabilities, you must buy a LEADTOOLS Document/Medical toolkit.

Visual C++ 5.0

EXAMPLES\COM\MSVC5\NETCMD contains a sample application that demonstrates most of the Internet capabilities in the Visual C++ 5.0 environment. You can open the project in Visual C++; then compile and run it.

Visual Basic

EXAMPLES\COM\VB\NETCMD32 contains a sample application that demonstrates most of the Internet capabilities in the Visual Basic 5.0 environment. You can open the project in Visual Basic; then compile and run it.


Version History

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

Changes from Version 14 to Version 14.5

Changes from Version 13 to Version 14

Changes from Version 12.1 to Version 13

Version 12.1


Changes from Version 14 to Version 14.5

Version 14.5 of the LEADTOOLS Internet COM Objects has not changed from Version 14.


Changes from Version 13 to Version 14

Version 14 of the LEADTOOLS Internet COM Objects has been updated to work better with scripting languages. Methods that used to take pointer parameters have been updated to work with the new ILEADRasterVariant object.

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

The rest of this topic lists the new properties, events, and methods in version 14.

InetConnectedComputer property

InetServerHandle property

InetHostName property

InetSendData2 method

InetSendSound2 method

InetGetData2 method

InetSendCmd2 method

InetSendRsp2 method

InetSendLoadRsp2 method

InetSendSaveRsp2 method

InetSendCreateWinRsp2 method

InetSendAttachBitmapRsp2 method

InetSendSizeWinRsp2 method

InetSendCloseWinRsp2 method

InetSendShowWinRsp2 method

InetSendSetRectRsp2 method

InetSendFreeBitmapRsp2 method

InetSendGetMagGlassDataCmd2 method

InetSendGetMagGlassDataRsp2 method

InetGetMagGlassData2 method

InetReceiveData2 event

InetReceiveRsp2 event

InetReceiveSound2 event

InetReceiveCmd2 event

EnableUseLEADRasterVariant Property


Changes from Version 12.1 to Version 13

Version 13 of the LEADTOOLS Internet COM Objects has not changed from Version 12.1.


Version 12.1

Version 12.1 is the first version of LEADTOOLS Internet COM Objects.

The rest of this topic lists the new methods, events, and properties in version 12.1.

ConnectList property

ConnectListNum property

EnableMethodErrors property

InetAccept event

InetAcceptConnect method

InetClearQueue method

InetConnect method

InetConnected event

InetDataSent event

InetDisconnect method

InetDisconnected event

InetError event

InetGetData method

InetGetHostName method

InetGetMagGlassData method

InetQueueSize property

InetReceiveBitmap event

InetReceiveCmd event

InetReceiveData event

InetReceiveRsp event

InetReceiveSound event

InetReceiveStart event

InetReceiving event

InetSendAttachBitmapCmd method

InetSendAttachBitmapRsp method

InetSendBitmap method

InetSendCloseWinCmd method

InetSendCloseWinRsp method

InetSendCmd method

InetSendCreateWinCmd method

InetSendCreateWinRsp method

InetSendData method

InetSendDIB method

InetSendFreeBitmapCmd method

InetSendFreeBitmapRsp method

InetSendGetMagGlassDataCmd method

InetSendGetMagGlassDataRsp method

InetSending event

InetSendLoadCmd method

InetSendLoadRsp method

InetSendRsp method

InetSendSaveCmd method

InetSendSaveRsp method

InetSendSetRectCmd method

InetSendSetRectRsp method

InetSendShowWinCmd method

InetSendShowWinRsp method

InetSendSizeWinCmd method

InetSendSizeWinRsp method

InetSendSound method

InetServerClose method

InetServerInit method

SendList property

SendListNum property


Copyright notice

Copyright Notices

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Trademarks

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

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

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

ScanAhead™ is a trademark of Pixel Translations, Inc.

FlashPix™ is a trademark of Eastman Kodak Company.

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

Address and Contact Information

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

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


Programming with LEADTOOLS Internet COM Object

The following topics provide a systematic approach to understanding and using the LEAD Internet object properties, methods, and events:

Implementing Internet Functionality

Client Server Diagram: Sending Commands and Responses

Sending Commands and Responses

Transferring Data and Sound


Implementing Internet Functionality

The LEADTOOLS Internet Features provide functionality that allows you to create client server applications that transfer data over the Internet or local intranets. All of the LEADTOOLS Internet functions require that a network connection be established. You can connect to a remote computer using the InetConnect method. This generates an InetAccept event on the remote computer, indicating that a computer requests a connection. You can setup a local computer to act as a server and listen for incoming connection requests using the InetServerInit method. If your application is acting as a server, it can accept connection requests using the InetAcceptConnect method. This generates an InetConnected event. A list of the connected computers is maintained in the ConnectList property and the number of connected computers is maintained in the ConnectListNum property. You can determine the name of the host computer using the InetGetHostName method.

While a network connection is open, you can:

1. transfer data and sound between local and remote computers.

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

To disconnect a remote computer, call InetDisconnect method. This generates an InetDisconnected event on the remote computer. To shutdown a server started with InetServerInit method, call InetServerClose method.


Transferring Data and Sound

While a network connection is open, you can transfer data between local and remote computers. To send data, use the InetSendData method. This generates an InetReceiveData event on the remote computer. To send a bitmap to a remote computer, call the InetSendBitmap method or InetSendDIB method. A call to either of these methods generates an InetReceiveBitmap event on the remote computer. To send sound data, use the InetSendSound method. This generates an InetReceiveSound event on the remote computer. During the sending process, data not immediately sent is held in a queue. As data is removed from the queue and sent to the remote computer, an InetSending event is generated. Prior to the first InetReceiveData event, an InetReceiveStart event is generated to indicate that a computer is about to start receiving data from a remote computer. Right after the InetReceiveStart event is generated, an InetReceiving event is generated. This event is generated for each chunk of data received. To send data to more than one computer, use the SendList property. The SendListNum property contains the number of computers in the SendList array. When all data for a specific object has been sent, an InetDetaSent event is generated. For Delphi, the InetGetData method can be used to get user-defined data sent through an Internet connection. The InetClearQueue method lets you clear the internal queue and abort data transfers. To determine the size of the internal queue, use the InetQueueSize property. Network errors generate an InetError event.


Sending Commands and Responses

(Internet only) LEADTOOLS provides a number of methods and events 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.

When a command is received from a remote computer, the InetReceiveCmd event is triggered locally. The supported command methods include the following:

InetSendCmd method

InetSendLoadCmd method

InetSendSaveCmd method

InetSendCreateWinCmd method

InetSendAttachBitmapCmd method

InetSendSizeWinCmd method

InetSendCloseWinCmd method

InetSendShowWinCmd method

InetSendSetRectCmd method

InetSendFreeBitmapCmd method

InetSendGetMagGlassDataCmd method

The computer that receives the command should then send a response to the computer that sent the command. The supported response methods include the following:

InetSendAttachBitmapRsp method

InetSendRsp method

InetSendLoadRsp method

InetSendSaveRsp method

InetSendCreateWinRsp method

InetSendSizeWinRsp method

InetSendCloseWinRsp method

InetSendShowWinRsp method

InetSendSetRectRsp method

InetSendFreeBitmapRsp method

InetSendGetMagGlassDataRsp method

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

While the InetSendLoadCmd method, the InetSendLoadRsp method, the InetSendSaveCmd method, the InetSendSaveRsp method, etc. provide standard image processing commands and responses, the InetSendCmd method and InetSendRsp method provide a means of creating user-defined commands and responses. For a diagram of a client server set-up for sending commands and responses, refer to Client-Server Diagram: Sending Commands and Responses.

The InetSendGetMagGlassDataCmd and InetSendGetMagGlassDataRsp methods can be used to update a magnifying glass bitmap. When transferring information across the Internet to update a magnifying glass bitmap, use the InetGetMagGlassData method to retrieve the required array of colors.


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
 | Set the computer to act as a server and listen for connection requests | InetServerInit method
InetConnect method | --------------------------------------------------> The client requests a connection with the server. This generates an InetAccept event on the server. | InetAccept event
InetConnected event | <-------------------------------------------------- The server accepts the connection request. This generates an InetConnected event on the client. | InetAcceptConnect method
InetSendLoadCmd method | --------------------------------------------------> The client sends a load command to the server to load a specific image. This generates an InetReceiveCmd event on the server. | InetReceiveCmd event
InetReceiveRsp event | <-------------------------------------------------- The server receives the load command and responds by calling the InetSendLoadRsp method. This generates an InetReceiveRsp event on the client. | InetSendLoadRsp method
InetSendCmd method | --------------------------------------------------> The client sends a flip command using the InetSendCmd method. This generates another InetReceiveCmd event on the server. | InetReceiveCmd event
InetReceiveRsp event | <-------------------------------------------------- The server calls the InetSendRsp methodin response to receiving the InetSendCmd method call from the client. This generates another InetReceiveRsp event on the client. | InetSendRsp method
InetSendSaveCmd method | --------------------------------------------------> The client sends a save command using the InetSendSaveCmd method. This generates another InetReceiveCmd event on the server. | InetReceiveCmd event
InetReceiveRsp event | <-------------------------------------------------- The server calls the InetSendSaveRsp method in response to receiving the InetSendSaveCmd method call from the client. This generates another InetReceiveRsp eventon the client. | InetSendSaveRsp method
InetDisconnect method | --------------------------------------------------> The client has finished sending all the commands and closes the connection to the server. This generates an InetDisconnected event on the server. | InetDisconnected event


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\COM\INET

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 COM Objects Registration.

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

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

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

Redistributables: | Explanation: | If you are using a standard release without Unicode, the files to use are: | If you are using a standard release with Unicode, the files to use are: | If you are using an evaluation release without Unicode, the files to use are: | If you are using an evaluation release with Unicode, the files to use are:
LTRNT | Internet support. LEAD Internet COM Object LTRNT14N.DLL is the LEADTOOLS Internet Object DLL. Additional required files are installed by WS2SETUP.EXE (Winsock 2.0). | DLL: LTRNT14N.DLL | DLL: LTRNT14NU.DLL | DLL: LTRNT14E.DLL | DLL: LTRNT14EU.DLL


Installation Directory

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

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

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

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


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 Properties, methods, and events

Working with Internet Functionality

Network Connections

Sending and Receiving Data

Command Messages

Response Messages


Working with Internet Functionality: Command Messages

Working with Internet Functionality
Command Messages

InetReceiveCmd event

InetSendCmd method

InetSendLoadCmd method

InetSendSaveCmd method

InetSendCreateWinCmd method

InetSendAttachBitmapCmd method

InetSendSizeWinCmd method

InetSendCloseWinCmd method

InetSendShowWinCmd method

InetSendSetRectCmd method

InetSendFreeBitmapCmd method

InetSendGetMagGlassDataCmd method

InetSendCmd2 method

InetSendGetMagGlassDataCmd2 method

InetReceiveCmd2 event


Working with Internet Functionality: Network Connections

Working with Internet Functionality
Network Connections

ConnectList property

ConnnectListNum property

EnableMethodErrors property

InetAccept event

InetAcceptConnect method

InetConnect method

InetConnected event

InetConnectedComputer property

InetDisconnect method

InetDisconnected event

InetError event

InetServerClose method

InetServerHandle property

InetServerInit method


Working with Internet Functionality: Response Messages

Working with Internet Functionality
Response Messages

InetReceiveRsp event

InetSendRsp method

InetSendLoadRsp method

InetSendSaveRsp method

InetSendCreateWinRsp method

InetSendAttachBitmapRsp method

InetSendSizeWinRsp method

InetSendCloseWinRsp method

InetSendShowWinRsp method

InetSendSetRectRsp method

InetSendFreeBitmapRsp method

InetSendGetMagGlassDataRsp method

InetSendRsp2 method

InetSendLoadRsp2 method

InetSendSaveRsp2 method

InetSendCreateWinRsp2 method

InetSendAttachBitmapRsp2 method

InetSendSizeWinRsp2 method

InetSendCloseWinRsp2 method

InetSendShowWinRsp2 method

InetSendSetRectRsp2 method

InetSendFreeBitmapRsp2 method

InetSendGetMagGlassDataRsp2 method

InetReceiveRsp2 event


Working with Internet Functionality: Sending and Receiving Data

Working with Internet Functionality
Sending and Receiving Data

InetClearQueue method

InetDataSent event

InetGetData method

InetGetHostName method

InetGetMagGlassData method

InetHostName property

InetQueueSize property

InetReceiveBitmap event

InetReceiveData event

InetReceiveSound event

InetReceiveStart event

InetReceiving event

InetSendBitmap method

InetSendData method

InetSendDIB method

InetSending event

InetSendSound method

SendList property

SendListNum property

InetSendData2 method

InetSendSound2 method

InetGetData2 method

InetGetMagGlassData2 method

InetReceiveData2 event

InetReceiveSound2 event


Data Types

Internet Data Types

DisplayRectType

InetCmdType

InetParamType

Interfaces

ILEADRasterInetPacket


DisplayRectType

typedef enum tagDisplayRectType
{
DISPLAY_RECT_SRC, /* source */
DISPLAY_RECT_SRCCLIP, /* source clip */
DISPLAY_RECT_DST, /* destination */
DISPLAY_RECT_DSTCLIP, /* destination clip */
} DisplayRectType;

The DisplayRectType data type contains the display rectangle types used by the Internet command methods.


ILEADRasterInetPacket

The ILEADRasterInetPacket represents a LEADTOOLS Internet Data Packet. It contains parameter data sent to an event.

Properties:

Property Name
Data Type
Description
Examples

EnableMethodErrors

VARIANT_BOOL

Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). If EnableMethodErrors is TRUE, the runtime exceptions will be generated. If FALSE, they will not be generated.

Visual Basic Example
Visual C++ 5.0 Example

ParamCount

long

Gets/Sets the number of parameters for the packet. Set this to > 0 to set the number of parameters for the packet. Set this to 0 to free all existing parameters. If this property is >0, it must first be set to 0 before changing its value.

Visual Basic Example
Visual C++ 5.0 Example

ParamType (long nIndex)

InetParamType

Gets/Sets the type of the specified parameter. Each parameter sent to the event has a type. Note, you cannot change a non-string type to a string, and you cannot change a string to a non-string type.

Visual Basic Example
Visual C++ 5.0 Example

ParamValue (long nIndex)

VARIANT

Gets/Sets the value of the specified parameter. For each parameter sent to the event, there is a parameter value.

Visual Basic Example
Visual C++ 5.0 Example

Comments

Setting ParamCount to a value greater than 0 allocates the memory for the specified number of parameters. Therefore, if ParamCount is 2, then memory has been allocated for two parameters. In order to change ParamCount to 3, it must first be set to 0 to free the existing parameters and then set to 3 to allocate the memory for the new parameters.


InetCmdType

typedef enum tagInetCmdType

{

   INETCMD_LOAD
 = 0, /* load a file */
INETCMD_SAVE = 1, /* save a file */
INETCMD_CREATE_WIN = 2, /* create a window */
INETCMD_SIZE_WIN = 3, /* size a new window */
INETCMD_CLOSE_WIN = 4, /* close a window */
INETCMD_SHOW_WIN = 5, /* show/hide the window */
INETCMD_SET_RECT = 6, /* set bitmap display rectangles
 */
INETCMD_SEND_ANN = 7, /* not implemented yet */
INETCMD_ATTACH_BITMAP = 8, /* attach the bitmap
 to the control */
INETCMD_FREE_BITMAP = 9, /* free the bitmap */
INETCMD_GET_MAGGLASS_DATA = 10, /* get MagGlass
 needed data */
INETCMD_USER_REG = 10000, /* start of registered
 user command values */
INETCMD_USER_CUSTOM = 20000, /* start of custom
 user command values */

} InetCmdType;

The InetCmdType data type contains the predefined commands used by the Internet command methods.

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.


InetParamType

typedef enum tagInetParamType

{
PARAM_TYPE_INT32, /* signed integer */
PARAM_TYPE_UINT32, /* unsigned integer */
PARAM_TYPE_CHAR, /* signed character */
PARAM_TYPE_UCHAR, /* unsigned character */
PARAM_TYPE_STRING, /* strings */
PARAM_TYPE_LONG, /* long */
PARAM_TYPE_UINT16, /* unsigned short */
PARAM_TYPE_INT16, /* signed short */
PARAM_TYPE_USTRING, /* unsigned string */
} InetParamType;

The InetParamType data type contains the parameter types used by the Internet command methods.


Error Codes

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


A Special Note About UNICODE Support

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

General Notes For VC++ Programmers:

1.

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

For example:

ILEADRasterIO_U *pRasterIO=NULL;

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

2.

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

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

For example:

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

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

General Notes For VB Programmers:

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

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

For example:

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

General Notes For Delphi and C++ Builder Programmers:

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

Note:

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

For example:

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


Tutorial for Visual Basic Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS ILEADRasterInet object.

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

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Initializing a Computer as a Server and Accepting Connections

Connecting to a Remote Computer

Sending Images to a Remote Computer

Receiving and Displaying Images from a Remote Computer

Miscellaneous Examples


Initializing a Computer as a Server and Accepting Connections (Visual Basic)

Take the following steps to start a project and to add some code that will let you initialize a computer as a server and accept connections.

1. | Start Visual Basic. Select Standard EXE and click Open.
2. | Add the LEAD Raster Object, LEAD Raster Variant Object and LEAD Raster Internet Object to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.0), LEAD Raster Variant Object Library (14.0) and LEAD Raster Internet Object Library (14.0).
3. | Add a command button and name it as follows:
 | Name | Caption
 | ServerInit | Init Server
4. | Define global variables as follows:

Public hServer as Integer ' handle to server
Public WithEvents LEADNet1 As LEADRasterInet

5.

Code the Form_Load() procedure as follows:

Private Sub Form_Load()
Dim Factory As New LEADRasterFactory
Dim LEADRaster As LEADRaster
Dim szLic As String
Dim szKey As String

'create a temp LEADRaster object and use it
szLic = "LEADTOOLS OCX Copyright (c) 1991-2004 LEAD
 Technologies, Inc."
Set LEADRaster = Factory.CreateObject("LEADRaster.LEADRaster",
 szLic)
'create the Inet object
Set LEADNet1 = CreateObject("LEADRasterInet.LEADRasterInet")

LEADNet1.EnableMethodErrors
 = False
End Sub

6.

Code the ServerInit_Click procedure as follows:

Private Sub ServerInit_Click()
Dim nRet As Integer

' initialize server on port 1000
nRet = LEADNet1.InetServerInit(1000)
hServer = LEADNet1.InetServerHandle

If nRet <> 0 Then
MsgBox "Error initializing server:" + CStr(nRet)
End If
End Sub

7.

Code the LEADNet1_InetAccept procedure as follows:

Private Sub LEADNet1_InetAccept(ByVal iServer As Integer)
Dim hComputer As Integer
Dim hName As String

nRet = LEADNet1.InetAcceptConnect(hServer)
hComputer = LEADNet1.InetConnectedComputer

If nRet <> 0 Then
MsgBox "Error accepting connection:" + CStr(nRet)
Exit Sub
End If

LEADNet1.InetGetHostName hComputer, HOST_NAME_DESCRP
hName = LEADNet1.InetHostName

'add to our list
LEADNet1.SendList(LEADNet1.SendListNum) = hComputer

MsgBox "Connection accepted from:" + hName
End Sub

8.

Code the main form's Form_Unload procedure as follows:

Private Sub Form_Unload(Cancel As Integer)
Dim i As Integer

'disconnect all connections
For i = 0 To LEADNet1.ConnectListNum - 1
LEADNet1.InetDisconnect LEADNet1.ConnectList(i)
Next i
'release the Inet object
Set LEADNet1 = Nothing
End Sub

9. | Run your program to test it.
10. | Save the project to use as the server for other tutorials. Create an EXE that you can run from outside Visual Basic.


Connecting to a Remote Computer (Visual Basic)

Take the following steps to start a project and to add some code that will let you connect to a remote computer that is acting as a server.

1. | Run the server exe you created in Initializing a Computer as a Server and Accepting Connections from out side Visual Basic.
2. | Start Visual Basic. On the New tab, select Standard EXE and click Open to create a new application.
3. | Add the LEAD Raster Object, LEAD Raster Variant Object and LEAD Raster Internet Object to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD Raster Object Library (14.0), LEAD Raster Variant Object Library (14.0) and LEAD Raster Internet Object Library (14.0).
4. | Add a Text box to the main form and name it as follows:
 | Name
 | RemoteComputer.
 | Set the Text property to the name of the computer you will use as a server, or set it to 207.238.49.190.
5. | Add two command buttons to the form and give them the following names:
 | Name | Caption
 | Connect | Connect To Remote
 | Disconnect | Disconnect From Remote
6. | Define global variables as follows:

Public WithEvents LEADNet1 As LEADRasterInet

7.

Code the Form_Load() procedure as follows:

Private Sub Form_Load()
Dim Factory As New LEADRasterFactory
Dim LEADRaster As LEADRaster
Dim szLic As String
Dim szKey As String

'create a temp LEADRaster object and use it
szLic = "LEADTOOLS OCX Copyright (c) 1991-2004 LEAD
 Technologies, Inc."
Set LEADRaster = Factory.CreateObject("LEADRaster.LEADRaster",
 szLic)
'create the Inet object
Set LEADNet1 = CreateObject("LEADRasterInet.LEADRasterInet")

LEADNet1.EnableMethodErrors
 = False
End Sub

8.

Code the Connect_Click procedure as follows:

Private Sub Connect_Click()
Dim nRet As Integer
'connect to remote computer on port 1000
nRet = LEADNet1.InetConnect(RemoteComputer.Text, 1000)

If nRet <> 0 Then
MsgBox "Error connecting to:" + RemoteComputer.Text + ":" + CStr(nRet)
Exit Sub
End If
End Sub

9.

Code the Disconnect_Click procedure as follows:

Private Sub Disconnect_Click()
Dim nRet As Integer

'we are assuming on one connection in this example, therefore the handle
'to the remote computer will be in the first position in the SendList
nRet = LEADNet1.InetDisconnect(LEADNet1.SendList(0))

If nRet <> 0 Then
MsgBox "Error disconnecting from remote:" + CStr(nRet)
End If
End Sub

10.

Code the LEADNet1_InetConnected event as follows:

Private Sub LEADNet1_InetConnected(ByVal iComputer As Integer)

Dim sRemote As String

'get remote host name
LEADNet1.InetGetHostName iComputer, HOST_NAME_DESCRP
sRemote = LEADNet1.InetHostName

'add this connection to our SendList
LEADNet1.SendList(LEADNet1.SendListNum) = iComputer
MsgBox "Successfully connected to remote computer:" + sRemote
End Sub

11.

Code the LEADNet1_InetDisconnected event as follows:

Private Sub LEADNet1_InetDisconnected(ByVal iComputer As Integer)

MsgBox "Disconnect from remote computer"

End Sub

12. | Run your program to test it. Enter the name of the computer that is serving as the server in the text box. For testing purposes you might want to run both the server and the remote programs on the same computer.
13. | Save the project to use as a starting point for other tutorials.


Sending Images to a Remote Computer (Visual Basic)

Take the following steps to add some code that will let you send images to a remote computer.

1. | Start with the project you created in Initializing a Computer as a Server and Accepting Connections.
2 | Add the LEAD RasterView Control to your project.
 | For VB5: On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.0).
3. | Select the LEAD RasterView Control; then add the control to your main form. Size and position the control, as you want it to appear at run time.
4. | Add a command button to the form and name it as follows:
 | Name | Caption
 | Send | Send Bitmap
5. | Add the LEAD RasterIO Object and LEAD RasterProcess Object to your project.
 | For VB5: On the Project pull-down menu, use the References option, and select the LEAD RasterIO Object Library (14.0) and LEAD RasterProcess Object Library (14.0).
6. | Define the following at the form level:

Private Declare Function GlobalFree Lib "kernel32" (ByVal hMem As Long) As Long

7.

Code the Send_Click procedure as follows:

Private Sub Send_Click()
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
Dim hDIB As Long

If (LEADRasterView1.Raster.Bitmap = 0) Then
RasterIO.Load LEADRasterView1.Raster, "o:\images\new\001.jpg", 0, 1, 1
End If
RasterProc.Flip LEADRasterView1.Raster
'send the images to the remote computer
hDIB = LEADRasterView1.Raster.GetDIB
LEADNet1.InetSendDIB hDIB, FILE_CMP, 24, 75
GlobalFree hDIB
End Sub

8. | Run your program to test it.
9. | Make an EXE from this tutorial to use as a server for other tutorials.


Receiving and Displaying Images from a Remote Computer (Visual Basic)

Take the following steps to add some code that will let you receive and display images received from a computer acting as a server.

1. | Run the EXE you created in Sending Images to a Remote Computer from outside Visual Basic.
2. | Start Visual Basic.
3. | Open the example you created in Connecting to a Remote Computer.
4 | Add the LEAD RasterView Control to your project.
 | For VB5: On the Project pull-down menu, use the Components option, and select the LEAD RasterView Control (14.0).
5. | Select the LEAD RasterView Control; then add the control to your main form. Size and position the control as you want it to appear at run time. Set the BackErase property to False.
6. | Code the LEADNet1_InetReceiveBitmap event as follows:

Private Sub LEADNet1_InetReceiveBitmap(ByVal iComputer As Integer, ByVal hBitmap As Long)

'assign bitmap to LEAD RasterView control
LEADRasterView1.Raster.Bitmap = hBitmap
DoEvents
End Sub

7.

Run your program to test it.


Miscellaneous Examples (Visual Basic)

You can test the following examples by either adding a command button to one of the previous lessons in the tutorial and pasting the sample code in the Click procedure, or by cutting and pasting event code into the appropriate event in a lesson.

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

InetAcceptConnect Example for Visual Basic

InetClearQueue Example for Visual Basic

InetConnect Example for Visual Basic

InetConnected Example for Visual Basic

InetDataSent Example for Visual Basic

InetDisconnect Example for Visual Basic

InetDisconnected Example for Visual Basic

InetError Example for Visual Basic

InetReceiveBitmap Example for Visual Basic

InetReceiveCmd Example for Visual Basic

InetReceiveData Example for Visual Basic

InetReceiveRsp Example for Visual Basic

InetReceiveSound Example for Visual Basic

InetReceiveStart Example for Visual Basic

InetReceiving Example for Visual Basic

InetSendAttachBitmapCmd Example Visual Basic

InetSendBitmap Example for Visual Basic

InetSendCloseWinCmd Example for Visual Basic

InetSendCloseWinRsp Example for Visual Basic

InetSendCmd Example for Visual Basic

InetSendCreateWinCmd Example for Visual Basic

InetSendData Example for Visual Basic

InetSendDIB Example for Visual Basic

InetSendFreeBitmapCmd Example for Visual Basic

InetSendFreeBitmapRsp Example for Visual Basic

InetSendGetMagGlassDataCmd Example for Visual Basic

InetSendGetMagGlassDataRsp Example for Visual Basic

InetSending Example for Visual Basic

InetSendLoadCmd Example for Visual Basic

InetSendLoadRsp Example for Visual Basic

InetSendSaveCmd Example for Visual Basic

InetSendSetRectCmd Example for Visual Basic

InetSendSetRectRsp Example for Visual Basic

InetSendShowWinCmd Example for Visual Basic

InetSendShowWinRsp Example for Visual Basic

InetSendSizeWinCmd Example for Visual Basic

InetSendSizeWinRsp Example for Visual Basic

InetSendSound Example for Visual Basic

InetServerClose Example for Visual Basic

InetServerInit Example for Visual Basic

InetSendData2 Example for Visual Basic

InetSendSound2 Example for Visual Basic

InetSendCmd2 Example for Visual Basic

InetSendLoadRsp2 Example for Visual Basic

InetSendSizeWinRsp2 Example for Visual Basic

InetSendCloseWinRsp2 Example for Visual Basic

InetSendShowWinRsp2 Example for Visual Basic

InetSendSetRectRsp2 Example for Visual Basic

InetSendFreeBitmapRsp2 Example for Visual Basic

InetSendGetMagGlassDataCmd2 Example for Visual Basic

InetSendGetMagGlassDataRsp2 Example for Visual Basic

InetReceiveData2 Example for Visual Basic

InetReceiveRsp2 Example for Visual Basic

InetReceiveSound2 Example for Visual Basic

InetReceiveCmd2 Example for Visual Basic


InetAcceptConnect Example for Visual Basic

This is also the example for the InetAccept event, the SendList property and the SendListNum property.

Private Sub LEADNet1_InetAccept(ByVal iServer As Integer)
Dim iComp As Integer

LEADNet1.InetAcceptConnect iServer
IComp = LEADNet1.InetConnectedComputer
' add connection to send list
LEADNet1.SendList(LEADNet1.SendListNum) = iComp
End Sub


InetClearQueue Example for Visual Basic

This is also the example for the InetQueueSize property.

' This example checks the size of computers in the send lists before it sends data to the remote
' computer. It uses the LEAD Capture Control for recording audio data. Refer to the LEAD Capture
’ Control documentation for an example of recording audio data

Private Sub LEADCap1_CapAudioData(ByVal pData As Variant, ByVal lBytesRecorded As Long, ByVal iIndex As Integer)

Dim i As Integer
Dim qSize As Long
Dim RasterVar1 As LEADRasterVariant
Dim RasterVar2 As LEADRasterVariant
Dim pExtraData As Variant

' check the queue size of all computers in SendList
' this is the list of computers that are connected to us
For i = 0 To LEADServer.SendListNum - 1
qSize = LEADServer.InetQueueSize(LEADServer.SendList(i))
' clear queue there is more than 10 seconds worth of sound data
If qSize > (LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD) * 10) Then
LEADServer.InetClearQueue(LEADServer.SendList(i))
End If
Next

vExtraData = LEADCap1.CapWaveExtraData(CAP_AUDIO_RECORD)

If VarType(vExtraData) = vbArray Or vbByte Then
RasterVar1.Type = VALUE_ARRAY_BYTE
size = UBound(vExtraData) - LBound(vExtraData) + 1
Dim LArray(size) As Byte
LArray = vExtraData
RasterVar1.ItemCount = size
For i = 0 To i < size - 1 Step 1
RasterVar1.ShortItemValue(i) = Array(i)
Next i

ElseIf VarType(vExtraData) = vbString Then
RasterVar1.Type = VALUE_STRING
RasterVar1.StringValue = vExtraData

Else
Exit Sub
End If

If VarType(pData) = vbArray Or vbByte Then
RasterVar2.Type = VALUE_ARRAY_BYTE
size = UBound(pData) - LBound(pData) + 1
Dim LArray(size) As Byte
LArray = pData
RasterVar2.ItemCount = size
For i = 0 To i < size - 1 Step 1
RasterVar2.ShortItemValue(i) = Array(i)
Next i

ElseIf VarType(pData) = vbString Then
RasterVar2.Type = VALUE_STRING
RasterVar2.StringValue = pData

Else
Exit Sub
End If

'send data to all clients in the server send list
If (LEADServer.SendListNum > 0) Then
LEADServer.InetSendSound LEADCap1.CapWaveFormatTag(CAP_AUDIO_RECORD), LEADCap1.CapWaveChannels(CAP_AUDIO_RECORD), LEADCap1.CapWaveSamplesPerSec(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD), LEADCap1.CapWaveBlockAlign(CAP_AUDIO_RECORD), LEADCap1.CapWaveBitsPerSample(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveExtraSize(CAP_AUDIO_RECORD), RasterVar1, RasterVar2, lBytesRecorded
End If

' check the queue size of all computers in SendList
' this is the list of computers that we are connected to
For i = 0 To LEADServer.SendListNum - 1
qSize = LEADClient.InetQueueSize(LEADClient.SendList(i))
' clear queue there is more than 10 seconds worth of sound data
If qSize > (LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD) * 10) Then
LEADClient.InetClearQueue (LEADClient.SendList(i))
End If
Next

'send data to all servers in the client send list
If (LEADClient.SendListNum > 0) Then
LEADClient.InetSendSound LEADCap1.CapWaveFormatTag(CAP_AUDIO_RECORD), LEADCap1.CapWaveChannels(CAP_AUDIO_RECORD), LEADCap1.CapWaveSamplesPerSec(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD), LEADCap1.CapWaveBlockAlign(CAP_AUDIO_RECORD), LEADCap1.CapWaveBitsPerSample(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveExtraSize(CAP_AUDIO_RECORD), RasterVar1, RasterVar2, lBytesRecorded
End If
End Sub


InetConnect Example for Visual Basic

Private Sub Command1_Click()
' connect to computer 127.0.0.1
LEADNet1.InetConnect "127.0.0.1", 1000
End Sub


InetConnected Example for Visual Basic

This is also the example for the InetGetHostName method.

Private Sub LEADNet1_InetConnected (ByVal iComputer As Integer)
Dim hostname As String

' add remote computer to our send list
LEADNet1.SendList(LEADNet1.SendListNum) = iComputer
' get remote computer name
LEADNet1.InetGetHostName iComputer, HOST_NAME_DESCRP
hostname = LEADNet1.InetHostName
' display host descriptive name
MsgBox hostname
End Sub


InetDataSent Example for Visual Basic

Private Sub LEADNet1_InetDataSent (ByVal iComputer As Integer, ByVal lSize As Long)
' display the amount of data sent
MsgBox "Data Sent: " + CStr(lSize) + " bytes"
End Sub


InetDisconnect Example for Visual Basic

This is also the example for the ConnectList property and ConnectListNum property.

Private Sub Command4_Click()
Dim i As Integer

' disconnect all connections
For i = 0 To LEADNet1.ConnectListNum
 - 1
LEADNet1.InetDisconnect
 LEADNet1.ConnectList(i)
Next i
End Sub


InetDisconnected Example for Visual Basic

Private Sub LEADNet1_InetDisconnected (ByVal iComputer As Integer)
MsgBox CStr(iComputer) + " disconnected"
End Sub


InetError Example for Visual Basic

Private Sub LEADNet1_InetError (ByVal iComputer As Integer, ByVal iMessage As Integer, ByVal iError As Integer)
MsgBox "Computer: " + CStr(iComputer) + " had Error: " + CStr(iError) + " at: " + CStr(iMessage)
End Sub


InetReceiveBitmap Example for Visual Basic

Private Sub LEADNet1_InetReceiveBitmap (ByVal iComputer As Integer, ByVal hBitmap As Long)
'assign bitmap to LEAD RasterView control
LEADRasterView1.Raster.Bitmap = hBitmap
DoEvents
End Sub


InetReceiveCmd Example for Visual Basic

' my user defined commands
Private Const INETCMD_FLIP = INETCMD_USER_CUSTOM

Private Function ProcessFlipCommand(ByVal nID&) As Integer
MsgBox "Flip"
ProcessFlipCommand = 0
End Function

Private Sub LEADNet1_InetReceiveCmd(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)

Dim szOut$
Dim nRet As Integer
Dim nStatus As Integer
Dim i As Integer
Dim pszData As String

nStatus = ERROR_FEATURE_NOT_SUPPORTED

szOut$ = "Command " & CStr(InetCommand) & " id=" & CStr(nCommandID) & ", nError=" & CStr(nError) & " nParams=" & CStr(Params.ParamCount) & " received"
If (nExtraDataSize > 0) Then
szOut$ = szOut$ & ", nExtraDataSize=" & CStr(nExtraDataSize)
End If
Debug.Print (szOut$)
If (nExtraDataSize > 0) Then
' convert to a string
For i = 0 To nExtraDataSize - 1
pszData = pszData + Chr(ExtraData(i))
Next
Debug.Print "ExtraData: " & pszData
End If

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_FLIP:
If ((Params.ParamCount = 1) And (Params.ParamType(0) = PARAM_TYPE_UINT32)) Then
'Note: This is a function you have to create
nStatus = ProcessFlipCommand(Params.ParamValue(0).DoubleValue)
Else
nStatus = ERROR_INV_PARAMETER
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetReceiveCmd2 Example for Visual Basic

' my user defined commands
Private Const INETCMD_FLIP = INETCMD_USER_CUSTOM

Private Function ProcessFlipCommand(ByVal nID&) As Integer
MsgBox "Flip"
ProcessFlipCommand = 0
End Function

Private Sub LEADNet1_InetReceiveCmd2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)

Dim szOut$
Dim nRet As Integer
Dim nStatus As Integer
Dim i As Integer
Dim pszData As String

nStatus = ERROR_FEATURE_NOT_SUPPORTED

szOut$ = "Command " & CStr(InetCommand) & " id=" & CStr(nCommandID) & ", nError=" & CStr(nError) & " nParams=" & CStr(Params.ParamCount) & " received"
If (nExtraDataSize > 0) Then
szOut$ = szOut$ & ", nExtraDataSize=" & CStr(nExtraDataSize)
End If
Debug.Print (szOut$)
If (nExtraDataSize > 0) Then
' convert to a string
For i = 0 To nExtraDataSize - 1
pszData = pszData + Chr(ExtraData(i))
Next
Debug.Print "ExtraData: " & pszData
End If

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_FLIP:
If ((Params.ParamCount = 1) And (Params.ParamType(0) = PARAM_TYPE_UINT32)) Then
'Note: This is a function you have to create
nStatus = ProcessFlipCommand(CLng(Params.ParamValue(0)))
Else
nStatus = ERROR_INV_PARAMETER
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetReceiveData Example for Visual Basic

Private Sub LEADNet1_InetReceiveData(ByVal iComputer As Integer, ByVal pData As LEADRasterVariant, ByVal lSize As Long, ByVal iType As Integer)
Dim i As Integer
Dim pszData As String
' convert to a string
pszData = pData.StringValue
MsgBox CStr(iComputer) + ": " + pszData
End Sub


InetReceiveData2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveData2(ByVal iComputer As Integer, ByVal pData As Variant, ByVal lSize As Long, ByVal iType As Integer)
Dim i As Integer
Dim pszData As String

' convert to a string
For i = 0 To lSize - 1
pszData = pszData + Chr(pData(i))
Next
MsgBox CStr(iComputer) + ": " + pszData
End Sub


InetReceiveRsp Example for Visual Basic

Private Sub LEADNet1_InetReceiveRsp(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal nStatus As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nRet As Integer
Dim szOut$
Dim i As Integer
Dim pszData As String

szOut$ = "Command " & CStr(InetCommand) & " id=" & CStr(nCommandID) & ", nError=" & CStr(nError) & " nStatus=" & CStr(nStatus) & " nParams=" & CStr(Params.ParamCount) & " received"
If (nExtraDataSize > 0) Then
szOut$ = szOut$ & ", nExtraDataSize=" & CStr(nExtraDataSize)
End If
Debug.Print (szOut$)
If (nExtraDataSize > 0) Then
' convert to a string
pszData = ExtraData.StringValue
Debug.Print "ExtraData: " & pszData
End If

If (nError <> 0) Then Exit Sub

Select Case InetCommand
Case INETCMD_LOAD
If ((nStatus = 0) Or (nStatus = 1)) Then
If ((Params.ParamCount = 1) And (Params.ParamType(0) = PARAM_TYPE_UINT32)) Then
Debug.Print "Load SUCCEEDED!"
Else
Debug.Print "Load failed with error code " & CStr(nStatus)
End If
End If
End Select
End Sub


InetReceiveRsp2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveRsp2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal nStatus As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer
Dim szOut$
Dim i As Integer
Dim pszData As String

szOut$ = "Command " & CStr(InetCommand) & " id=" & CStr(nCommandID) & ", nError=" & CStr(nError) & " nStatus=" & CStr(nStatus) & " nParams=" & CStr(Params.ParamCount) & " received"
If (nExtraDataSize > 0) Then
szOut$ = szOut$ & ", nExtraDataSize=" & CStr(nExtraDataSize)
End If
Debug.Print (szOut$)
If (nExtraDataSize > 0) Then
' convert to a string
For i = 0 To nExtraDataSize - 1
pszData = pszData + Chr(ExtraData(i))
Next
Debug.Print "ExtraData: " & pszData
End If

If (nError <> 0) Then Exit Sub

Select Case InetCommand
Case INETCMD_LOAD
If ((nStatus = 0) Or (nStatus = 1)) Then
If ((Params.ParamCount = 1) And (Params.ParamType(0) = PARAM_TYPE_UINT32)) Then
Debug.Print "Load SUCCEEDED!"
Else
Debug.Print "Load failed with error code " & CStr(nStatus)
End If
End If
End Select
End Sub


InetReceiveSound Example for Visual Basic

Dim bInit As Boolean

Private Sub LEADNet1_InetReceiveSound (ByVal iComputer As Integer, ByVal iFormatTag As
Integer, ByVal nChannels As Integer, ByVal lSamplesPerSec As Long, ByVal lAvgBytesPerSec
As Long, ByVal iBlockAlign As Integer, ByVal iBitsPerSample As Integer, ByVal
iExtraDataSize As Integer, ByVal pExtraData As Variant, ByVal pData As Variant, ByVal
lDataSize As Long)
' this example uses the LEAD Capture Module for sound playback

If Not bInit Then
LEADCap1.CapWaveFormatTag(CAP_AUDIO_FEED) = iFormatTag
LEADCap1.CapWaveChannels(CAP_AUDIO_FEED) = nChannels
LEADCap1.CapWaveSamplesPerSec(CAP_AUDIO_FEED) = lSamplesPerSec
LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_FEED) = lAvgBytesPerSec
LEADCap1.CapWaveBlockAlign(CAP_AUDIO_FEED) = iBlockAlign
LEADCap1.CapWaveBitsPerSample(CAP_AUDIO_FEED) = iBitsPerSample
LEADCap1.CapWaveExtraData(CAP_AUDIO_FEED) = pExtraData
LEADCap1.CapWaveExtraSize(CAP_AUDIO_FEED) = iExtraDataSize
' initialize feed sound process
LEADCap1.CapStartFeedSound " c:\capture.wav", 0, 2, CAP_FEED_SAVEDATA, hSound
bInit = True
Else
LEADCap1.CapFeedSound hSound, pData, lDataSize
End If

' when finished playing sound LEADCap1.CapStopFeedSound should be called, a good
' place to do it would be in the InetDisconnected event
End Sub


InetReceiveSound2 Example for Visual Basic

Dim bInit As Boolean

Private Sub LEADNet1_InetReceiveSound2 (ByVal iComputer As Integer, ByVal iFormatTag As
Integer, ByVal nChannels As Integer, ByVal lSamplesPerSec As Long, ByVal lAvgBytesPerSec
As Long, ByVal iBlockAlign As Integer, ByVal iBitsPerSample As Integer, ByVal
iExtraDataSize As Integer, ByVal pExtraData As Variant, ByVal pData As Variant, ByVal
lDataSize As Long)
' this example uses the LEAD Capture Module for sound playback

If Not bInit Then
LEADCap1.CapWaveFormatTag(CAP_AUDIO_FEED) = iFormatTag
LEADCap1.CapWaveChannels(CAP_AUDIO_FEED) = nChannels
LEADCap1.CapWaveSamplesPerSec(CAP_AUDIO_FEED) = lSamplesPerSec
LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_FEED) = lAvgBytesPerSec
LEADCap1.CapWaveBlockAlign(CAP_AUDIO_FEED) = iBlockAlign
LEADCap1.CapWaveBitsPerSample(CAP_AUDIO_FEED) = iBitsPerSample
LEADCap1.CapWaveExtraData(CAP_AUDIO_FEED) = pExtraData
LEADCap1.CapWaveExtraSize(CAP_AUDIO_FEED) = iExtraDataSize
' initialize feed sound process
LEADCap1.CapStartFeedSound " c:\capture.wav", 0, 2, CAP_FEED_SAVEDATA, hSound
bInit = True
Else
LEADCap1.CapFeedSound hSound, pData, lDataSize
End If

' when finished playing sound LEADCap1.CapStopFeedSound should be called, a good
' place to do it would be in the InetDisconnected event
End Sub


InetReceiveStart Example for Visual Basic

Private Sub LEADNet1_InetReceiveStart (ByVal iComputer As Integer, ByVal iSize As Long)
' Display amount expected
Text1.Text = "Will receive: " + CStr(iSize) + " bytes."
End Sub


InetReceiving Example for Visual Basic

Private Sub LEADNet1_InetReceiving (ByVal iComputer As Integer, ByVal lSize As Long)
' display data size as we get it
Text1.Text = "Computer: " + CStr(iComputer) + " received " + CStr(iSize)
End Sub


InetSendAttachBitmapCmd Example for Visual Basic

Dim nRet As Integer

nRet = LEADNet1.InetSendAttachBitmapCmd(999, 1, 1)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendAttachBitmapCmd."
Else
MsgBox "InetSendAttachBitmapCmd Executed."
End If


InetSendBitmap Example for Visual Basic

Private Sub Command2_Click()
' send bitmap to everybody in SendList property
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess

If (LEADRasterView1.Raster.Bitmap = 0) Then
RasterIO.Load LEADRasterView1.Raster, "o:\images\new\001.jpg", 0, 1, 1
End If
RasterProc.Flip LEADRasterView1.Raster
'send the images to the remote computer
LEADNet1.InetSendBitmap LEADRasterView1.Raster, FILE_CMP, 24, 75
End Sub


InetSendCloseWinCmd Example for Visual Basic

Dim nRet As Integer

nRet = LEADNet1.InetSendCloseWinCmd(999, 1)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendCloseWinCmd."
Else
MsgBox "InetSendCloseWinCmd Executed."
End If


InetSendCloseWinRsp Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_CLOSE_WIN
' check the validity of the parameters
If ((Params.ParamCount = 1) And (Params.ParamType(0) = PARAM_TYPE_UINT32)) Then
'Note this is a function you must create
nStatus = ProcessCloseWinCommand(Params.ParamValue(0).DoubleValue)
nRet = LEADNet1.InetSendCloseWinRsp(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendCloseWinRsp2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_CLOSE_WIN
' check the validity of the parameters
If ((Params.ParamCount = 1) And (Params.ParamType(0) = PARAM_TYPE_UINT32)) Then
'Note this is a function you must create
nStatus = ProcessCloseWinCommand(Params.ParamValue(0))
nRet = LEADNet1.InetSendCloseWinRsp2 (nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendCmd Example for Visual Basic

' my user defined commands
Private Const INETCMD_FLIP = INETCMD_USER_CUSTOM

Dim nRet As Integer
Dim Params As New LEADRasterInetPacket
Dim ExtraData As New LEADRasterVariant
Dim lSize As Long
Dim RasterVar As New LEADRasterVariant

RasterVar.Type = VALUE_ULONG
RasterVar.DoubleValue = 1
Params.ParamCount = 1
Params.ParamValue(0) = RasterVar
Params.ParamType(0) = PARAM_TYPE_UINT32

ExtraData.Type = VALUE_STRING
ExtraData.StringValue = "This is Flip"
lSize = Len(ExtraData)

nRet = LEADNet1.InetSendCmd(INETCMD_FLIP,
 999, Params, lSize, ExtraData)


InetSendCmd2 Example for Visual Basic

' my user defined commands
Private Const INETCMD_FLIP = INETCMD_USER_CUSTOM

Dim nRet As Integer
Dim Params As New LEADRasterInetPacket
Dim ExtraData As String
Dim lSize As Long

Params.ParamCount = 1
Params.ParamValue(0) = 1
Params.ParamType(0) = PARAM_TYPE_UINT32

ExtraData = "This is Flip"
lSize = Len(ExtraData)

nRet = LEADNet1.InetSendCmd2(INETCMD_FLIP, 999, Params, lSize, ExtraData)


InetSendCreateWinCmd Example for Visual Basic

Dim nRet As Integer

nRet = LEADNet1.InetSendCreateWinCmd(999, "Window", "Window999", 0, 0, 0, 100, 100, 0)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendAttachBitmapCmd."
Else
MsgBox "InetSendCreateWinCmd Executed."
End If


InetSendData Example for Visual Basic

Private Sub Command2_Click()
Dim s As String
Dim l As Integer
Dim RasterVar As New LEADRasterVariant
RasterVar.Type = VALUE_STRING

s = "This is a test"
l = Len(s)
RasterVar.StringValue = s
LEADNet1.InetSendData
 RasterVar, l, INETDATA_USER1
End Sub


InetSendData2 Example for Visual Basic

Private Sub Command2_Click()
Dim s As String
Dim l As Integer

LEADNet1.EnableUseLEADRasterVariant
 = False
s = "This is a test"
l = Len(s)
LEADNet1.InetSendData2
 "This is a test", l, INETDATA_USER1
End Sub


InetSendDIB Example for Visual Basic

Private Sub Lead1_Click()
Dim RasterIO As New LEADRasterIO
Dim RasterProc As New LEADRasterProcess
Dim hDIB As Long

If (LEADRasterView1.Raster.Bitmap = 0) Then
RasterIO.Load LEADRasterView1.Raster, "o:\images\new\001.jpg", 0, 1, 1
End If
RasterProc.Flip LEADRasterView1.Raster
'send the images to the remote computer
hDIB = LEADRasterView1.Raster.GetDIB
LEADNet1.InetSendDIB hDIB, FILE_CMP, 24, 75
GlobalFree hDIB
End Sub


InetSendFreeBitmapCmd Example for Visual Basic

Dim nRet As Integer
nRet = LEADNet1.InetSendFreeBitmapCmd(999, 1)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendFreeBitmapCmd."
Else
MsgBox "InetSendFreeBitmapCmd Executed."
End If


InetSendFreeBitmapRsp Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_FREE_BITMAP
' check the validity of the parameters
If ((Params.ParamCount = 1) And (Params.ParamType(0) = PARAM_TYPE_UINT32)) Then
'Note this is a function you must create
nStatus = ProcessFreeBitmapCommand(Params.ParamValue(0).DoubleValue)
nRet = LEADNet1.InetSendFreeBitmapRsp(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendFreeBitmapRsp2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant) Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_FREE_BITMAP
' check the validity of the parameters
If ((Params.ParamCount = 1) And (Params.ParamType(0) = PARAM_TYPE_UINT32)) Then
'Note this is a function you must create
nStatus = ProcessFreeBitmapCommand(Params.ParamValue(0))
nRet = LEADNet1.InetSendFreeBitmapRsp2(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendGetMagGlassDataCmd Example for Visual Basic

Public gnCommandID As Long
.
.
.

' … Assume that the following function will be called from inside the MagGlassExt event that
' belongs to LEAD RasterView control
Public Function GetMagGlassData(nBitmapID As Long, vMaskPlane As LEADRasterVariant, nMaskPlaneStart As Integer, nMaskPlaneEnd As Integer)

Dim nRet As Integer

gnCommandID = gnCommandID + 1

nRet = LEADNet1.InetSendGetMagGlassDataCmd(gnCommandID, nBitmapID, vMaskPlane, nMaskPlaneStart, nMaskPlaneEnd)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendGetMagGlassDataCmd."
Else
MsgBox "InetSendGetMagGlassDataCmd Executed."
End If

End Function


InetSendGetMagGlassDataCmd2 Example for Visual Basic

Public gnCommandID As Long

'… Assume that the following function will be called from inside the MagGlassExt event that
' belongs to LEAD RasterView control
Public Function GetMagGlassData(nBitmapID As Long, vMaskPlane As Variant, nMaskPlaneStart As Integer, nMaskPlaneEnd As Integer)

Dim nRet As Integer

gnCommandID = gnCommandID + 1

nRet = LEADNet1.InetSendGetMagGlassDataCmd2(gnCommandID, nBitmapID, CVar(vMaskPlane), nMaskPlaneStart, nMaskPlaneEnd)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendGetMagGlassDataCmd2."
Else
MsgBox "InetSendGetMagGlassDataCmd2 Executed."
End If

End Function


InetSendGetMagGlassDataRsp Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nRet As Integer
Dim nStatus As Integer
Dim nBitmapIndex As Long
Dim vColorBuffer As LEADRasterVariant

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_GET_MAGGLASS_DATA
' check the validity of the parameters
If ((Params.ParamCount = 5) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_UINT32) And (Params.ParamType(2) = PARAM_TYPE_USTRING) _
And (Params.ParamType(3) = PARAM_TYPE_INT32) And (Params.ParamType(4) = PARAM_TYPE_INT32)) Then
nBitmapIndex = Params.ParamValue(0).DoubleValue
'Note: Assume that gBitmaps is array that holds all bitmaps that clients loaded on server
nStatus = LEADNet1.InetGetMagGlassData(gBitmaps(nBitmapIndex).Raster, vColorBuffer, Params.ParamValue(2).StringValue, Params.ParamValue(3).LongValue, Params.ParamValue(4).LongValue)
LEADNet1.InetSendGetMagGlassDataRsp nCommandID, vColorBuffer.StringValue, Params.ParamValue(2).StringValue, Params.ParamValue(3).LongValue, Params.ParamValue(4).LongValue, 0, Null, nStatus
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendGetMagGlassDataRsp2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer
Dim nStatus As Integer
Dim nBitmapIndex As Long
Dim vColorBuffer As Variant

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_GET_MAGGLASS_DATA
' check the validity of the parameters
If ((Params.ParamCount = 5) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_UINT32) And (Params.ParamType(2) = PARAM_TYPE_USTRING) _
And (Params.ParamType(3) = PARAM_TYPE_INT32) And (Params.ParamType(4) = PARAM_TYPE_INT32)) Then
nBitmapIndex = CLng(Params.ParamValue(0))
'Note: Assume that gBitmaps is array that holds all bitmaps that clients loaded on server
nStatus = LEADNet1.InetGetMagGlassData2(gBitmaps(nBitmapIndex).Raster, vColorBuffer, CVar(Params.ParamValue(2)), Params.ParamValue(3), Params.ParamValue(4))
LEADNet1.InetSendGetMagGlassDataRsp2 nCommandID, CVar(vColorBuffer), CVar(Params.ParamValue(2)), Params.ParamValue(3), Params.ParamValue(4), 0, Null, nStatus
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSending Example for Visual Basic

Private Sub LEADNet1_InetSending (ByVal iComputer As Integer, ByVal lSize As Long)
' display the about of data we are sending
MsgBox "Sending: " + CStr(lSize) + " bytes"
End Sub


InetSendLoadCmd Example for Visual Basic

Dim nRet As Integer

nRet = LEADNet1.InetSendLoadCmd(999, "v:\images\eagle.cmp", 0, 1)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendLoadCmd."
Else
MsgBox "InetSendLoadCmd Executed."
End If


InetSendLoadRsp Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nRet As Integer
Dim nStatus As Integer
Dim szOut$
Dim i As Integer
Dim pszData As String

nStatus = ERROR_FEATURE_NOT_SUPPORTED

szOut$ = "Command " & CStr(InetCommand) & " id=" & CStr(nCommandID) & ", nError=" & CStr(nError) & " nParams=" & CStr(Params.ParamCount) & " received"
If (nExtraDataSize > 0) Then
szOut$ = szOut$ & ", nExtraDataSize=" & CStr(nExtraDataSize)
End If
Debug.Print (szOut$)
If (nExtraDataSize > 0) Then
' convert to a string
For i = 0 To nExtraDataSize - 1
pszData = pszData + Chr(ExtraData(i))
Next
Debug.Print "ExtraData: " & pszData
End If

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_LOAD
' check the validity of the parameters
If ((Params.ParamCount = 4) And (Params.ParamType(0) = PARAM_TYPE_STRING) And (Params.ParamType(1) = PARAM_TYPE_INT32) And (Params.ParamType(2) = PARAM_TYPE_INT32) And (Params.ParamType(3) = PARAM_TYPE_UINT32)) Then
'Note, this is a function you must create
nStatus = ProcessLoadCommand(Params.ParamValue(0).StringValue)
Debug.Print "Received LoadBitmapCmd - Loaded Bitmap " & Params.ParamValue(0).StringValue
LEADNet1.InetSendLoadRsp nCommandID, gnBitmapID, 0, Null, nStatus
Exit Sub
End If

Case INETCMD_CREATE_WIN
' check the validity of the parameters
If ((Params.ParamCount = 8) And (Params.ParamType(0) = PARAM_TYPE_STRING) And (Params.ParamType(1) = PARAM_TYPE_STRING) _
And (Params.ParamType(2) = PARAM_TYPE_UINT32) And (Params.ParamType(3) = PARAM_TYPE_INT32) And (Params.ParamType(4) = PARAM_TYPE_INT32) _
And (Params.ParamType(5) = PARAM_TYPE_INT32) And (Params.ParamType(6) = PARAM_TYPE_INT32) And (Params.ParamType(7) = PARAM_TYPE_UINT32)) Then
'Note, this is a function you must create
nRet = ProcessCreateWinCommand(Params.ParamValue(1).StringValue, _
Params.ParamValue(3).LongValue, _
Params.ParamValue(4).LongValue, _
Params.ParamValue(5).LongValue, _
Params.ParamValue(6).LongValue, True)
nRet = LEADNet1.InetSendCreateWinRsp(nCommandID, nRet, 0, Null, 0)
Exit Sub
End If
Case INETCMD_ATTACH_BITMAP:
If ((Params.ParamCount = 2) And (Params.ParamType(0) = PARAM_TYPE_UINT32) And (Params.ParamType(1) = PARAM_TYPE_UINT32)) Then
'Note, this is a function you must create
nStatus = ProcessAttachBitmapCommand(Params.ParamValue(0).DoubleValue)
Else
nStatus = ERROR_INV_PARAMETER
End If
LEADNet1.InetSendAttachBitmapRsp nCommandID, 0, Null, nStatus
Exit Sub
Case INETCMD_SAVE
If ((Params.ParamCount = 6) And (Params.ParamType(0) = PARAM_TYPE_STRING) And (Params.ParamType(1) = PARAM_TYPE_UINT32) _
And (Params.ParamType(2) = PARAM_TYPE_INT32) And (Params.ParamType(3) = PARAM_TYPE_INT32) _
And (Params.ParamType(4) = PARAM_TYPE_INT32) And (Params.ParamType(5) = PARAM_TYPE_UINT32)) Then
'Note, this is a function you must create
nStatus = ProcessSaveCommand(Params.ParamValue(0).StringValue, Params.ParamValue(2).LongValue, Params.ParamValue(3).LongValue, Params.ParamValue(4).LongValue)
LEADNet1.InetSendSaveRsp nCommandID, 0, Null, nStatus
Exit Sub
Else
nStatus = ERROR_INV_PARAMETER
End If
End Select
End If
'return an error response
LEADNet1.InetSendRspInetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendLoadRsp2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer
Dim nStatus As Integer
Dim szOut$
Dim i As Integer
Dim pszData As String

nStatus = ERROR_FEATURE_NOT_SUPPORTED

szOut$ = "Command " & CStr(InetCommand) & " id=" & CStr(nCommandID) & ", nError=" & CStr(nError) & " nParams=" & CStr(Params.ParamCount) & " received"
If (nExtraDataSize > 0) Then
szOut$ = szOut$ & ", nExtraDataSize=" & CStr(nExtraDataSize)
End If
Debug.Print (szOut$)
If (nExtraDataSize > 0) Then
' convert to a string
For i = 0 To nExtraDataSize - 1
pszData = pszData + Chr(ExtraData(i))
Next
Debug.Print "ExtraData: " & pszData
End If

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_LOAD
' check the validity of the parameters
If ((Params.ParamCount = 4) And (Params.ParamType(0) = PARAM_TYPE_STRING) And (Params.ParamType(1) = PARAM_TYPE_INT32) And (Params.ParamType(2) = PARAM_TYPE_INT32) And (Params.ParamType(3) = PARAM_TYPE_UINT32)) Then
'Note, this is a function you must create
nStatus = ProcessLoadCommand(Params.ParamValue(0))
Debug.Print "Received LoadBitmapCmd - Loaded Bitmap " & Params.ParamValue(0)
LEADNet1.InetSendLoadRsp2 nCommandID, gnBitmapID, 0, Null, nStatus
Exit Sub
End If

Case INETCMD_CREATE_WIN
' check the validity of the parameters
If ((Params.ParamCount = 8) And (Params.ParamType(0) = PARAM_TYPE_STRING) And (Params.ParamType(1) = PARAM_TYPE_STRING) _
And (Params.ParamType(2) = PARAM_TYPE_UINT32) And (Params.ParamType(3) = PARAM_TYPE_INT32) And (Params.ParamType(4) = PARAM_TYPE_INT32) _
And (Params.ParamType(5) = PARAM_TYPE_INT32) And (Params.ParamType(6) = PARAM_TYPE_INT32) And (Params.ParamType(7) = PARAM_TYPE_UINT32)) Then
'Note, this is a function you must create
nRet = ProcessCreateWinCommand(Params.ParamValue(1), _
Params.ParamValue(3), _
Params.ParamValue(4), _
Params.ParamValue(5), _
Params.ParamValue(6), True)
nRet = LEADNet1.InetSendCreateWinRsp2(nCommandID, nRet, 0, Null, 0)
Exit Sub
End If
Case INETCMD_ATTACH_BITMAP:
If ((Params.ParamCount = 2) And (Params.ParamType(0) = PARAM_TYPE_UINT32) And (Params.ParamType(1) = PARAM_TYPE_UINT32)) Then
'Note, this is a function you must create
nStatus = ProcessAttachBitmapCommand(CLng(Params.ParamValue(0)))
Else
nStatus = ERROR_INV_PARAMETER
End If
LEADNet1.InetSendAttachBitmapRsp2 nCommandID, 0, Null, nStatus
Exit Sub
Case INETCMD_SAVE
If ((Params.ParamCount = 6) And (Params.ParamType(0) = PARAM_TYPE_STRING) And (Params.ParamType(1) = PARAM_TYPE_UINT32) _
And (Params.ParamType(2) = PARAM_TYPE_INT32) And (Params.ParamType(3) = PARAM_TYPE_INT32) _
And (Params.ParamType(4) = PARAM_TYPE_INT32) And (Params.ParamType(5) = PARAM_TYPE_UINT32)) Then
'Note, this is a function you must create
nStatus = ProcessSaveCommand(Params.ParamValue(0), Params.ParamValue(2), Params.ParamValue(3), Params.ParamValue(4))
LEADNet1.InetSendSaveRsp2 nCommandID, 0, Null, nStatus
Exit Sub
Else
nStatus = ERROR_INV_PARAMETER
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendSaveCmd Example for Visual Basic

Dim nRet As Integer

nRet = LEADNet1.InetSendSaveCmd(999, 1, "d:\temp\remote.tif", FILE_TIF, 0, 0, True)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendSaveCmd."
Else
MsgBox "InetSendSaveCmd Executed."
End If


InetSendSetRectCmd Example for Visual Basic

Dim nRet As Integer
Dim SW_SHOW As Integer
SW_SHOW = 0
nRet = LEADNet1.InetSendSetRectCmd(999, 1, DISPLAY_RECT_DST, 0, 0, 100, 100)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendSetRectCmd."
Else
MsgBox "InetSendSetRectCmd Executed."
End If


InetSendSetRectRsp Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_SET_RECT
' check the validity of the parameters
If ((Params.ParamCount = 6) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_INT32) _
And (Params.ParamType(2) = PARAM_TYPE_INT32) _
And (Params.ParamType(3) = PARAM_TYPE_INT32) _
And (Params.ParamType(4) = PARAM_TYPE_INT32) _
And (Params.ParamType(5) = PARAM_TYPE_INT32)) Then
'Note this is a function you must create
nStatus = ProcessSetRectCommand(Params.ParamValue(0), _
Params.ParamValue(1).LongValue, _
Params.ParamValue(2).LongValue, _
Params.ParamValue(3).LongValue, _
Params.ParamValue(4).LongValue, _
Params.ParamValue(5).LongValue)
nRet = LEADNet1.InetSendSetRectRsp(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendSetRectRsp2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_SET_RECT
' check the validity of the parameters
If ((Params.ParamCount = 6) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_INT32) _
And (Params.ParamType(2) = PARAM_TYPE_INT32) _
And (Params.ParamType(3) = PARAM_TYPE_INT32) _
And (Params.ParamType(4) = PARAM_TYPE_INT32) _
And (Params.ParamType(5) = PARAM_TYPE_INT32)) Then
'Note this is a function you must create
nStatus = ProcessSetRectCommand(Params.ParamValue(0), _
Params.ParamValue(1), _
Params.ParamValue(2), _
Params.ParamValue(3), _
Params.ParamValue(4), _
Params.ParamValue(5))
nRet = LEADNet1.InetSendSetRectRsp2(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendShowWinCmd Example for Visual Basic

Dim nRet As Integer
Dim SW_SHOW As Integer
SW_SHOW = 0
nRet = LEADNet1.InetSendShowWinCmd(999, 1, SW_SHOW)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendShowWinCmd."
Else
MsgBox "InetSendShowWinCmd Executed."
End If


InetSendShowWinRsp Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_SHOW_WIN
' check the validity of the parameters
If ((Params.ParamCount = 2) And (Params.ParamType(0) = PARAM_TYPE_UINT32) And (Params.ParamType(1) = PARAM_TYPE_INT32)) Then
'Note this is a function you must create
nStatus = ProcessShowWinCommand(Params.ParamValue(0).DoubleValue, Params.ParamValue(1).LongValue)
nRet = LEADNet1.InetSendShowWinRsp(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendShowWinRsp2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_SHOW_WIN
' check the validity of the parameters
If ((Params.ParamCount = 2) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_INT32)) Then
'Note this is a function you must create
nStatus = ProcessShowWinCommand(Params.ParamValue(0), Params.ParamValue(1))
nRet = LEADNet1.InetSendShowWinRsp2(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendSizeWinCmd Example for Visual Basic

Dim nRet As Integer

nRet = LEADNet1.InetSendSizeWinCmd(999, 1, 0, 0, 100, 100)
If ((nRet <> 0) And (nRet <> ERROR_DATA_QUEUED)) Then
MsgBox "ERROR " & CStr(nRet) & " calling InetSendSizeWinCmd."
Else
MsgBox "InetSendSizeWinCmd Executed."
End If


InetSendSizeWinRsp Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As LEADRasterVariant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_SIZE_WIN
' check the validity of the parameters
If ((Params.ParamCount = 5) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_INT32) And (Params.ParamType(2) = PARAM_TYPE_INT32) _
And (Params.ParamType(3) = PARAM_TYPE_INT32) And (Params.ParamType(4) = PARAM_TYPE_INT32)) Then
'Note this is a function you must create
nStatus = ProcessSizeWinCommand(Params.ParamValue(0).DoubleValue, Params.ParamValue(1).LongValue, Params.ParamValue(2).LongValue, Params.ParamValue(3).LongValue, Params.ParamValue(4).LongValue)
nRet = LEADNet1.InetSendSizeWinRsp(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendSizeWinRsp2 Example for Visual Basic

Private Sub LEADNet1_InetReceiveCmd2(ByVal iComputer As Integer, ByVal InetCommand As Integer, ByVal nCommandID As Long, ByVal nError As Integer, ByVal Params As LEADRasterInetLib.ILEADRasterInetPacket, ByVal nExtraDataSize As Long, ByVal ExtraData As Variant)
Dim nRet As Integer
Dim nStatus As Integer

If (nError <> 0) Then
nStatus = ERROR_TRANSFER_ABORTED
Else
Select Case InetCommand
Case INETCMD_SIZE_WIN
' check the validity of the parameters
If ((Params.ParamCount = 5) And (Params.ParamType(0) = PARAM_TYPE_UINT32) _
And (Params.ParamType(1) = PARAM_TYPE_INT32) And (Params.ParamType(2) = PARAM_TYPE_INT32) _
And (Params.ParamType(3) = PARAM_TYPE_INT32) And (Params.ParamType(4) = PARAM_TYPE_INT32)) Then
'Note this is a function you must create
nStatus = ProcessSizeWinCommand(Params.ParamValue(0), Params.ParamValue(1), Params.ParamValue(2), Params.ParamValue(3), Params.ParamValue(4))
nRet = LEADNet1.InetSendSizeWinRsp2(nCommandID, 0, Null, nStatus)
Exit Sub
End If
End Select
End If
'return an error response
LEADNet1.InetSendRsp2 InetCommand, nCommandID, Nothing, 0, Null, nStatus
End Sub


InetSendSound Example for Visual Basic

' This example uses LEAD Capture control to capture audio from the microphone and send it to
' a remote computer. For an example of starting and stopping recording, refer to the LEAD Capture
' control documentation.

Private Sub StartRecord_Click()
' the capture doesn't have to be connected to use the following functions
LEADCap1.CapAudioFormat(CAP_AUDIO_RECORD) = FILE_WAV_1M08
' open recording device
LEADCap1.CapOpenRecord 0, 2, LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD)
LEADCap1.CapStartRecord
End Sub

Private Sub LEADCap1_CapAudioData(ByVal pData As Variant, ByVal lBytesRecorded As Long, ByVal iIndex As Integer)
' send sound to remote computer (items in SendList property)
' you should be connected to a remote computer first by using the
' InetConnect method of the Internet COM
Dim RasterVar1 As LEADRasterVariant
Dim RasterVar2 As LEADRasterVariant
Dim pExtraData As Variant
Dim size As Integer, i As Integer

vExtraData = LEADCap1.CapWaveExtraData(CAP_AUDIO_RECORD)

If VarType(vExtraData) = vbArray Or vbByte Then
RasterVar1.Type = VALUE_ARRAY_BYTE
size = UBound(vExtraData) - LBound(vExtraData) + 1
Dim LArray(size) As Byte
LArray = vExtraData
RasterVar1.ItemCount = size
For i = 0 To i < size - 1 Step 1
RasterVar1.ShortItemValue(i) = Array(i)
Next i

ElseIf VarType(vExtraData) = vbString Then
RasterVar1.Type = VALUE_STRING
RasterVar1.StringValue = vExtraData

Else
Exit Sub
End If

If VarType(pData) = vbArray Or vbByte Then
RasterVar2.Type = VALUE_ARRAY_BYTE
size = UBound(pData) - LBound(pData) + 1
Dim LArray(size) As Byte
LArray = pData
RasterVar2.ItemCount = size
For i = 0 To i < size - 1 Step 1
RasterVar2.ShortItemValue(i) = Array(i)
Next i

ElseIf VarType(pData) = vbString Then
RasterVar2.Type = VALUE_STRING
RasterVar2.StringValue = pData

Else
Exit Sub
End If

LEADClient.InetSendSound LEADCap1.CapWaveFormatTag(CAP_AUDIO_RECORD), LEADCap1.CapWaveChannels(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveSamplesPerSec(CAP_AUDIO_RECORD), LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveBlockAlign(CAP_AUDIO_RECORD), LEADCap1.CapWaveBitsPerSample(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveExtraSize(CAP_AUDIO_RECORD), RasterVar1, RasterVar2, lBytesRecorded
DoEvents

End Sub


InetSendSound2 Example for Visual Basic

' This example uses LEAD Capture control to capture audio from the microphone and send it to
' a remote computer. For an example of starting and stopping recording, refer to the LEAD Capture
' control documentation.

Private Sub StartRecord_Click()
' the capture doesn't have to be connected to use the following functions
LEADCap1.CapAudioFormat(CAP_AUDIO_RECORD) = FILE_WAV_1M08
' open recording device
LEADCap1.CapOpenRecord 0, 2, LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD)
LEADCap1.CapStartRecord
End Sub

Private Sub LEADCap1_CapAudioData(ByVal pData As Variant, ByVal lBytesRecorded As Long, ByVal iIndex As Integer)
' send sound to remote computer (items in SendList property)
' you should be connected to a remote computer first by using the
' InetConnect method of the Internet COM
LEADClient.InetSendSound2 LEADCap1.CapWaveFormatTag(CAP_AUDIO_RECORD), LEADCap1.CapWaveChannels(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveSamplesPerSec(CAP_AUDIO_RECORD), LEADCap1.CapWaveAvgBytesPerSec(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveBlockAlign(CAP_AUDIO_RECORD), LEADCap1.CapWaveBitsPerSample(CAP_AUDIO_RECORD), _
LEADCap1.CapWaveExtraSize(CAP_AUDIO_RECORD), LEADCap1.CapWaveExtraData(CAP_AUDIO_RECORD), pData, lBytesRecorded
DoEvents
End Sub


InetServerClose Example for Visual Basic

Private Sub Form_Unload(Cancel As Integer)
' shutdown server on exit
LEADNet1.InetServerClose hServer
End Sub


InetServerInit Example for Visual Basic

Private Sub Form_Load()
' initialize port 1000 to wait for connections
LEADNet1.InetServerInit 1000
hServer = LEADNet1.InetServerHandle
End Sub


Tutorial for Visual C++ 5.0 Programmers

The following topics provide brief and simple examples to help you learn how to use the LEADTOOLS ILEADRasterInet object.

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

Note:

These tutorial examples are intended to be easy to understand and easy to test. The example programs in the EXAMPLES subdirectory provide more in depth design and more detailed code.

Initializing a Computer as a Server and Accepting Connections

Connecting to a Remote Computer

Sending Images to a Remote Computer

Receiving and Displaying Images from a Remote Computer

Miscellaneous Examples


Initializing a Computer as a Server and Accepting Connections (Visual C++ 5.0 and later)

Take the following steps to start a project and to add some code that will let you initialize a computer as a server and accept connections.

1. | Start a new project as follows:
 | For C++ 5.0, run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify server.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
2. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
3. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D controls is selected.
 | c. | Select OLE controls (ActiveX controls in 5.0).
 | d. | Click the Next button.
4. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select As a shared DLL.
 | c. | Click the Next button.
5. | In the Step 4 of 4 dialog box, just click Finish.
6. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
7. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the server files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "d:\\winnt\\system32\\ltrvr14n.dll"
 no_namespace, named_guids
#import "d:\\winnt\\system32\\ltr14n.dll" no_namespace, named_guids
#import "d:\\winnt\\system32\\ltrvw14n.ocx" no_namespace, named_guids
#import "d:\\winnt\\system32\\ltrio14n.dll" no_namespace, named_guids
#import "d:\\winnt\\system32\\ltrpr14n.dll" no_namespace, named_guids
#import "d:\\winnt\\system32\\ltrnt14n.dll" no_namespace, named_guids

8. | Add a command button to the main window and set the ID and Caption properties as follows:
 | ID | Caption
 | IDC_SERVERINIT | Init Server
9. | Edit the serverDlg.H file and change the definition of CServerDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:
short m_hServer;
ILEADRasterInet *m_pRasterInet;
CRasterInetSink *m_pRasterInetSink;
IConnectionPoint *m_pInetCP;
DWORD m_dwInetCookie;

10.

Add the following code to the OnInitDialog procedure in the ServerDlg.cpp, following the line "TODO: Add extra initialization here":

//Create the RasterInet object
CoCreateInstance(CLSID_LEADRasterInet, NULL, CLSCTX_ALL,
IID_ILEADRasterInet, (void**)&m_pRasterInet);
m_pRasterInet->EnableMethodErrors
 = FALSE;

//create a temp LEADRaster object and use it
IClassFactory2 *pCF2=NULL;
CLSID clsid;
ILEADRaster *pRaster=NULL;
static const WCHAR BASED_CODE _szID[] = L"LEADRaster.LEADRaster";

CLSIDFromProgID(_szID, &clsid);

CoGetClassObject(clsid, CLSCTX_ALL, NULL, IID_IClassFactory2, (void**)&pCF2);
//This object is licensed, so we need to pass a license key
static const WCHAR BASED_CODE _szLic[] = L"LEADTOOLS OCX Copyright
 (c) 1991-2004 LEAD Technologies, Inc.";
BSTR lpLic = SysAllocString(_szLic);
pCF2->CreateInstanceLic(NULL, NULL, IID_IUnknown, lpLic, (void**)&pRaster);
SysFreeString(lpLic);
pCF2->Release();
pRaster->Release();

11.

Edit the ServerDlg.CPP file and add the following code to the end of the OnInitDialog function (before the return!):

//Instantiate the sink class
 and hold a pointer to it.
m_pRasterInetSink = new CRasterInetSink;
m_pRasterInetSink->m_pDlg = this;

//Establish a connection between source and sink.
LPUNKNOWN pInetUnkSink = m_pRasterInetSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterInet, DIID__LTRASINETEvents, pInetUnkSink,
 FALSE, &m_dwInetCookie);

12. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterInetSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterInetSink.h file, move the destructor so that it is public:

// Implementation
virtual ~CRasterInetSink();
protected:

h. | In the RasterInetSink.h file, add the following to the top of the file:
 | class CServerDlg;
i. | In the RasterInetSink.h file, add the following to the CRasterInetSink class in the //Attributes public section:

// Attributes
public:
CServerDlg *m_pDlg;

j.

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

#include "ServerDlg.h"

13. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the server files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:

#include <AFXCTL.H>
#include "RasterInetSink.h"

14. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the server files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterInetSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG: afx_msg void OnInetAccept(short);
 |  | afx_msg void OnInetAccept(short);
15. | Edit the source for the Sink class:

a. | In the Project Workspace, click the FileView tab.
b. | Double-click the server files folder to open it.
c. | Double-click the Source Files folder.
d. | Double-click the RasterInetSink.cpp file to edit it.
e. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterInetSink,"InetAccept",5,OnInetAccept,VT_EMPTY,VTS_I2)

f.

Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART tothe following:

INTERFACE_PART(CRasterInetSink, DIID__LTRASINETEvents, Dispatch)

g.

Add the following to the end of the file:

void CRasterInetSink::OnInetAccept(short iServer)
{
short hComputer;
short nRet;
L_TCHAR szHostName[80];
BSTR bstrText;
CString strText;
CString cs;

nRet = m_pDlg->m_pRasterInet->InetAcceptConnect(m_pDlg->m_hServer);
hComputer = m_pDlg->m_pRasterInet->InetConnectedComputer();
if(nRet != 0)
{
AfxMessageBox(TEXT("Error accepting
 connection!"));
return;
}

m_pDlg->m_pRasterInet->InetGetHostName(hComputer,
 HOST_NAME_DESCRP);
bstrText = m_pDlg->m_pRasterInet->GetInetHostName();
//add to our list
m_pDlg->m_pRasterInet->put_SendList(m_pDlg->m_pRasterInet->SendListNum, hComputer);
strText = bstrText;
lstrcpy(szHostName, (LPCTSTR)strText);
::SysFreeString(bstrText);
cs.Format(TEXT("Connection accepted from:%s"),
 strText);
AfxMessageBox(cs);
}

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

//Terminate a connection between
 source and sink.
LPUNKNOWN pInetUnkSink = m_pRasterInetSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterInet, DIID__LTRASINETEvents,
pInetUnkSink, FALSE, m_dwInetCookie);
delete m_pRasterInetSink;
m_pRasterInet->Release();
CDialog::OnDestroy();

18. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CServerDlg.
 | c. | In the Object IDs list box, select IDC_SERVERINIT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnServerInit).
 | f. | Click the Edit Code button and code the OnServerInit procedure as follows:

int nRet;
CString cs;
m_pRasterInet->EnableMethodErrors = FALSE;
/* initialize server on port 1000 */
nRet = m_pRasterInet->InetServerInit(1000);
iServer = m_pRasterInet->GetInetServerHandle();

if(nRet != 0)
{
cs.Format(TEXT("%s %d\n"),TEXT("Error
 initializing server:"), nRet);
AfxMessageBox(cs);
}

19. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CServerDlg.
 | c. | In the Object IDs list box, select IDCANCEL.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnCancel).
 | f. | Click the Edit Code button and code the OnCancel procedure as follows:

int i, num;
/* disconnect all connections */
num = m_pRasterInet->GetConnectListNum();
for(i = 0; i < num; i++)
{
m_pRasterInet->InetDisconnect(m_pRasterInet->GetConnectList(i));
}
CDialog::OnCancel();

20.

Edit the Server.CPP file and add the following code as the first line in the InitInstance function:

CoInitialize(NULL);

21.

Edit the Server.CPP file and add the following code as the next to last line in the InitInstance function (before the return)!:

CoUninitialize();

22. | On the main menu, select Build> Build server.exe to build the project.
23. | On the main menu, select Build> Execute server.exe to run the project.


Connecting to a Remote Computer (Visual C++ 5.0 and later)

Take the following steps to start a project and to add some code that will let you connect to a remote computer that is acting as a server.

1. | Run the server executable you created in Initializing a Computer as a Server and Accepting Connections.
2. | Start a new project as follows:
 | For C++ 5.0, run Microsoft Visual C++ 5.0, select the File >New menu option, and do the following:
 | a. | Click the Projects tab.
 | b. | Select MFC AppWizard (exe) as the project type
 | c. | In the Project name text box, specify remote.
 | d. | In the Location text box, specify the path of the project.
 | e. | Click the OK button.
3. | In the Step 1 dialog box, do the following:
 | a. | Select Dialog based.
 | b. | Click the Next button.
4. | In the Step 2 of 4 dialog box, do the following:
 | a. | Ensure that About Box is selected.
 | b. | Ensure that 3D controls is selected.
 | c. | Select OLE controls (ActiveX controls in 5.0).
 | d. | Click the Next button.
5. | In the Step 3 of 4 dialog box, do the following:
 | a. | For comments, ensure that Yes, Please is selected.
 | b. | For how to use the MFC library, select As a shared DLL.
 | c. | Click the Next button.
6. | In the Step 4 of 4 dialog box, just click Finish.
7. | Read New Project Information, and click OK. (The AppWizard creates the project files and opens the project.)
8. | Add the L_OcxErr.H, and Ltnetocx.h files, to your project as follows:
 | a. | Copy the L_ocx40.h, l_ocxerr.h, and Ltnetocx.h files to your project directory, from the \lead\include\ directory.
 | b. | In the Project Workspace, click the FileView tab.
 | c. | Double-click the remote files folder to open it.
 | d. | Double-click the Dependencies folder (the Header Files folder in 5.0) to open it.
 | e. | Double-click the StdAfx.h file to edit it.
 | f. | Add the following lines to the end of the file:

#include "L_OCX40.H"
#include "Ltnetocx.h"

9. | Add #import and #include statements to your program so you can access the LEAD COM constants and classes:
 | a. | Copy the l_ocxerr.h file to your project directory, from the \lead\include\ directory.
 | b. | In the Project Workspace, click the FileView tab.
 | c. | Double-click the remote files folder to open it.
 | d. | Double-click the Header Files folder to open it.
 | e. | Double-click the StdAfx.h file to edit it.
 | f. | Add the following lines to the end of the file (keep in mind, you may have to change the path to where the dll's reside):

#import "d:\\winnt\\system32\\ltrvr14n.dll"
 no_namespace, named_guids
#import "d:\\winnt\\system32\\ltr14n.dll" no_namespace, named_guids
#import "d:\\winnt\\system32\\ltrvw14n.ocx" no_namespace, named_guids
#import "d:\\winnt\\system32\\ltrnt14n.dll" no_namespace, named_guids
#include "L_OCXERR.H"

10. | Add an Edit box control to the main window and give it the following ID:
 | ID
 | IDC_Remote
11. | Add two command buttons to the main window and set the ID and Caption properties as follows:
 | ID |  | Caption
 | IDC_CONNECT |  | Connect To Remote
 | IDC_DISCONNECT |  | Disconnect From Remote
12. | Do the following to add m_Remote to the CRemoteDlg class and link the variable using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CRemoteDlg.
 | d. | In the Control IDs list, select IDC_Remote.
 | e. | Click the Add Variable... button.
 | f. | Specify m_Remote as the variable name, and control as the category.
 | g. | Click OK to close the dialog box, and click OK to close the MFC ClassWizard.
13. |  | Edit the RemoteDlg.H file and change the definition of CRemoteDlg : CDialog by inserting the following lines after DECLARE_MESSAGE_MAP:

public:
ILEADRasterInet *m_pRasterInet;
CRasterInetSink *m_pRasterInetSink;
IConnectionPoint *m_pInetCP;
DWORD m_dwInetCookie;

14.

Add the following code to the OnInitDialog procedure in the RemoteDlg.cpp, following the line "TODO: Add extra initialization here":

//Create the RasterInet object
CoCreateInstance(CLSID_LEADRasterInet, NULL, CLSCTX_ALL,
IID_ILEADRasterInet, (void**)&m_pRasterInet);
m_pRasterInet->EnableMethodErrors = FALSE;

//create a temp LEADRaster object and use it
IClassFactory2 *pCF2=NULL;
CLSID clsid;
ILEADRaster *pRaster=NULL;
static const WCHAR BASED_CODE _szID[] = L"LEADRaster.LEADRaster";

CLSIDFromProgID(_szID, &clsid);

CoGetClassObject(clsid, CLSCTX_ALL, NULL, IID_IClassFactory2, (void**)&pCF2);
//This object is licensed, so we need to pass a license key
static const WCHAR BASED_CODE _szLic[] = L"LEADTOOLS OCX Copyright
 (c) 1991-2004 LEAD Technologies, Inc.";
BSTR lpLic = SysAllocString(_szLic);
pCF2->CreateInstanceLic(NULL, NULL, IID_IUnknown, lpLic, (void**)&pRaster);
SysFreeString(lpLic);
pCF2->Release();
pRaster->Release();

15.

Edit the RemoteDlg.CPP file and add the following code to the end of the OnInitDialog function (before the return!):

//Instantiate the sink class
 and hold a pointer to it.
m_pRasterInetSink = new CRasterInetSink;
m_pRasterInetSink->m_pDlg = this;

//Establish a connection between source and sink.
LPUNKNOWN pInetUnkSink = m_pRasterInetSink->GetIDispatch(FALSE);
AfxConnectionAdvise(m_pRasterInet, DIID__LTRASINETEvents, pInetUnkSink,
 FALSE, &m_dwInetCookie);

16. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Add Class button.
 | b. | Click New....
 | c. | Type CRasterInetSink for the name of the class
 | d. | Select CCmdTarget for the base class of the new class.
 | e. | Under Automation, click the Automation radio button.
 | f. | Click OK to create the class.
 | g. | In the RasterInetSink.h file, move the destructor so that it is public:

// Implementation
virtual ~CRasterInetSink();
protected:

h.

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

class CRemoteDlg;

i.

In the RasterInetSink.h file, add the following to the CRasterInetSink class in the //Attributes public section:

// Attributes
public:
CRemoteDlg *m_pDlg;

j.

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

#include "RemoteDlg.h"

17. | Add #include statements so you can access the new class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the remote files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file:

#include <AFXCTL.H>
#include "RasterInetSink.h"

18. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the remote files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterInetSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG: afx_msg void OnInetConnected(short);afx_msg void OnInetDisconnected(short);
19. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the remote files folder to open it.
 | c. | Double-click the Source Files folder.
 | d. | Double-click the RasterInetSink.cpp file to edit it.
 | e. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterInetSink,"InetConnected",3,OnInetConnected,VT_EMPTY,VTS_I2)
DISP_FUNCTION_ID(CRasterInetSink,"InetDisconnected",4,OnInetDisconnected,VT_EMPTY,VTS_I2)

f.

Inside the BEGIN_INTERFACE_MAP section, change the INTERFACE_PART tothe following:

INTERFACE_PART(CRasterInetSink, DIID__LTRASINETEvents, Dispatch)

g.

Add the following to the end of the file:

void CRasterInetSink::OnInetConnected
 (short iComputer)
{
TCHAR szHostName[80];
BSTR bstrText;
CString strText;
CString cs;

//add this connection to our SendList
m_pDlg->m_pRasterInet->put_SendList(m_pDlg->m_pRasterInet->SendListNum, iComputer);

m_pDlg->m_pRasterInet->InetGetHostName(iComputer,
 HOST_NAME_DESCRP);
bstrText = m_pDlg->m_pRasterInet->GetInetHostName();

strText = bstrText;
lstrcpy(szHostName, (LPCTSTR)strText);
cs.Format(TEXT("Connected to:%s"), strText);
AfxMessageBox(cs);
::SysFreeString(bstrText);
}

void CRasterInetSink::OnInetDisconnected(short
 iComputer)
{
AfxMessageBox(TEXT("Disconnected from remote computer"));
}

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

//Terminate a connection between
 source and sink.
LPUNKNOWN pInetUnkSink = m_pRasterInetSink->GetIDispatch(FALSE);
AfxConnectionUnadvise(m_pRasterInet, DIID__LTRASINETEvents,
pInetUnkSink, FALSE, m_dwInetCookie);
delete m_pRasterInetSink;
m_pRasterInet->Release();
CDialog::OnDestroy();

22. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CRemoteDlg.
 | c. | In the Object IDs list box, select IDC_CONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnConnect).
 | f. | Click the Edit Code button and code the OnConnect procedure as follows:

int nRet;
CString cs,text;

m_pRasterInet->EnableMethodErrors
 = FALSE;
/* get the name of the computer entered in the edit box control */
m_Remote.GetWindowText(text);
/* Connect to remote computer on port 1000 */
BSTR bstrtext = text.AllocSysString();
nRet = m_pRasterInet->InetConnect(bstrtext,
 1000);
SysFreeString(bstrtext);
if (nRet != 0)
{
cs.Format(TEXT(" %s\n %s\n"), TEXT("Error
 connecting to :"), text);
AfxMessageBox(cs);
}

23. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CRemoteDlg.
 | c. | In the Object IDs list box, select IDC_DISCONNECT.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnDisconnect).
 | f. | Click the Edit Code button and code the OnDisconnect procedure as follows:

int nRet;
CString cs;
/* We are assuming only one connection in this example.
Therefore, the handle to the remote computer will be
in the first position in the SendList.
*/
nRet = m_pRasterInet->InetDisconnect(m_pRasterInet->GetSendList(0));
if (nRet != 0)
{
cs.Format(TEXT("%s %d\n"), TEXT("Error
 disconnecting from the server:"),nRet);
AfxMessageBox(cs);
}

24.

Edit the Server.CPP file and add the following code as the first line in the InitInstance function:

CoInitialize(NULL);

25.

Edit the Server.CPP file and add the following code as the next to last line in the InitInstance function (before the return)!:

CoUninitialize();

26. | On the main menu, select Build> Build remote.exe to build the project.
27. | On the main menu, select Build> Execute remote.exe to run the project.
28. | Save the object to use as a starting point for other tasks in the tutorials.


Sending Images to a Remote Computer (Visual C++ 5.0 and later)

Take the following steps to add some code that will let you send images to a remote computer.

1. | Start with the project you created in Initializing a Computer as a Server and Accepting Connections.
2. | Add the LEAD RasterView Control to your main window as follows:
 | For C++ 5.0:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the server resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_SERVER_DIALOG to design the dialog box.
 | e. | From the main menu, select Project > Add To Project > Components and controls.
 | f. | Select Registered ActiveX controls.
 | g. | Double-click the LEAD RasterView Control (14.0) icon. (The Confirm Classes dialog box appears.)
 | h. | Ensure that CLEADRasterView, CLEADRaster and CPicture are checked.
 | i. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView Control appears in the controls toolbar.)
 | j. | Click the LEAD RasterView Control icon; then size and position the control as you want it to appear at run time.
 | k. | Use the right mouse button to edit the properties of the new LEAD RasterView Control.
 | l. | Change the ID to IDC_LEADRASTERVIEW1.
3. | Add some #include statements to your program:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the server files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file, just after the #import statments:

#include "LEADRasterView.h"

#include "LEADRaster.h"

4. | Add a command button to the main window and set the ID and Caption properties as follows:
 | ID |  | Caption
 | IDC_SEND |  | Send Bitmap
5. | Do the following to add m_LEADRasterView1 to the CServerDlg class and link the variable to the LEAD RasterView Control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CServerDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and control as the category.
 | g. | Click OK to close the dialog box and click OK to close the MFC ClassWizard.
6. | Press Ctrl-W to go to the MFC Class Wizard; then do the following:
 | a. | Click the Message Maps tab.
 | b. | In the Class Name combo box, select CServerDlg.
 | c. | In the Object IDs list box, select IDC_SEND.
 | d. | In the Messages list box, select BN_CLICKED.
 | e. | Click the Add function button. Choose OK for the default function name (OnSend).
 | f. | Click the Edit Code button and code the OnSend procedure as follows:

ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;
long hDIB;

if(m_LEADRasterView1.GetRaster().GetBitmap() == 0)
{
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
 IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Load(m_LEADRasterView1.GetRaster(), "o:\\images\\new\\001.jpg",
 0, 1, 1);
pRasterIO->Release();
}

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL, IID_ILEADRasterProcess,
 (void**)&pRasterProc);
pRasterProc->Flip(m_LEADRasterView1.GetRaster());
pRasterProc->Release();

//send the images to the remote computer
hDIB = m_LEADRasterView1.GetRaster().GetDIB();
m_pRasterInet->InetSendDIB(hDIB,
 FILE_CMP, 24, (QFactorConstants)75);
GlobalFree((HGLOBAL)hDIB);

7. | On the main menu, select Build> Build server.exe to build the project.
8. | On the main menu, select Build> Execute server.exe to run the project.
9. | The exe generated from this project will be used as a server for other tasks in the tutorial.


Receiving and Displaying Images from a Remote Computer (Visual C++ 5.0 later)

Receiving and Displaying Images from a Remote Computer (Visual C++ 5.0 and later)

Take the following steps to add some code that will let you receive and display images received from a computer acting as a server.

1. | Run the exe you created in Sending Images to a Remote Computer.
2. | Start Visual C++.
3. | Start with the project you created in Connecting to a Remote Computer.
4. | Add the LEAD RasterView Control to your main window as follows:
 | For C++ 5.0:
 | a. | In the Project Workspace, click the ResourceView tab.
 | b. | Double-click the remote resources folder to open it.
 | c. | Double-click the Dialog folder to open it.
 | d. | Double-click IDD_REMOTE_DIALOG to design the dialog box.
 | e. | From the main menu, select Project > Add To Project > Components and controls.
 | f. | Select Registered ActiveX controls.
 | g. | Double-click the LEAD RasterView Control (14.0) icon. (The Confirm Classes dialog box appears.)
 | h. | Ensure that CLEADRasterView, CLEADRaster and CPicture are checked.
 | i. | Click OK to complete the selection; then click Close to close the Component Gallery. (The LEAD RasterView Control appears in the controls toolbar.)
 | j. | Click the LEAD RasterView Control icon; then size and position the control as you want it to appear at run time.
 | k. | Use the right mouse button to edit the properties of the new LEAD RasterView Control.
 | l. | Change the ID to IDC_LEADRASTERVIEW1.
5. | Add some #include statements to your program:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the remote files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the StdAfx.h file to edit it.
 | e. | Add the following lines to the end of the file, just after the #import statments:

#include "LEADRasterView.h"

#include "LEADRaster.h"

6. | Do the following to add m_LEADRasterView1 to the CServerDlg class and link the variable to the LEAD RasterView Control using dynamic data exchange:
 | a. | Press Ctrl-W. (The MFC ClassWizard dialog box appears.)
 | b. | Click the Member Variables tab.
 | c. | In the Class Name box, select CRemoteDlg.
 | d. | In the Control IDs list, select IDC_LEADRASTERVIEW1.
 | e. | Click the Add Variable... button.
 | f. | Specify m_LEADRasterView1 as the variable name, and control as the category.
 | g. | Click OK to close the dialog box and click OK to close the MFC ClassWizard.
7. | Edit the header for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the remote files folder to open it.
 | c. | Double-click the Header Files folder to open it.
 | d. | Double-click the RasterInetSink.h file to edit it.
 | e. | Add the following just before //}}AFX_MSG:
 |  | afx_msg void OnInetReceiveBitmap(short, long);
8. | Edit the source for the Sink class:
 | a. | In the Project Workspace, click the FileView tab.
 | b. | Double-click the remote files folder to open it.
 | c. | Double-click the Source Files folder.
 | d. | Double-click the RasterInetSink.cpp file to edit it.
 | e. | Add the following to the DISPATCH_MAP:

DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveBitmap",1,OnInetReceiveBitmap,VT_EMPTY,VTS_I2 VTS_I4)

f.

Add the following to the end of the file:

void CRasterInetSink::OnInetReceiveBitmap(short iComputer,
 long hBitmap)
{
//assign bitmap to LEAD RasterView control
m_pDlg->m_LEADRasterView1.GetRaster().SetBitmap(hBitmap);
/* Are there any messages in the queue? */
MSG msg;
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
/* Translate virtual key codes */
TranslateMessage(&msg);
/* Dispatches message to window. */
DispatchMessage(&msg);
}
}

9. | On the main menu, select Build> Build remote.exe to build the project.
10. | On the main menu, select Build> Execute remote.exe to run the project.


Miscellaneous Examples (Visual C++ 5.0 and later)

You can test the following examples by either adding a command button to one of the previous lessons in the tutorial and pasting the sample code in the Click procedure, or by cutting and pasting event code into the appropriate event in a lesson.

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

InetAccept Example for C++ 5.0 and later

InetClearQueue Example for C++ 5.0 and later

InetConnect Example for C++ 5.0 and later

InetConnected Example for C++ 5.0 and later

InetDataSent Example for C++ 5.0 and later

InetDisconnect Example for C++ 5.0 and later

InetDisconnected Example for C++ 5.0 and later

InetError Example for C++ 5.0 and later

InetReceiveBitmap Example for C++ 5.0 and later

InetReceiveCmd Example for C++ 5.0 and later

InetReceiveData Example for C++ 5.0 and later

InetReceiveRsp Example for C++ 5.0 and later

InetReceiveSound Example for C++ 5.0 and later

InetReceiveStart Example for C++ 5.0 and later

InetReceiving Example for C++ 5.0 and later

InetSendAttachBitmapCmd Example for C++ 5.0 and later

InetSendBitmap Example for C++ 5.0 and later

InetSendCloseWinCmd Example for C++ 5.0 and later

InetSendCloseWinRsp Example for C++ 5.0 and later

InetSendCmd Example for C++ 5.0 and later

InetSendCreateWinCmd Example for C++ 5.0 and later

InetSendData Example for C++ 5.0 and later

InetSendDIB Example for C++ 5.0 and later

InetSendFreeBitmapCmd Example for C++ 5.0 and later

InetSendFreeBitmapRsp Example for C++ 5.0 and later

InetSendGetMagGlassDataCmd Example for C++ 5.0 and later

InetSendGetMagGlassDataRsp Example for C++ 5.0 and later

InetSending Example for C++ 5.0 and later

InetSendLoadCmd Example for C++ 5.0 and later

InetSendSaveCmd Example for C++ 5.0 and later

InetSendSetRectCmd Example for C++ 5.0 and later

InetSendSetRectRsp Example for C++ 5.0 and later

InetSendShowWinCmd Example for C++ 5.0 and later

InetSendShowWinRsp Example for C++ 5.0 and later

InetSendSizeWinCmd Example for C++ 5.0 and later

InetSendSizeWinRsp Example for C++ 5.0 and later

InetSendSound Example for C++ 5.0 and later

InetServerClose Example for C++ 5.0 and later

InetServerInit Example for C++ 5.0 and later

InetSendData2 Example for C++ 5.0 and later

InetSendSound2 Example for C++ 5.0 and later

InetSendCmd2 Example for C++ 5.0 and later

InetSendSizeWinRsp2 Example for C++ 5.0 and later

InetSendCloseWinRsp2 Example for C++ 5.0 and later

InetSendShowWinRsp2 Example for C++ 5.0 and later

InetSendSetRectRsp2 Example for C++ 5.0 and later

InetSendFreeBitmapRsp2 Example for C++ 5.0 and later

InetSendGetMagGlassDataCmd2 Example for C++ 5.0 and later

InetSendGetMagGlassDataRsp2 Example for C++ 5.0 and later

InetReceiveData2 Example for C++ 5.0 and later

InetReceiveRsp2 Example for C++ 5.0 and later

InetReceiveSound2 Example for C++ 5.0 and later

InetReceiveCmd2 Example for C++ 5.0 and later


InetAccept Example for C++ 5.0 and later

void CRasterInetSink::OnInetAccept(short
 iServer)
{
short hComputer;
short nRet;
TCHAR szHostName[80];
BSTR bstrText;
CString strText;
CString cs;

nRet = m_pDlg->m_pRasterInet->InetAcceptConnect(m_pDlg->m_hServer);
hComputer = m_pDlg->m_pRasterInet->GetInetConnectedComputer();

if(nRet != 0)
{
AfxMessageBox(TEXT("Error accepting
 connection!"));
return;
}

m_pDlg->m_pRasterInet->InetGetHostName(hComputer,
 HOST_NAME_DESCRP);
bstrText = m_pDlg->m_pRasterInet->GetInetHostName();

//add to our list
m_pDlg->m_pRasterInet->put_SendList(m_pDlg->m_pRasterInet->SendListNum, hComputer);
strText = bstrText;
lstrcpy(szHostName, (LPCTSTR)strText);
::SysFreeString(bstrText);
cs.Format(TEXT("Connection accepted from:%s"),
 strText);
AfxMessageBox(cs);
}


InetClearQueue Example for C++ 5.0

InetClearQueue Example for C++ 5.0 and later

This is also the example for the InetQueueSize property.

void CNetCapDlg::TestQueue()
{
TCHAR szText[80];
int i, nComputer;
long nSize, nTotal=0;
for (i = 0; i < m_pRasterInet->GetSendListNum();
 i++)
{
nComputer = m_pRasterInet->GetSendList(i);
nSize = m_pRasterInet->GetInetQueueSize(nComputer);

if (nSize > 0)
{
nTotal += m_pRasterInet->GetInetQueueSize(nComputer);

if (nSize > (1024*10))
{
m_pRasterInet->InetClearQueue(nComputer);
}
}
}
wsprintf(szText, TEXT("%ld"), nTotal);
AfxMessageBox(szText);
}


InetConnect Example for C++ 5.0 and later

This is also the example for the EnableMethodErrors property.

void CNet::Method ()
{
int nRet;
CString cs,text;

m_pRasterInet->EnableMethodErrors
 = FALSE;
/* get the name of the computer entered in the edit box
 control */
m_Remote.GetWindowText(text);
/* Connect to remote computer on port 1000 */

BSTR bstrtext = text.AllocSysString();
nRet = m_pRasterInet->InetConnect(bstrtext,
 1000);
SysFreeString(bstrtext);
if (nRet != 0)
{
cs.Format(TEXT(" %s\n %s\n",
 "Error connecting to :"), text);
AfxMessageBox(cs);
}
}


InetConnected Example for C++ 5.0 and later

This is also the example for the InetGetHostName method.

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetConnected(short
 iComputer)
{
TCHAR szHostName[80];
BSTR bstrText;
CString strText;
CString cs;

//add this connection to our SendList
m_pDlg->m_pRasterInet->put_SendList(m_pDlg->m_pRasterInet->SendListNum, iComputer);

m_pDlg->m_pRasterInet->InetGetHostName(iComputer,
 HOST_NAME_DESCRP);
bstrText = m_pDlg->m_pRasterInet->GetInetHostName();

strText = bstrText;
lstrcpy(szHostName, (LPCTSTR)strText);
cs.Format(TEXT("Connected to:%s"), strText);
AfxMessageBox(cs);
::SysFreeString(bstrText);
}


InetDataSent Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetDataSent(short
 iComputer, long lSize)
{
TCHAR szText[80];
// Display amount
wsprintf(szText, TEXT("Data sent: %ld bytes."), lSize);
AfxMessageBox(szText);
}


InetDisconnect Example for C++ 5.0 and later

void CNet::Method()
{
int nRet;
CString cs;
/* We are assuming only one connection in this example.
Therefore, the handle to the remote computer will be
in the first position in the SendList.
*/
nRet = m_pRasterInet->   InetDisconnect(m_pRasterInet->SendList(0));
if (nRet != 0)
{
cs.Format(TEXT("%s %d\n"),
 TEXT("Error disconnecting from the server:"),nRet);
AfxMessageBox(cs);
}
}


InetDisconnected Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetDisconnected(short
 iComputer)
{
AfxMessageBox(TEXT("Disconnected from remote computer."));
}


InetError Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetError(short
 iComputer, short iMessage, short iError)
{
TCHAR szText[80];
wsprintf(szText, TEXT("Computer %d had Error: %d (%d)"), iComputer,
 iError, iMessage);
AfxMessageBox(szText);
}


InetReceiveBitmap Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveBitmap(short
 iComputer, long hBitmap)
{
//assign bitmap to LEAD RasterView control
m_pDlg->m_LEADRasterView1.GetRaster().SetBitmap(hBitmap);
/* Are there any messages in the queue? */
MSG msg;
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
/* Translate virtual key codes */
TranslateMessage(&msg);
/* Dispatches message to window. */
DispatchMessage(&msg);
}
}


InetReceiveCmd Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

// my user defined commands
#define INETCMD_FLIP INETCMD_USER_CUSTOM

void CRasterInetSink::OnInetReceiveCmd(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, ILEADRasterVariant * ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received"),
InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_LOAD:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 4) && (Packet->GetParamType(0) == PARAM_TYPE_STRING) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32) && (Packet->GetParamType(2)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_UINT32))
{
//NOTE:
 this is a function you must create
nStatus
 = ProcessLoadCommand(Packet->GetParamValue(0)->StringValue, (short)Packet->GetParamValue(1)->LongValue
 );
if(nStatus
 != 0)
nStatus
 = ERROR_INV_PARAMETER; // invalid parameters
m_pDlg->m_pRasterInet->InetSendLoadRsp(nCommandID,
 0, 0, NULL, nStatus);
return;
}
break;

case INETCMD_CREATE_WIN:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 8) && (Packet->GetParamType(0) == PARAM_TYPE_STRING) &&
(Packet->GetParamType(1) == PARAM_TYPE_STRING) && (Packet->GetParamType(2)
 == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) && (Packet->GetParamType(4)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(5) == PARAM_TYPE_INT32) && (Packet->GetParamType(6)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(7) == PARAM_TYPE_UINT32))
{
long
 nWindowID;
//NOTE:
 this is a function you must create
nWindowID
 = ProcessCreateWinCommand(Packet->GetParamValue(1)->StringValue,
Packet->GetParamValue(3)->LongValue ,
Packet->GetParamValue(4)->LongValue ,
Packet->GetParamValue(5)->LongValue ,
Packet->GetParamValue(6)->LongValue );

nRet
 = m_pDlg->m_pRasterInet->InetSendCreateWinRsp(nCommandID,
 nWindowID, 0, NULL, 0);
return;
}
break;

case INETCMD_ATTACH_BITMAP:
if((Packet->GetParamCount()
 == 2) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_UINT32))
{
//NOTE:
 this is a function you must create
nStatus
 = ProcessAttachBitmapCommand(Packet->GetParamValue(0)->DoubleValue
 ,
Packet->GetParamValue(1)->DoubleValue);
nRet
 = m_pDlg->m_pRasterInet->InetSendAttachBitmapRsp(nCommandID, 0,
 NULL, nStatus);
return;
}
break;

case INETCMD_SAVE:
if((Packet->GetParamCount()
 == 6) && (Packet->GetParamType(0) == PARAM_TYPE_STRING) &&
(Packet->GetParamType(1) == PARAM_TYPE_UINT32) && (Packet->GetParamType(2)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) && (Packet->GetParamType(4)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(5) == PARAM_TYPE_UINT32))
{
//NOTE:
 this is a function you must create
nStatus
 = ProcessSaveCommand(Packet->GetParamValue(0)->StringValue,
Packet->GetParamValue(1)->DoubleValue,
Packet->GetParamValue(2)->LongValue,
Packet->GetParamValue(3)->LongValue,
Packet->GetParamValue(4)->LongValue,
Packet->GetParamValue(5)->DoubleValue);

nRet
 = m_pDlg->m_pRasterInet->InetSendSaveRsp(nCommandID,
 0, NULL, nStatus);
return;
}
else
nStatus
 = ERROR_INV_PARAMETER;
break;

case INETCMD_FLIP:
if((Packet->GetParamCount()
 == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
//NOTE:
 this is a function you must create
nStatus
 = ProcessFlipCommand(Packet->GetParamValue(0)->DoubleValue );
else
nStatus
 = ERROR_INV_PARAMETER;
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetReceiveCmd2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

// my user defined commands
#define INETCMD_FLIP INETCMD_USER_CUSTOM

void CRasterInetSink::OnInetReceiveCmd2(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received"),
InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_LOAD:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 4) && (Packet->GetParamType(0) == PARAM_TYPE_STRING) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32) && (Packet->GetParamType(2)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_UINT32))
{
//NOTE:
 this is a function you must create
nStatus
 = ProcessLoadCommand(Packet->GetParamValue(0).bstrVal, (short)Packet->GetParamValue(1).lVal);
if(nStatus
 != 0)
nStatus
 = ERROR_INV_PARAMETER; // invalid parameters
m_pDlg->m_pRasterInet->InetSendLoadRsp2(nCommandID,
 0, 0, NULL, nStatus);
return;
}
break;

case INETCMD_CREATE_WIN:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 8) && (Packet->GetParamType(0) == PARAM_TYPE_STRING) &&
(Packet->GetParamType(1) == PARAM_TYPE_STRING) && (Packet->GetParamType(2)
 == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) && (Packet->GetParamType(4)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(5) == PARAM_TYPE_INT32) && (Packet->GetParamType(6)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(7) == PARAM_TYPE_UINT32))
{
long
 nWindowID;
//NOTE:
 this is a function you must create
nWindowID
 = ProcessCreateWinCommand(Packet->GetParamValue(1).bstrVal,
Packet->GetParamValue(3).lVal,
Packet->GetParamValue(4).lVal,
Packet->GetParamValue(5).lVal,
Packet->GetParamValue(6).lVal);

nRet
 = m_pDlg->m_pRasterInet->InetSendCreateWinRsp2(nCommandID,
 nWindowID, 0, NULL, 0);
return;
}
break;

case INETCMD_ATTACH_BITMAP:
if((Packet->GetParamCount()
 == 2) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_UINT32))
{
//NOTE:
 this is a function you must create
nStatus
 = ProcessAttachBitmapCommand(Packet->GetParamValue(0).ulVal,
Packet->GetParamValue(1).ulVal);
nRet
 = m_pDlg->m_pRasterInet->InetSendAttachBitmapRsp2(nCommandID,
 0, NULL, nStatus);
return;
}
break;

case INETCMD_SAVE:
if((Packet->GetParamCount()
 == 6) && (Packet->GetParamType(0) == PARAM_TYPE_STRING) &&
(Packet->GetParamType(1) == PARAM_TYPE_UINT32) && (Packet->GetParamType(2)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) && (Packet->GetParamType(4)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(5) == PARAM_TYPE_UINT32))
{
//NOTE:
 this is a function you must create
nStatus
 = ProcessSaveCommand(Packet->GetParamValue(0).bstrVal,
Packet->GetParamValue(1).ulVal,
Packet->GetParamValue(2).lVal,
Packet->GetParamValue(3).lVal,
Packet->GetParamValue(4).lVal,
Packet->GetParamValue(5).ulVal);

nRet
 = m_pDlg->m_pRasterInet->InetSendSaveRsp2(nCommandID,
 0, NULL, nStatus);
return;
}
else
nStatus
 = ERROR_INV_PARAMETER;
break;

case INETCMD_FLIP:
if((Packet->GetParamCount()
 == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
//NOTE:
 this is a function you must create
nStatus
 = ProcessFlipCommand(Packet->GetParamValue(0).ulVal);
else
nStatus
 = ERROR_INV_PARAMETER;
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp2((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetReceiveData Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveData(short
 iComputer, ILEADRasterVariant *pData, long lSize, short iType)
{
TCHAR szText[80];
// convert to a string
wsprintf(szText, TEXT("Received %ld bytes from %d computer"),
 lSize, iComputer);
AfxMessageBox(szText);
}


InetReceiveData2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveData2(short
 iComputer, const _variant_t &pData, long lSize, short iType)
{
TCHAR szText[80];
// convert to a string
wsprintf(szText, TEXT("Received %ld bytes from %d
 computer"), lSize, iComputer);
AfxMessageBox(szText);
}


InetReceiveRsp Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveRsp(short
 iComputer, short InetCommand, long nCommandID, short nError, short nStatus,
struct ILEADRasterInetPacket * Params, long nExtraDataSize, ILEADRasterVariant
 *ExtraData)
{
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;

szOut.Format(TEXT("Command %d id=%d, nError=%d nStatus=%d,
 nParams=%d received"), InetCommand, nCommandID, nError, nStatus,
 Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
return;

switch(InetCommand)
{
case INETCMD_LOAD:
if((nStatus == 0)
 || (nStatus == 1))
{
if((Packet->GetParamCount()
 == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
{
OutputDebugString(TEXT("Load
 SUCCEEDED!"));
}
else
{
szOut.Format(TEXT("Load
 failed with error code %d"), nStatus);
OutputDebugString(szOut);
}
}
break;
}
}


InetReceiveRsp2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveRsp2(short
 iComputer, short InetCommand, long nCommandID, short nError, short nStatus,
struct ILEADRasterInetPacket * Params, long nExtraDataSize, const _variant_t
 & ExtraData)
{
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;

szOut.Format(TEXT("Command %d id=%d, nError=%d nStatus=%d,
 nParams=%d received"), InetCommand, nCommandID, nError, nStatus,
 Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
return;

switch(InetCommand)
{
case INETCMD_LOAD:
if((nStatus == 0)
 || (nStatus == 1))
{
if((Packet->GetParamCount()
 == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
{
OutputDebugString(TEXT("Load
 SUCCEEDED!"));
}
else
{
szOut.Format(TEXT("Load
 failed with error code %d"), nStatus);
OutputDebugString(szOut);
}
}
break;
}
}


InetReceiveSound Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

You should have the following declaration at your H file for exeample ServerDlg.h

int m_nSoundFlag;
long m_hSound;
CLEADCap m_LEADCap1; // Lead capture control class

You should add the following to your project:

1. edit the RasterInetSink.h file and add the following:

//{{AFX_MSG(CRasterInetSink)
// NOTE - the ClassWizard will add and remove member functions here.

....
....
....
afx_msg void OnInetReceiveSound(short, short, short, long, long, short, short, short, const _variant_t &, const _variant_t &, const long);
//}}AFX_MSG

2. edit the RasterInetSink.cpp file and add the following two sections:

a.

BEGIN_DISPATCH_MAP(CRasterInetSink, CCmdTarget)

//{{AFX_DISPATCH_MAP(CRasterInetSink)

// NOTE - the ClassWizard will add and remove mapping macros here.

...
...
...

DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveSound",11,OnInetReceiveSound, VT_EMPTY,VTS_I2 VTS_I2 VTS_I2 VTS_I4 VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I4)

//}}AFX_DISPATCH_MAP

END_DISPATCH_MAP()

b.

void CRasterInetSink::OnInetReceiveSound(
short iComputer,
short iFormatTag,
short nChannels,
long lSamplesPerSec,
long lAvgBytesPerSec,
short iBlockAlign,
short iBitsPerSample,
short iExtraDataSize,
ILEADRasterVariant *pExtraData,
ILEADRasterVariant *pData,
long lDataSize)
{
VARIANT vaExtra;
VARIANT vaData;
SAFEARRAY FAR *psa;
SAFEARRAYBOUND rgsabound[1];

VariantInit(&vaExtra);
VariantInit(&vaData);

if(pExtraData->Type == VALUE_STRING)
{
V_VT(&vaExtra) = VT_BSTR;
V_BSTR(&vaExtra) = SysAllocString(A2BSTR(pExtraData->StringValue));
}
else if (pExtraData->Type == VALUE_ARRAY_BYTE)
{
psa = SafeArrayCreate(VT_UI1, 1, rgsabound);
if(!psa)
{
return;
}
SafeArrayLock(psa);
memcpy(psa->pvData, pExtraData->ShortItemValue
 , pExtraData->ItemCount);
SafeArrayUnlock(psa);
V_VT(&vaExtra) = (VT_ARRAY | VT_UI1);
V_ARRAY(&vaExtra) = psa;
}
else
return ;

if(pData->Type == VALUE_STRING)
{
V_VT(&vaData) = VT_BSTR;
V_BSTR(&vaData) = SysAllocString(A2BSTR(pData->StringValue));
}
else if (pData->Type == VALUE_ARRAY_BYTE)
{
psa = SafeArrayCreate(VT_UI1, 1, rgsabound);
if(!psa)
{
return;
}
SafeArrayLock(psa);
memcpy(psa->pvData, pData->ShortItemValue
 , pData->ItemCount);
SafeArrayUnlock(psa);
V_VT(&vaData) = (VT_ARRAY | VT_UI1);
V_ARRAY(&vaData) = psa;
}
else
return ;
// this example uses the LEAD Capture Module for sound
 playback
if (m_pDlg->m_nSoundFlag == FALSE)
{
m_pDlg->m_LEADCap1.SetCapWaveFormatTag(CAP_AUDIO_FEED,
 iFormatTag);
m_pDlg->m_LEADCap1.SetCapWaveChannels
 (CAP_AUDIO_FEED, nChannels);
m_pDlg->m_LEADCap1.SetCapWaveSamplesPerSec
 (CAP_AUDIO_FEED, lSamplesPerSec);
m_pDlg->m_LEADCap1.SetCapWaveAvgBytesPerSec
 (CAP_AUDIO_FEED, lAvgBytesPerSec);
m_pDlg->m_LEADCap1.SetCapWaveBlockAlign
 (CAP_AUDIO_FEED, iBlockAlign);
m_pDlg->m_LEADCap1.SetCapWaveBitsPerSample
 (CAP_AUDIO_FEED, iBitsPerSample);
m_pDlg->m_LEADCap1.SetCapWaveExtraSize
 (CAP_AUDIO_FEED, iExtraDataSize);
m_pDlg->m_LEADCap1.SetCapWaveExtraData
 (CAP_AUDIO_FEED, vaExtra);

m_pDlg->m_LEADCap1.CapStartFeedSound("",
 -1, 0, CAP_FEED_PLAYDATA, &m_pDlg->m_hSound);
m_pDlg->m_nSoundFlag = TRUE;
}
else
m_pDlg->m_LEADCap1.CapFeedSound(m_pDlg->m_hSound,
 (VARIANT *)&vaData, lDataSize);

// when finished playing sound m_LEADCap1.CapStopFeedSound
 should be
// called. A good place to do it would be in the InetDisconnected
 event
}


InetReceiveSound2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

You should have the following declaration at your H file for exeample ServerDlg.h

int m_nSoundFlag;
long m_hSound;
CLEADCap m_LEADCap1; // Lead capture control class

You should add the following to your project:

1. Edit the RasterInetSink.h file and add the following:

//{{AFX_MSG(CRasterInetSink)
// NOTE - the ClassWizard will add and remove member functions here.

....
....
....
afx_msg void OnInetReceiveSound2(short, short, short, long, long, short, short, short, const _variant_t &, const _variant_t &, const long);
//}}AFX_MSG

2. Edit the RasterInetSink.cpp file and add the following two sections:

a.

BEGIN_DISPATCH_MAP(CRasterInetSink, CCmdTarget)

//{{AFX_DISPATCH_MAP(CRasterInetSink)

// NOTE - the ClassWizard will add and remove mapping macros here.

...
...
...

DISP_FUNCTION_ID(CRasterInetSink,"InetReceiveSound2",11,OnInetReceiveSound2, VT_EMPTY,VTS_I2 VTS_I2 VTS_I2 VTS_I4 VTS_I4 VTS_I2 VTS_I2 VTS_I2 VTS_I4)

//}}AFX_DISPATCH_MAP

END_DISPATCH_MAP()

b.

void CRasterInetSink::OnInetReceiveSound2(

short iComputer,
short iFormatTag,
short nChannels,
long lSamplesPerSec,
long lAvgBytesPerSec,
short iBlockAlign,
short iBitsPerSample,
short iExtraDataSize,
const _variant_t &pExtraData,
const _variant_t &pData,
long lDataSize)

{

   // this example uses the LEAD Capture Module
 for sound playback
if (m_pDlg->m_nSoundFlag == FALSE)
{
m_pDlg->m_LEADCap1.SetCapWaveFormatTag(CAP_AUDIO_FEED,
 iFormatTag);
m_pDlg->m_LEADCap1.SetCapWaveChannels
 (CAP_AUDIO_FEED, nChannels);
m_pDlg->m_LEADCap1.SetCapWaveSamplesPerSec
 (CAP_AUDIO_FEED, lSamplesPerSec);
m_pDlg->m_LEADCap1.SetCapWaveAvgBytesPerSec
 (CAP_AUDIO_FEED, lAvgBytesPerSec);
m_pDlg->m_LEADCap1.SetCapWaveBlockAlign
 (CAP_AUDIO_FEED, iBlockAlign);
m_pDlg->m_LEADCap1.SetCapWaveBitsPerSample
 (CAP_AUDIO_FEED, iBitsPerSample);
m_pDlg->m_LEADCap1.SetCapWaveExtraSize
 (CAP_AUDIO_FEED, iExtraDataSize);
m_pDlg->m_LEADCap1.SetCapWaveExtraData
 (CAP_AUDIO_FEED, pExtraData);

m_pDlg->m_LEADCap1.CapStartFeedSound ("", -1, 0, CAP_FEED_PLAYDATA, &m_pDlg->m_hSound);

      m_pDlg->m_nSoundFlag
 = TRUE;
}
else
m_pDlg->m_LEADCap1.CapFeedSound
 (m_pDlg->m_hSound, (VARIANT *)&pData, lDataSize);

// when finished playing sound m_LEADCap1.CapStopFeedSound should be
// called. A good place to do it would be in the InetDisconnected event
}


InetReceiveStart Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveStart(short
 iComputer, long lSize)
{
TCHAR szText[80];
// Display amount expected
wsprintf(szText, TEXT("Will receive: %ld bytes."), lSize);
AfxMessageBox(szText);
}


InetReceiving Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiving(short
 iComputer, long lSize)
{
TCHAR szText[80];
// Display amount expected
wsprintf(szText, TEXT("Receiving: %ld bytes.\n"), lSize);
OutputDebugString(szText);
}


InetSendAttachBitmapCmd Example for C++ 5.0 and later

short nRet;
CString csOut;
nRet = m_pRasterInet->InetSendAttachBitmapCmd(999,
 1, 1);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendAttachBitmapCmd."),
 nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendAttachBitmapCmd Executed."));


InetSendBitmap Example for C++ 5.0 and later

void CNet::Method()
{
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;

if(m_LEADRasterView1.GetRaster().GetBitmap() == 0)
{
CoCreateInstance(CLSID_LEADRasterIO,
 NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
 "o:\\images\\new\\001.jpg", 0, 1, 1);
pRasterIO->Release();
}

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
 IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Flip(m_LEADRasterView1.GetRaster());
pRasterProc->Release();

//send the images to the remote computer
m_pRasterInet->InetSendBitmap(m_LEADRasterView1.GetRaster(),
 FILE_CMP, 24, (QFactorConstants)75);
}


InetSendCloseWinCmd Example for C++ 5.0 and later

short nRet;
CString csOut;

nRet = m_pRasterInet->InetSendCloseWinCmd(999,
 1);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendCloseWinCmd."),
 nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendCloseWinCmd Executed."));


InetSendCloseWinRsp Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmdInetReceiveCmdevent(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, ILEADRasterVariant * ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received"),
InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_CLOSE_WIN:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessCloseWinCommand(Packet->GetParamValue(0)->DoubleValue);
nRet
 = m_pDlg->m_pRasterInet->InetSendCloseWinRsp(nCommandID,
 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendCloseWinRsp2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd2(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received."), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_CLOSE_WIN:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessCloseWinCommand(Packet->GetParamValue(0).ulVal);
nRet
 = m_pDlg->m_pRasterInet->InetSendCloseWinRsp2(nCommandID,
 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp2((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendCmd Example for C++ 5.0 and later

// my user defined commands
#define INETCMD_FLIP INETCMD_USER_CUSTOM

short nRet;
CString csOut;
ILEADRasterInetPacket *pPacket=NULL;
TCHAR szText[]=TEXT("This is Flip");
HRESULT hr;
ILEADRasterVariant * pltRasVar1 = NULL;
ILEADRasterVariant * pltRasVar2 = NULL;

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

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

hr = CoCreateInstance(CLSID_LEADRasterInetPacket, NULL, CLSCTX_ALL, IID_ILEADRasterInetPacket,
 (void**)&pPacket);

pPacket->put_ParamCount(1);
pltRasVar1->Type = VALUE_ULONG;
pltRasVar1->DoubleValue = 999

pPacket->put_ParamValue(0, pltRasVar1);
pPacket->put_ParamType(0, PARAM_TYPE_UINT32);

pltRasVar2->Type = VALUE_STRING;

lstrcpy(pltRasVar2->ShortValue, szText);

nRet = m_pRasterInet->InetSendCmd(INETCMD_FLIP,
 999, pPacket, lstrlen(szText) + 1, pltRasVar2);

if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendCmd.\n"), nRet);
OutputDebugString(csOut);
}
else
OutputDebugString(TEXT("InetSendCmd Executed.\n"));

pPacket->Release();
pltRasVar1->Release();
pltRasVar2->Release();


InetSendCmd2 Example for C++ 5.0 and later

// my user defined commands
#define INETCMD_FLIP INETCMD_USER_CUSTOM

short nRet;
CString csOut;
ILEADRasterInetPacket *pPacket=NULL;
TCHAR szText[]=TEXT("This is Flip");
VARIANT var;
SAFEARRAY FAR *psa;
SAFEARRAYBOUND rgsabound[1];
VARIANT vaVal;
HRESULT hr;

hr = CoCreateInstance(CLSID_LEADRasterInetPacket, NULL, CLSCTX_ALL, IID_ILEADRasterInetPacket,
 (void**)&pPacket);

pPacket->put_ParamCount(1);
VariantInit(&vaVal);
V_VT(&vaVal) = (VT_UI4);
V_UI4(&vaVal) = 999;
pPacket->put_ParamValue(0, vaVal);
pPacket->put_ParamType(0, PARAM_TYPE_UINT32);

VariantInit(&var);
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = lstrlen(szText) + 1;

psa = SafeArrayCreate(VT_UI1, 1, rgsabound);
if (psa != NULL)
{
SafeArrayLock(psa);
lstrcpy((char far *)psa->pvData, szText);
SafeArrayUnlock(psa);
V_VT(&var) = (VT_ARRAY | VT_UI1);
V_ARRAY(&var) = psa;

nRet = m_pRasterInet->InetSendCmd2(INETCMD_FLIP,
 999, pPacket, lstrlen(szText) + 1, &var);

if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling
 InetSendCmd2.\n"), nRet);
OutputDebugString(csOut);
}
else
OutputDebugString(TEXT("InetSendCmd2
 executed.\n"));
}
pPacket->Release();


InetSendCreateWinCmd Example for C++ 5.0 and later

short nRet;
CString csOut;
nRet = m_pRasterInet->InetSendCreateWinCmd(999,
"", "Window Created By Remote",
0, 100, 50, 300, 150, 0);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendCreateWinCmd."),
 nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendCreateWinCmd Executed."));


InetSendData Example for C++ 5.0 and later

void CNet::Method()
{
TCHAR szText[]=TEXT("This is a test.");
VARIANT var;
SAFEARRAY FAR *psa;
SAFEARRAYBOUND rgsabound[1];
ILEADRasterVariant * pltRasVar = NULL;

HRESULT hr = ::CoCreateInstance(CLSID_LEADRasterVariant,
 NULL, CLSCTX_ALL, IID_ILEADRasterVariant, (void **)&pltRasVar);

pltRasVar->Type = VALUE_STRING;
lstrcpy(pltRasVar->StringValue, szText);

m_pRasterInet->InetSendData(pltRasVar,
 strlen(szText) + 1, INETDATA_USER2);

pltRasVar->Release();
}


InetSendData2 Example for C++ 5.0 and later

void CNet::Method()
{
TCHAR szText[]=TEXT("This is a test.");
VARIANT var;
SAFEARRAY FAR *psa;
SAFEARRAYBOUND rgsabound[1];

   m_pRasterInet->PutEnableUseLEADRasterVariant(FALSE);

VariantInit(&var);
rgsabound[0].lLbound = 0;
rgsabound[0].cElements = strlen(szText) + 1;

psa = SafeArrayCreate(VT_UI1, 1, rgsabound);
if (psa != NULL)
{
SafeArrayLock(psa);
lstrcpy((char far *)psa->pvData,
 szText);
SafeArrayUnlock(psa);
V_VT(&var) = (VT_ARRAY | VT_UI1);
V_ARRAY(&var) = psa;
m_pRasterInet->InetSendData2(&var,
 strlen(szText) + 1, INETDATA_USER2);
SafeArrayDestroy(psa);
}
VariantClear(&var);
}


InetSendDIB Example for C++ 5.0 and later

void CNet::Method()
{
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterProcess *pRasterProc=NULL;
long hDIB;

if(m_LEADRasterView1.GetRaster().GetBitmap() == 0)
{
CoCreateInstance(CLSID_LEADRasterIO,
 NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
pRasterIO->Load(m_LEADRasterView1.GetRaster(),
 "o:\\images\\new\\001.jpg", 0, 1, 1);
pRasterIO->Release();
}

CoCreateInstance(CLSID_LEADRasterProcess, NULL, CLSCTX_ALL,
 IID_ILEADRasterProcess, (void**)&pRasterProc);
pRasterProc->Flip(m_LEADRasterView1.GetRaster());
pRasterProc->Release();

//send the images to the remote computer
hDIB = m_LEADRasterView1.GetRaster().GetDIB();
m_pRasterInet->InetSendDIB(hDIB,
 FILE_CMP, 24, (QFactorConstants)75);
GlobalFree((HGLOBAL)hDIB);
}


InetSendFreeBitmapCmd Example for C++ 5.0 and later

short nRet;
CString csOut;
nRet = m_pRasterInet->InetSendFreeBitmapCmd(999,
 1);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendFreeBitmapCmd."),
 nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendFreeBitmapCmd executed."));


InetSendFreeBitmapRsp Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, ILEADRasterVariant * ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received."), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_FREE_BITMAP:
if((Packet->GetParamCount()
 == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessFreeCommand(Packet->GetParamValue(0)->DoubleValue);
nRet
 = m_pDlg->m_pRasterInet->InetSendFreeBitmapRsp(nCommandID,
 0, NULL, nStatus);
}
else
nStatus
 = ERROR_INV_PARAMETER;
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendFreeBitmapRsp2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd2(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received"), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_FREE_BITMAP:
if((Packet->GetParamCount()
 == 1) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessFreeCommand(Packet->GetParamValue(0).ulVal);
nRet
 = m_pDlg->m_pRasterInet->InetSendFreeBitmapRsp2(nCommandID,
 0, NULL, nStatus);
}
else
nStatus
 = ERROR_INV_PARAMETER;
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp2((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendGetMagGlassDataCmd Example for C++ 5.0 and later

long nCommandID;

// … Assume that the following function will be called from
 inside the MagGlassExt event that
// belongs to LEAD RasterView control
short GetMagGlassData(long nBitmapID,
ILEADRasterVariant * vMaskPlane,
short nMaskPlaneStart,
short nMaskPlaneEnd)
{
short nRet;
CString csOut;

nRet = m_pRasterInet->InetSendGetMagGlassDataCmd(nCommandID++,
 nBitmapID, vMaskPlane, nMaskPlaneStart, nMaskPlaneEnd);

if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling
 InetSendGetMagGlassDataCmd."), nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendGetMagGlassDataCmd
 executed."));

return nRet;
}


InetSendGetMagGlassDataCmd2 Example for C++ 5.0 and later

long nCommandID;

// … Assume that the following function will be called from inside the
 MagGlassExt event that
// belongs to LEAD RasterView control
short GetMagGlassData(long nBitmapID,
const VARIANT FAR& vMaskPlane,
short nMaskPlaneStart,
short nMaskPlaneEnd)
{
short nRet;
CString csOut;

nRet = m_pRasterInet->InetSendGetMagGlassDataCmd2(nCommandID++,
 nBitmapID, vMaskPlane, nMaskPlaneStart, nMaskPlaneEnd);

if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling
 InetSendGetMagGlassDataCmd2."), nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendGetMagGlassDataCmd2
 executed."));

return nRet;
}


InetSendGetMagGlassDataRsp Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, ILEADRasterVariant * ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
CLEADRasterView *pLead=NULL;
VARIANT vColorBuffer;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received."), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_GET_MAGGLASS_DATA:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 5) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_UINT32) && (Packet->GetParamType(2)
 == PARAM_TYPE_USTRING) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT16) && (Packet->GetParamType(4)
 == PARAM_TYPE_INT16))
{
//
 Note: This is a function you must create to get a pointer to the
//
 control that has the bitmap.
pLead
 = FindLBitmap(Packet->GetParamValue(0)->DoubleValue );

if(pLead)
{
nStatus
 = m_pDlg->m_pRasterInet->InetGetMagGlassData(pLead->GetRaster().m_lpDispatch,
 &vColorBuffer,
Packet->GetParamValue(2), Packet->GetParamValue(3)->LongValue,
 Packet->GetParamValue(4)->LongValue);
}
else
nStatus
 = ERROR_INV_PARAMETER; // invalid parameter

m_pDlg->m_pRasterInet->InetSendGetMagGlassDataRsp(nCommandID,
 vColorBuffer, Packet->GetParamValue(2), Packet->GetParamValue(3)->LongValue,
 Packet->GetParamValue(4)->LongValue , 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendGetMagGlassDataRsp2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd2(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
CLEADRasterView *pLead=NULL;
VARIANT vColorBuffer;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received"), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_GET_MAGGLASS_DATA:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 5) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&

(Packet->GetParamType(1)
 == PARAM_TYPE_UINT32) && (Packet->GetParamType(2) == PARAM_TYPE_USTRING)
 &&

(Packet->GetParamType(3) == PARAM_TYPE_INT16) &&
 (Packet->GetParamType(4) == PARAM_TYPE_INT16))
{
//
 Note: This is a function you must create to get a pointer to the
//
 control that has the bitmap.
pLead
 = FindLBitmap(Packet->GetParamValue(0).ulVal);

if(pLead)
{
nStatus
 = m_pDlg->m_pRasterInet->InetGetMagGlassData2(pLead->GetRaster().m_lpDispatch,
 &vColorBuffer,
Packet->GetParamValue(2), Packet->GetParamValue(3).iVal, Packet->GetParamValue(4).iVal);
}
else
nStatus
 = -13;//ERROR_INV_PARAMETER; // invalid parameter

m_pDlg->m_pRasterInet->InetSendGetMagGlassDataRsp2(nCommandID,
 vColorBuffer, Packet->GetParamValue(2),
Packet->GetParamValue(3).iVal, Packet->GetParamValue(4).iVal, 0,
 NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp2((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSending Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the exampleInitializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetSending(short
 iComputer, long lSize)
{
TCHAR szText[80];
// Display amount
wsprintf(szText, TEXT("Sending: %ld bytes."), lSize);
OutputDebugString(szText);
}


InetSendLoadCmd Example for C++ 5.0 and later

short nRet;
CString csOut;
nRet = m_pRasterInet->InetSendLoadCmd(999,
 "v:\\images\\eagle.cmp", 0, 1);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendLoadCmd."), nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendLoadCmd executed."));


InetSendSaveCmd Example for C++ 5.0 and later

short nRet;
CString csOut;
nRet = m_pRasterInet->InetSendSaveCmd(999,
 99,
"d:\\temp\\remote.tif",
FILE_TIF, 0, 0, TRUE);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendSaveCmd."), nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendSaveCmd Executed."));


InetSendSetRectCmd Example for C++ 5.0 and later

short nRet;
CString csOut;

nRet = m_pRasterInet->InetSendSetRectCmd(999,
 1, DISPLAY_RECT_DST, 0, 0, 100, 100);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendSetRectCmd."),
 nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendSetRectCmd executed."));


InetSendSetRectRsp Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, ILEADRasterVariant * ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received"), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_SET_RECT:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 6) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(2) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(4) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(5) == PARAM_TYPE_INT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessSetRectCommand(Packet->GetParamValue(0)->DoubleValue, Packet->GetParamValue(1)->LongValue
 ,
Packet->GetParamValue(2)->LongValue, Packet->GetParamValue(3)->LongValue,
 Packet->GetParamValue(4)->LongValue, Packet->GetParamValue(5)->LongValue
 );
nRet
 = m_pDlg->m_pRasterInet->InetSendSetRectRsp(nCommandID,
 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendSetRectRsp2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd2(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received."), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_SET_RECT:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 6) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(2) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(4) == PARAM_TYPE_INT32) &&
(Packet->GetParamType(5) == PARAM_TYPE_INT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessSetRectCommand(Packet->GetParamValue(0).ulVal, Packet->GetParamValue(1).lVal,
Packet->GetParamValue(2).lVal, Packet->GetParamValue(3).lVal, Packet->GetParamValue(4).lVal,
 Packet->GetParamValue(5).lVal);
nRet
 = m_pDlg->m_pRasterInet->InetSendSetRectRsp2(nCommandID,
 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp2((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendShowWinCmd Example for C++ 5.0 and later

short nRet;
CString csOut;
nRet = m_pRasterInet->InetSendShowWinCmd(999,
 1, SW_HIDE);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendShowWinCmd."), nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendShowWinCmd executed."));


InetSendShowWinRsp Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, ILEADRasterVariant * ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received."), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_SHOW_WIN:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 2) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessShowWinCommand(Packet->GetParamValue(0)->DoubleValue, Packet->GetParamValue(1)->LongValue);
nRet
 = m_pDlg->m_pRasterInet->InetSendShowWinRsp(nCommandID,
 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendShowWinRsp2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd2(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received."), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_SHOW_WIN:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 2) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessShowWinCommand(Packet->GetParamValue(0).ulVal, Packet->GetParamValue(1).lVal);
nRet
 = m_pDlg->m_pRasterInet->InetSendShowWinRsp2(nCommandID,
 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp2((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendSizeWinCmd Example for C++ 5.0 and later

short nRet;
CString csOut;
nRet = m_pRasterInet->InetSendSizeWinCmd(999,
 1, 0, 0, 100, 100);
if((nRet != 0) && (nRet != ERROR_DATA_QUEUED))
{
csOut.Format(TEXT("ERROR %d calling InetSendSizeWinCmd."), nRet);
AfxMessageBox(csOut);
}
else
AfxMessageBox(TEXT("InetSendSizeWinCmd executed."));


InetSendSizeWinRsp Example for C++ 5.0 and later

Note:

This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, ILEADRasterVariant * ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received."), InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_SIZE_WIN:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 5) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32) && (Packet->GetParamType(2)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) && (Packet->GetParamType(4)
 == PARAM_TYPE_INT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessSizeWinCommand(Packet->GetParamValue(0)->DoubleValue, Packet->GetParamValue(1)->LongValue,
Packet->GetParamValue(2)->LongValue, Packet->GetParamValue(3)->LongValue,
 Packet->GetParamValue(4)->LongValue);
nRet
 = m_pDlg->m_pRasterInet->InetSendSizeWinRsp(nCommandID,
 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendSizeWinRsp2 Example for C++ 5.0 and later

Note: This is not a complete example for handling events, some steps have been omitted. For a complete example of how to handle events, refer to the example Initializing a Computer as a Server and Accepting Connections.

void CRasterInetSink::OnInetReceiveCmd2(short
 iComputer, short InetCommand, long nCommandID, short nError, struct ILEADRasterInetPacket
 * Params, long nExtraDataSize, const _variant_t & ExtraData)
{
short nStatus;
CString szOut;
CString szTmp;
ILEADRasterInetPacket *Packet = Params;
short nRet;

nStatus = ERROR_FEATURE_NOT_SUPPORTED;

szOut.Format(TEXT("Command %d id=%d, nError=%d nParams=%d
 received."),
InetCommand, nCommandID, nError, Packet->GetParamCount());

if(nExtraDataSize > 0)
{
szTmp.Format(TEXT(", nExtraDataSize=%d"),
 nExtraDataSize);
szOut = szOut + szTmp;
}
OutputDebugString(szOut);
OutputDebugString(TEXT("\n"));

if(nError != 0)
nStatus = ERROR_TRANSFER_ABORTED;
else
{
switch(InetCommand)
{
case INETCMD_SIZE_WIN:
//
 check the validity of the parameters
if((Packet->GetParamCount()
 == 5) && (Packet->GetParamType(0) == PARAM_TYPE_UINT32) &&
(Packet->GetParamType(1) == PARAM_TYPE_INT32) && (Packet->GetParamType(2)
 == PARAM_TYPE_INT32) &&
(Packet->GetParamType(3) == PARAM_TYPE_INT32) && (Packet->GetParamType(4)
 == PARAM_TYPE_INT32))
{
//Note
 this is a function you must create
nStatus
 = ProcessSizeWinCommand(Packet->GetParamValue(0).ulVal, Packet->GetParamValue(1).lVal,
 Packet->GetParamValue(2).lVal, Packet->GetParamValue(3).lVal, Packet->GetParamValue(4).lVal);
nRet
 = m_pDlg->m_pRasterInet->InetSendSizeWinRsp2(nCommandID,
 0, NULL, nStatus);
return;
}
break;
}
}
//return an error response
m_pDlg->m_pRasterInet->InetSendRsp2((InetCmdType)InetCommand,
 nCommandID, NULL, 0, NULL, nStatus);
}


InetSendSound Example for C++ 5.0 and later

// This example uses LEAD Capture control to capture audio
 from the microphone and uses the LEAD //Internet Control to send it to
 a remote computer. For an example of starting and stopping recording
//refer to the LEAD Capture control documentation.

void CNetDlg::OnCapAudioDataLeadcapctrl(const VARIANT FAR& pData, long
 lBytesRecorded, short iIndex)
{
// send sound to remote computer (items in SendList property)
// you should be connected to a remote computer first
 by using the
// InetConnect method of the Internet COM

ILEADRasterVariant * pltRasVar1 = NULL;
ILEADRasterVariant * pltRasVar2 = NULL;

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

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

VARIANT var;
var = m_LEADCap1.GetCapWaveExtraData(iIndex);

if(var.vt = VT_ARRAY | VT_UI1)
{
pltRasVar1->Type = VALUE_ARRAY_BYTE;
pltRasVar1->ItemCount = var.parray->rgsabound->cElements;
for(long i = 0; i<pltRasVar1->ItemCount
 ; i++)
SafeArrayGetElement(pData.parray ,
 &i, pltRasVar1->ShortItemValue (i));
}
else if (var.vt = VT_BSTR)
{
pltRasVar1->Type = VALUE_STRING;
pltRasVar1->StringValue = var.bstrVal;
}
else
return;

if(pData.vt = VT_ARRAY | VT_UI1)
{
pltRasVar2->Type = VALUE_ARRAY_BYTE;
pltRasVar2->ItemCount = pData.parray->rgsabound->cElements;
for(long i = 0; i<pltRasVar2->ItemCount
 ; i++)
SafeArrayGetElement(pData.parray
 , &i, pltRasVar2->ShortItemValue (i));
}
else if (pData.vt = VT_BSTR)
{
pltRasVar2->Type = VALUE_STRING;
pltRasVar2->StringValue = pData.bstrVal
 ;
}
else
return;

m_pRasterInet->InetSendSound(m_LEADCap1.GetCapWaveFormatTag
 (iIndex), m_LEADCap1.GetCapWaveChannels (iIndex),
m_LEADCap1.GetCapWaveSamplesPerSec (iIndex), m_LEADCap1.GetCapWaveAvgBytesPerSec
 (iIndex), m_LEADCap1.GetCapWaveBlockAlign (iIndex), m_LEADCap1.GetCapWaveBitsPerSample
 (iIndex), (short)m_LEADCap1.GetCapWaveExtraSize (iIndex), pltRasVar1,
 pltRasVar2, lBytesRecorded);

VariantClear(&var);
pltRasVar1->Release ();
pltRasVar2->Release ();
}


InetSendSound2 Example for C++ 5.0 and later

// This example uses LEAD Capture control to capture audio from the microphone and uses the LEAD //Internet Control to send it to a remote computer. For an example of starting and stopping recording
//refer to the LEAD Capture control documentation.

void CNetDlg::OnCapAudioDataLeadcapctrl(const VARIANT FAR& pData, long lBytesRecorded, short iIndex)

{
// send sound to remote computer (items in SendList property)
// you should be connected to a remote computer first
 by using the
// InetConnect method of the Internet COM

VARIANT var;
var = m_LEADCap1.GetCapWaveExtraData(iIndex);

m_pRasterInet->InetSendSound2(m_LEADCap1.GetCapWaveFormatTag (iIndex), m_LEADCap1.GetCapWaveChannels (iIndex),
m_LEADCap1.GetCapWaveSamplesPerSec (iIndex), m_LEADCap1.GetCapWaveAvgBytesPerSec (iIndex), m_LEADCap1.GetCapWaveBlockAlign (iIndex), m_LEADCap1.GetCapWaveBitsPerSample (iIndex), (short)m_LEADCap1.GetCapWaveExtraSize (iIndex), &var, (VARIANT *)&pData, lBytesRecorded);

VariantClear(&var);
}


InetServerClose Example for C++ 5.0 and later

void CNet::Method(short iServer)
{
// shutdown server on exit
m_pRasterInet->InetServerClose(iServer);
}


InetServerInit Example for C++ 5.0 and later

void CNet::Method(short iServer)
{
// initialize port 1000 to wait for connections
m_pRasterInet->InetServerInit(
 1000);
iServer = m_pRasterInet->GetInetServerHandle();
}


ConnectList property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ConnectList (short iIndex)
Overview | Refer to Implementing Internet Functionality.

Remarks

(Read only) An array of computer handles of current connections. The connections can result from InetConnect or InetAcceptConnect.

Use this property to keep track of current connections. Computer handles are automatically added and deleted from this array as connections are made or dropped.

Note:

The ConnectList property contains handles to all computers that are connected, regardless of the server that accepted the connection. If you wish to keep up with connections on a per server basis, you should use one control per server.

See Also

Elements: | ConnectListNum property, InetConnect method, SendList property
Topics | Working with Internet Functionality: Network Connections


ConnectListNum property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short ConnectListNum
Overview | Refer to Implementing Internet Functionality.

Remarks

(Read Only) Gets the number of items in the ConnectList array.

See Also

Elements: | ConnectList property, SendList property
Topics | Working with Internet Functionality: Network Connections


EnableMethodErrors property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | long EnableMethodErrors
Overview | Refer to Implementing Internet Functionality.

Remarks

Specifies whether LEADTOOLS generates runtime exceptions (in addition to method return values). If EnableMethodErrors is TRUE, the runtime exceptions will be generated. If FALSE, they will not be generated.

See Also

Topics

Working with Internet Functionality: Network Connections


EnableUseLEADRasterVariant Property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT_BOOL EnableUseLEADRasterVariant;
Overview | Refer to Implementing Internet Functionality.

Remarks

Indicates whether use Lead Raster Variant or not. Possible values are:

Setting | Description
VARIANT_TRUE | Use Lead Raster Variant
VARIANT_FALSE | Not use Lead Raster Variant


InetAccept event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetAccept (short iServer);
Overview | Refer to Implementing Internet Functionality.

Remarks

Occurs when there is a computer waiting to be connected to a local server.

This event is generated in response to a remote computer requesting a connection. To connect to a remote computer using the Internet Control, use the InetConnect method.

The InetAcceptConnect method should be called in response to this event in order to accept the connection.

To disconnect the computer after the connection has been accepted, use the InetDisconnect method.

See Also

Elements: | InetConnect method, InetAcceptConnect method, InetDisconnect method
Topics | Working with Internet Functionality: Network Connections


InetAcceptConnect method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetAcceptConnect (short iServer);
Overview | Refer to Implementing Internet Functionality.

Remarks

Accepts a requested connection from a remote computer, on the server specified by iServer.

This method should be called only in response to the InetAccept event.

Before connection events can be generated, the local computer must call InetServerInit to setup a port as a server.

After establishing a connection to a remote computer, you can then send data to the remote computer using the InetSendBitmap, InetSendDIB, InetSendSound and InetSendData methods. InetReceiveBitmap, InetReceiveData, InetReceiveSound and InetReceiveStart events indicate that data has been received from a remote computer.

The newly created connection is added to the end of the ConnectList property. ConnectList(ConnectListNum - 1) is the handle of the connection created if InetAcceptConnect is successful.

You can disconnect connected remote computers by using the InetDisconnect method.

Read the InetConnectedComputer property after calling this method to get the handle to the remote computer.

See Also

Elements: | InetServerInit method, InetConnect method, InetSendBitmap method, InetSendDIB method, InetSendData method, InetReceiveBitmap event, InetReceiveData event, InetReceiveStart event, InetError event, InetDisconnect method, InetConnectedComputer property
Topics | Working with Internet Functionality: Network Connections


InetClearQueue method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetClearQueue (short iComputer);
Overview | Refer to Implementing Internet Functionality.

Remarks

You can use this method to abort data transfers. This method 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 method you send data using InetSendData, InetSendBitmap, InetSendSound, or InetSendDIB methods, then the remote end will be able to detect that new data is being sent and it will abort the previous download.

See Also

Elements: | InetQueueSize property, InetSendBitmap method, InetSendDIB method, InetSendData method, InetSendSound method
Topics | Working with Internet Functionality: Sending and Receiving Data


InetConnect method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetConnect (BSTR pszComputer, short iPort);
Overview | Refer to Implementing Internet Functionality.

Remarks

Connects to a remote computer on the specified port.

This method will generate an InetAccept event on the host computer, if the server was initialized using the Internet Control.

After establishing a connection to a remote computer, you can then send data to the remote computer using the InetSendBitmap, InetSendDIB, InetSendSound, and InetSendData methods and receive data using the InetReceiveBitmap, InetReceiveData InetReceiveSound, and InetReceiveStart events.

To setup a computer as a server, you must call the InetServerInit method on the host computer.

You can disconnect from a host computer by using the InetDisconnect method.

See Also

Elements: | InetServerInit method, InetSendBitmap method, InetSendDIB method, InetSendData method, InetReceiveBitmap event, InetReceiveData event, InetReceiveStart event, InetAccept event, InetError event, InetDisconnect method, ConnectList property
Topics | Working with Internet Functionality: Network Connections


InetConnected event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetConnected (short iComputer);
Overview | Refer to Implementing Internet Functionality.

Remarks

Generated when the local computer is successfully connected to a remote computer.

A connection can be made in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

To disconnect from a remote computer, use the InetDisconnect method

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetDisconnected event, InetError event, InetDisconnect method, ConnectList property
Topics | Working with Internet Functionality: Network Connections


InetConnectedComputer property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetConnectedComputer
Overview | Refer to Implementing Internet Functionality.

Remarks

(Read only) Gets the handle to the remote computer.

See Also

Elements | InetServerInit method, InetConnect method, InetSendBitmap method, InetSendDIB method, InetSendData method, InetReceiveBitmap event, InetReceiveData event, InetReceiveStart event, InetError event, InetDisconnect method, InetAcceptConnect method
Topics | Working with Internet Functionality: Network Connections


InetDataSent event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetDataSent (short iComputer, long lSize);
Overview | Refer to Implementing Internet Functionality.

Remarks

This event is generated when all data for a specific object, such as a bitmap, has been sent to the remote computer that requested it.

It is possible for InetSendData, InetSendDib, InetSendSound method and InetSendBitmap to return before all data is actually sent to the remote computer. This event doesn't guarantee that the data got to the other end, it just indicates that all the data was sent. For example, if you call InetSendBitmap twice, you will get the InetDataSent event twice, once for each object (bitmap).

As data is being sent, the InetSending event will be generated.

See Also

Elements: | InetSendBitmap method, InetSendDIB method, InetSendData method, InetSendSound method, InetSending event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetDisconnect method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetDisconnect (short iComputer);
Overview | Refer to Implementing Internet Functionality.

Remarks

Closes an open network connection.

Use this method to disconnect from a remote computer.

See Also

Elements: | InetConnect method, ConnectList property
Topics | Working with Internet Functionality: Network Connections


InetDisconnected event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetDisconnected (short iComputer);
Overview | Refer to Implementing Internet Functionality.

Remarks

Generated when the local computer is disconnected from a remote computer.

To disconnect from a remote computer, use the InetDisconnect method.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetDisconnected event, InetError event, InetDisconnect method, ConnectList property
Topics | Working with Internet Functionality: Network Connections


InetError event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetError (short iComputer, short iMessage, short iError);
Overview | Refer to Implementing Internet Functionality.

Remarks

Generated when a network error has occurred.

Possible network errors are:

Setting | Description
ERROR_HOST_RESOLVE | 20270 can't resolve hostname
ERROR_CANT_INITIALIZE | 20271 can't initialize network
ERROR_NO_CONNECTION | 20272 no open network connections
ERROR_HOST_NOT_FOUND | 20273 hostname not found
ERROR_NOT_SERVER | 20274 computer is not a server
ERROR_NO_CONNECTIONS | 20275 no connection requests waiting
ERROR_CONNECT_REFUSED | 20276 connection was refused
ERROR_IS_CONNECTED | 20277 computer is connected
ERROR_NET_UNREACH | 20278 network is unreachable from host
ERROR_TIME_OUT | 20279 connect attempt time out without connecting
ERROR_NET_DOWN | 20280 network subsystem is down
ERROR_NO_BUFFERS | 20281 no buffer space is available, to many connections
ERROR_NO_FILE_DESCR | 20282 no more file handle available
ERROR_DATA_QUEUED | 20283 data has been queued to send later
ERROR_UNKNOWN | 20284 unknown network error has occurred
ERROR_CONNECT_RESET | 20285 connection was reset - socket might be unusable
ERROR_TRANSFER_ABORTED | 20286 transfer was aborted

For a complete list of error codes, refer to ErrorCodes .

See Also

Elements: | InetConnect method, InetAcceptConnect method, InetAccept event, InetDisconnect method, InetSendData method, InetSendBitmap method, InetSendDIB method, InetSendSound method
Topics | Working with Internet Functionality: Network Connections


InetGetData method (ILEADRasterInet)

Syntax | ILEADRasterVariant * InetGetData ();
Overview | Refer to Implementing Internet Functionality.

Remarks

Returns the user defined data sent through an Internet connection. This method should only be used with Delphi. Delphi doesn't handle the Variant parameters correctly for the InetReceiveData event. In order to get the data for the pData parameter, use this method.

See Also

Elements: | InetReceiveData event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetGetData2 method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | VARIANT InetGetData2 ()
Overview | Refer to Implementing Internet Functionality.

Remarks

Returns the user defined data sent through an Internet connection. This method should only be used with Delphi. Delphi doesn't handle the Variant parameters correctly for the InetReceiveData2 event. In order to get the data for the pData parameter, use this method.

See Also

Elements: | InetReceiveData2 event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetGetHostName method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetGetHostName (short iComputer, InetAddressType Type);
Overview | Refer to Implementing Internet Functionality.

Remarks

This method retrieves the host name of iComputer (the computer that is connected at the other end). If iComputer is invalid, this method will generate an error.

Read the InetHostName property after calling this method to get host name.

See Also

Elements: | InetConnect method, InetConnected event, InetHostName property
Topics | Working with Internet Functionality: Sending and Receiving Data


InetGetMagGlassData method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetGetMagGlassData (ILEADRaster *pRaster, ILEADRasterVariant *pvColorBuffer, ILEADRasterVariant *vMaskPlane, short nMaskPlaneStart, short nMaskPlaneEnd);
Overview | Refer to Implementing Internet Functionality.

Remarks

Gets the required bitmap pixel colors according to the pMaskPlane array. These colors are necessary for Magnifying Glass to paint the zoomed area.

See Also

Elements: | InetSendGetMagGlassDataCmd method, InetSendGetMagGlassDataRsp method
Topics | Working with Internet Functionality: Sending and Receiving Data


InetGetMagGlassData2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetGetMagGlassData2 (ILEADRaster *pRaster, VARIANT *pvColorBuffer, VARIANT vMaskPlane, short nMaskPlaneStart, short nMaskPlaneEnd);
Overview | Refer to Implementing Internet Functionality.

Remarks

Gets the required bitmap pixel colors according to the pMaskPlane array. These colors are necessary for Magnifying Glass to paint the zoomed area.

See Also

Elements: | InetSendGetMagGlassDataCmd2 method, InetSendGetMagGlassDataRsp2 method
Topics | Working with Internet Functionality: Sending and Receiving Data


InetHostName property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | BSTR InetHostName
Overview | Refer to Implementing Internet Functionality.

Remarks

(Read Only) Gets the host computer name.

See Also

Elements | InetConnect method, InetConnected event, InetGetHostName method
Topics | Working with Internet Functionality: Sending and Receiving Data


InetQueueSize property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | long InetQueueSize (short iComputer);
Overview | Refer to Implementing Internet Functionality.

Remarks

(Read Only) Returns the size of the internal queue used by the iComputer computer handle. If this property returns 0 for iComputer, then there is no data in the queue. If it returns a value between 1 and 0xFFFFFFFE, then it represents the number of bytes in the queue, not counting any LEADTOOLS headers. If this property return -1, then there is no data but the queue is not empty and consists only of LEADTOOLS' headers used for auto processing data sent and received over the connection.

Note:

Even if this property is 0, there is no guarantee that all bytes have been sent. A zero just means there is no data currently waiting to be sent.

See Also

Elements: | InetClearQueue method, InetSendBitmap method, InetSendDIB method, InetSendData method, InetSendSound method
Topics | Working with Internet Functionality: Sending and Receiving Data


InetReceiveBitmap event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetReceiveBitmap (short iComputer, long hBitmap);
Overview | Refer to Implementing Internet Functionality.

Remarks

Generated when an image file has been received over an open network connection.

This event is generated in response to a remote computer calling the InetSendBitmap or InetSendDib methods.

hBitmap should be copied to an ILEADRaster object to save the data. It will be freed after this event returns.

Before you can receive data from a remote computer, you must have an open connection.

You can open a connection in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

Events occur in this order:

- InetReceiveStart event is generated once.

- InetReceiveBitmap event is generated when the image is completely received.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetSendData method, InetReceiveData event, InetReceiveStart event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetReceiveCmd event (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | void InetReceiveCmd (short iComputer, InetCmdType Command, long nCommandID, short nError, ILEADRasterInetPacket Params, long nExtraDataSize, ILEADRasterVariant*ExtraData);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Occurs when a computer receives a command request from a remote computer.

See Also

Elements: | InetReceiveRsp event, InetSendCmd method, InetSendLoadCmd method, InetSendSaveCmd method, InetSendCreateWinCmd method, InetSendAttachBitmapCmd method, InetSendSizeWinCmd method, InetSendCloseWinCmd method, InetSendShowWinCmd method, InetSendSetRectCmd method, InetSendFreeBitmapCmd method,InetSendGetMagGlassDataCmd method, InetSendGetMagGlassDataRsp method
Topics: | Working with Internet Functionality: Command Messages


InetReceiveCmd2 event (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | void InetReceiveCmd2 (short iComputer, InetCmdType Command, long nCommandID, short nError, ILEADRasterInetPacket Params, long nExtraDataSize, VARIANT ExtraData);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Occurs when a computer receives a command request from a remote computer.

See Also

Elements: | InetReceiveRsp2 event, InetSendCmd2 method, InetSendLoadCmd method, InetSendSaveCmd method, InetSendCreateWinCmd method, InetSendAttachBitmapCmd method, InetSendSizeWinCmd method, InetSendCloseWinCmd method, InetSendShowWinCmd method, InetSendSetRectCmd method, InetSendFreeBitmapCmd method,InetSendGetMagGlassDataCmd2 method, InetSendGetMagGlassDataRsp2 method
Topics: | Working with Internet Functionality: Command Messages


InetReceiveData event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetReceiveData (short iComputer, ILEADRasterVariant*pData, long lSize, short iType);
Overview | Refer to Implementing Internet Functionality.

Remarks

Generated when data has been completely received over an open network connection.

This event is generated in response to a remote computer calling the InetSendData method.

This event occurs after the last chunk of data has been received and the InetReceiving event has been generated for the last chunk in the transfer.

Before you can receive data from a remote computer, you must have an open connection.

You can open a connection in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

Events occur in this order:

- the InetReceiveStart event is generated once.

- the InetReceiving event is generated once for each chunk of data.

- the InetReceiveData event is generated when the last chunk of data has been received.

Note:

For Delphi, you must use the InetGetData method instead of the pData parameter. This method is only valid during the InetReceiveData event.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetSendData method, InetReceiveBitmap event, InetReceiveStart event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetReceiveData2 event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetReceiveData2 (short iComputer, VARIANT pData, long lSize, short iType);
Overview | Refer to Implementing Internet Functionality.

Remarks

Generated when data has been completely received over an open network connection.

This event is generated in response to a remote computer calling the InetSendData2 method.

This event occurs after the last chunk of data has been received and the InetReceiving event has been generated for the last chunk in the transfer.

Before you can receive data from a remote computer, you must have an open connection.

You can open a connection in two ways:

1 | Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.
2 | Connect to an existing server using the InetConnect method.

Events occur in this order:

- the InetReceiveStart event is generated once.

- the InetReceiving event is generated once for each chunk of data.

- the InetReceiveData2 event is generated when the last chunk of data has been received.

Note:

For Delphi, you must use the InetGetData method instead of the pData parameter. This method is only valid during the InetReceiveData2 event.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetSendData2 method, InetReceiveBitmap event, InetReceiveStart event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetReceiveRsp event (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | void InetReceiveRsp (short iComputer, InetCmdType Command, long nCommandID, short nError, short nStatus, ILEADRasterInetPacket Params, long nExtraDataSize, ILEADRasterVariant* ExtraData);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Occurs when a computer receives a response from a remote computer.

Note:

The parameters (Params) and the extra data (ExtraData) 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 ExtraData are only valid during this call. Do not free this data and don’t try to keep references to the strings. If the data is needed outside this event, allocate buffers and copy the data into them.

See Also

Elements: | InetReceiveCmd event, InetSendRsp method, InetSendLoadRsp method, InetSendSaveRsp method, InetSendCreateWinRsp method, InetSendAttachBitmapRsp method, InetSendSizeWinRsp method, InetSendCloseWinRsp method, InetSendShowWinRsp method, InetSendSetRectRsp method, InetSendFreeBitmapRsp method, InetSendGetMagGlassDataCmd method, InetSendGetMagGlassDataRsp method
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetReceiveRsp2 event (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | void InetReceiveRsp2 (short iComputer, InetCmdType Command, long nCommandID, short nError, short nStatus, ILEADRasterInetPacket Params, long nExtraDataSize, VARIANT ExtraData);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Occurs when a computer receives a response from a remote computer.

Note:

The parameters (Params) and the extra data (ExtraData) 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 ExtraData are only valid during this call. Do not free this data and don’t try to keep references to the strings. If the data is needed outside this event, allocate buffers and copy the data into them.

See Also

Elements: | InetReceiveCmd2 event, InetSendRsp2 method, InetSendLoadRsp2 method, InetSendSaveRsp2 method, InetSendCreateWinRsp2 method, InetSendAttachBitmapRsp2 method, InetSendSizeWinRsp2 method, InetSendCloseWinRsp2 method, InetSendShowWinRsp2 method, InetSendSetRectRsp2 method, InetSendFreeBitmapRsp2 method, InetSendGetMagGlassDataCmd2 method, InetSendGetMagGlassDataRsp2 method
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetReceiveSound event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetReceiveSound (short iComputer, short iFormatTag, short iChannels, long lSamplesPerSec, long lAvgBytesPerSec, short iBlockAlign, short iBitsPerSample, short iExtraDataSize, ILEADRasterVariant*pExtraData, ILEADRasterVariant*pData, long lDataSize);
Overview | Refer to Implementing Internet Functionality.

Remarks

This event is triggered when wave data is received by iComputer. It is generated in response to a remote computer calling the InetSendSound method. The following parameters can be used to update the sound format:

iFormatTag, iChannels, lSamplesPerSec, AvgBytesPerSec, iBlockAlign, iBitsPerSample, iExtraDataSize, pExtraData. pData is the actual sound data that is received. Sound data can be sent to a remote computer by using the InetSendSound method.

Events occur in this order:

- InetReceiveStart is generated once.

- InetReceiveSound is generated when sound is completely received.

See Also

Elements: | InetSendSound method, InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetReceiveStart event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetReceiveSound2 event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetReceiveSound2 (short iComputer, short iFormatTag, short iChannels, long lSamplesPerSec, long lAvgBytesPerSec, short iBlockAlign, short iBitsPerSample, short iExtraDataSize, VARIANT pExtraData, VARIANT pData, long lDataSize);
Overview | Refer to Implementing Internet Functionality.

Remarks

This event is triggered when wave data is received by iComputer. It is generated in response to a remote computer calling the InetSendSound2 method. The following parameters can be used to update the sound format:

iFormatTag, iChannels, lSamplesPerSec, AvgBytesPerSec, iBlockAlign, iBitsPerSample, iExtraDataSize, pExtraData. pData is the actual sound data that is received. Sound data can be sent to a remote computer by using the InetSendSound2 method.

Events occur in this order:

- InetReceiveStart is generated once.

- InetReceiveSound2 is generated when sound is completely received.

See Also

Elements: | InetSendSound2 method, InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetReceiveStart event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetReceiveStart event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetReceiveStart (short iComputer, long lSize);
Overview | Refer to Implementing Internet Functionality.

Remarks

Generated when a computer is about to start receiving data from a remote computer.

This event is generated in response to a remote computer calling the InetSendData, InetSendBitmap, InetSendSound or InetSendDIB methods.

The data will be received in the InetReceiveData event.

Before you can receive data from a remote computer, you must have an open connection.

You can open a connection in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

Events occur in this order:

- InetReceiveStart is generated once.

- InetReceiving is generated for each chunk, if InetSendData was used by the remote computer.

- InetReceiveBitmap, InetReceiveSound, or InetReceiveData is generated when all data has been received.

If an error occurs during downloading, an InetError event is generated.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetSendData method, InetSendSound method, InetReceiveData event, InetReceiveBitmap event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetReceiving event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetReceiving (short iComputer, long lSize);
Overview | Refer to Implementing Internet Functionality.

Remarks

Generated when a computer is receiving data from a remote computer. This event is generated for each chunk of data received. It is generated after the InetReceiveStart event.

This event is generated in response to a remote computer calling the InetSendData method.

The data will be received in the InetReceiveData event.

Before you can receive data from a remote computer, you must have an open connection.

You can open a connection in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetSendData method, InetReceiveData event, InetReceiveBitmap event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetSendAttachBitmapCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendAttachBitmapCmd (long nCommandID, long nBitmapID, long nWindowID);
Overview | Refer to Sending Commands and Responses

Remarks

Sends an attach bitmap command to a remote computer.

The remote computer should respond by calling the InetSendAttachBitmapRsp method in its InetReceiveCmd event.

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 the InetSendSetRectCmd method.

The InetReceiveCmd event will receive the nBitmapID and nWindowID information in the Params parameter. The nBitmapID information will be in Params.ParamValue(0) and the nWindowID information will be in Params.ParamValue(1).

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

See Also

Elements: | InetSendAttachBitmapRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendAttachBitmapRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendAttachBitmapRsp (long nCommandID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

Sends an attach bitmap response to a remote computer.

This method sends a response to an attach bitmap command that was sent from a remote computer using the InetSendAttachBitmapCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendAttachBitmapCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendAttachBitmapRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendAttachBitmapRsp2 (long nCommandID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

Sends an attach bitmap response to a remote computer.

This method sends a response to an attach bitmap command that was sent from a remote computer using the InetSendAttachBitmapCmd method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendAttachBitmapCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendBitmap method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetSendBitmap (ILEADRaster *pRaster, RasterFileConstants Format, short iBitsPerPixel, QFactorConstants Quality);
Overview | Refer to Implementing Internet Functionality.

Remarks

Sends a bitmap to all the remote computers in the SendList and generates an InetReceiveBitmap event on the remote computer(s).

The bitmap is first saved as a file in memory in the format specified by iFormat. If you require additional options when saving a file (such as Progressive JPEG, Interlaced GIF, etc.) then you should use the SaveMemory method in the Main Control. You can then send the image using InetSendData, with iType set to IDATA_IMAGE.

This means you can send files in any of the supported compressed or uncompressed formats.

Before you can send data to a remote computer, you must have an open connection.

You can open a connection in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendDIB method, InetSendData method, InetReceiveBitmap event, InetReceiveData event, InetReceiveStart event, InetError event, SendList property, InetSendSound method, InetReceiveSound event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetSendCloseWinCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendCloseWinCmd (long nCommandID, long nWindowID);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a close window command to a remote computer.

The remote computer should respond by calling the InetSendCloseWinRsp method in its InetReceiveCmd event.

The InetReceiveCmd event will receive the nWindowID information in the Params parameter. The nWindowID information will be in Params.ParamValue(0).

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

See Also

Elements: | InetSendCloseWinRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendCloseWinRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendCloseWinRsp (long nCommandID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a close window response to a remote computer.

This method sends a response to a command that was sent from a remote computer using the InetSendCloseWinCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendCloseWinCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendCloseWinRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendCloseWinRsp2 (long nCommandID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a close window response to a remote computer.

This method sends a response to a command that was sent from a remote computer using the InetSendCloseWinCmd method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendCloseWinCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendCmd (InetCmdType Command, long nCommandID, ILEADRasterInetPacket Params, long nExtraDataSize, ILEADRasterVariant * ExtraData);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a command to a remote computer.

The remote computer should respond by calling the InetSendRsp method in its InetReceiveCmd event.

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 the InetSendLoadCmd method will send the bitmap ID while responses to the InetSendCreateWinCmd method will send the window identifier (which can be used to resize or close the window).

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

See Also

Elements: | InetSendRsp method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendCmd2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendCmd2 (InetCmdType Command, long nCommandID, ILEADRasterInetPacket Params, long nExtraDataSize, VARIANT ExtraData);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a command to a remote computer.

The remote computer should respond by calling the InetSendRsp2 method in its InetReceiveCmd2 event.

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 the InetSendLoadCmd method will send the bitmap ID while responses to the InetSendCreateWinCmd method will send the window identifier (which can be used to resize or close the window).

When a response is received from a remote computer, the InetReceiveRsp2 event is triggered.

See Also

Elements: | InetSendRsp2 method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendCreateWinCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendCreateWinCmd (long nCommandID, BSTR pszClassName, BSTR pszWindowName, long ulFlags, long nLeft, long nTop, long nWidth, long nHeight, long nParentID);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a create win command to a remote computer.

The remote computer should respond by calling the InetSendCreateWinRsp method in its InetReceiveCmd event.

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.

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

The InetReceiveCmd event will receive the pszClassName, pszWindowName, ulFlags, nLeft, nTop, nWidth, nHeight and nParentID information in the Params parameter. The pszClassName information will be in Params.ParamValue(0). The pszWindowName information will be in Params.ParamValue(1), the ulFlags information will be in Params.ParamValue(2), and so forth.

See Also

Elements: | InetSendCreateWinRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendCreateWinRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendCreateWinRsp (long nCommandID, long nWindowID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a create window response to a remote computer.

This method sends a response to a create window command that was sent from a remote computer using the InetSendCreateWinCmd method.

When a command request is received from a remote computer, the InetReceiveCmdevent evet is triggered.

The InetReceiveRsp event will receive the nWindowID information in the Params parameter. The nWindowID information will be in Params.ParamValue(0).

See Also

Elements: | InetSendCreateWinCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendCreateWinRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendCreateWinRsp2 (long nCommandID, long nWindowID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a create window response to a remote computer.

This method sends a response to a create window command that was sent from a remote computer using the InetSendCreateWinCmd method.

When a command request is received from a remote computer, the InetReceiveCmd2 event evet is triggered.

The InetReceiveRsp2 event will receive the nWindowID information in the Params parameter. The nWindowID information will be in Params.ParamValue(0).

See Also

Elements: | InetSendCreateWinCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendData method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetSendData (ILEADRasterVariant * pData, long lSize, short iType);
Overview | Refer to Implementing Internet Functionality.

Remarks

Sends the specified number of bytes to all the remote computers in the SendList and generates an InetReceiveData event on the remote computer(s).

Fill pData with the data you wish to send before calling this method. The data should be specified in a byte array.

Before you can send data to a remote computer, you must have an open connection.

You can open a connection in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetReceiveBitmap event, InetReceiveData event, InetReceiveStart event, InetError event, SendList property, InetSendSound method, InetReceiveSound event, InetReceiving event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetSendData2 method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetSendData2 (VARIANT *pData, long lSize, short iType);
Overview | Refer to Implementing Internet Functionality.

Remarks

Sends the specified number of bytes to all the remote computers in the SendList and generates an InetReceiveData2 event on the remote computer(s).

Fill pData with the data you wish to send before calling this method. The data should be specified in a byte array.

Before you can send data to a remote computer, you must have an open connection.

You can open a connection in two ways:

1 | Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.
2 | Connect to an existing server using the InetConnect method.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetReceiveBitmap event, InetReceiveData2 event, InetReceiveStart event, InetError event, SendList property, InetSendSound2 method, InetReceiveSound2 event, InetReceiving event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetSendDIB method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetSendDIB (long hDib, RasterFileConstants Format, short iBitsPerPixel, QFactorConstants Quality);
Overview | Refer to Implementing Internet Functionality.

Remarks

Sends a Windows device independent bitmap (DIB) to all the remote computers in the SendList and generates an InetReceiveBitmap event on the remote computer(s).

The DIB is first saved as a file in memory in the format specified by iFormat.

This means you can send files in any of the supported compressed or uncompressed formats.

Before you can send data to a remote computer, you must have an open connection.

You can open a connection in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

See Also

Elements: | InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendData method, InetReceiveBitmap event, InetReceiveData event, InetReceiveStart event, InetError event, SendList property, InetSendSound method, InetReceiveSound event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetSendFreeBitmapCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendFreeBitmapCmd (long nCommandID, long nBitmapID);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a free bitmap command to a remote computer.

The remote computer should free the bitmap associated with nBitmapID and respond by calling the InetSendFreeBitmapRsp method in its InetReceiveCmd event.

The InetReceiveCmd event will receive the nBitmapID information in the Params parameter. The nBitmapID information will be in Params.ParamValue(0).

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

See Also

Elements: | InetSendFreeBitmapRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendFreeBitmapRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendFreeBitmapRsp (long nCommandID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a free bitmap response to a remote computer.

This method sends a response to a free bitmap command that was sent from a remote computer using the InetSendFreeBitmapCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendFreeBitmapCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendFreeBitmapRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendFreeBitmapRsp2 (long nCommandID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a free bitmap response to a remote computer.

This method sends a response to a free bitmap command that was sent from a remote computer using the InetSendFreeBitmapCmd method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendFreeBitmapCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendGetMagGlassDataCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendGetMagGlassDataCmd (long nCommandID, long nBitmapID, ILEADRasterVariant * vMaskPlane, short nMaskPlaneStart, short nMaskPlaneEnd);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a get Magnifying Glass data command to a remote computer.

The remote computer should call InetGetMagGlassData method to get the needed data from the bitmap associated with nBitmapID and respond by calling the InetSendGetMagGlassDataRsp method in its InetReceiveCmd event.

The InetReceiveCmd event will receive the nBitmapID, vMaskPlane, nMaskPlaneStart and nMaskPlaneEnd information in the Params parameter. The nBitmapID information will be in Params.ParamValue(0). The vMaskPlane information will be in Params.ParamValue(1), and so forth.

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

See Also

Elements: | InetSendGetMagGlassDataRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendGetMagGlassDataCmd2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendGetMagGlassDataCmd2 (long nCommandID, long nBitmapID, VARIANT vMaskPlane, short nMaskPlaneStart, short nMaskPlaneEnd);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a get Magnifying Glass data command to a remote computer.

The remote computer should call InetGetMagGlassData2 method to get the needed data from the bitmap associated with nBitmapID and respond by calling the InetSendGetMagGlassDataRsp2 method in its InetReceiveCmd2 event.

The InetReceiveCmd2 event will receive the nBitmapID, vMaskPlane, nMaskPlaneStart and nMaskPlaneEnd information in the Params parameter. The nBitmapID information will be in Params.ParamValue(0). The vMaskPlane information will be in Params.ParamValue(1), and so forth.

When a response is received from a remote computer, the InetReceiveRsp2 event is triggered.

See Also

Elements: | InetSendGetMagGlassDataRsp2 method, InetReceiveRsp2 event, InetReceiveCmd2 event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendGetMagGlassDataRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendGetMagGlassDataRsp (long nCommandID, ILEADRasterVariant * vColorBuffer, ILEADRasterVariant * vMaskPlane, short nMaskPlaneStart, short nMaskPlaneEnd, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a get Magnifying Glass data response to a remote computer.

This method sends a response to a get Magnifying Glass data command that was sent from a remote computer using the InetSendGetMagGlassDataCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendGetMagGlassDataCmd method, InetGetMagGlassData method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendGetMagGlassDataRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendGetMagGlassDataRsp2 (long nCommandID, VARIANT vColorBuffer, VARIANT vMaskPlane, short nMaskPlaneStart, short nMaskPlaneEnd, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a get Magnifying Glass data response to a remote computer.

This method sends a response to a get Magnifying Glass data command that was sent from a remote computer using the InetSendGetMagGlassDataCmd2 method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendGetMagGlassDataCmd2 method, InetGetMagGlassData2 method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSending event (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | void InetSending (short iComputer, long lSize);
Overview | Refer to Implementing Internet Functionality.

Remarks

This event is generated as data is moved out of an internal queue and sent to iComputer.

It is possible for InetSendData, InetSendDIB, InetSendSound and InetSendBitmap to return before all data is actually sent to the remote computer. Any data that isn't immediately sent, will be queued to send later. This event informs you when data is taken from the queue and sent to the remote computer.

When all data has been sent, the InetDataSent event will be generated.

See Also

Elements: | InetSendBitmap method, InetSendDIB method, InetSendData method, InetSendSound method, InetDataSent event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetSendLoadCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendLoadCmd (long nCommandID, BSTR pszFile, short nBitsPerPixel, short nOrder);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a load command to a remote computer.

The remote computer should respond by calling the InetSendLoadRsp method in its InetReceiveCmd event.

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 the InetSendAttachBitmapCmd method). The bitmap identifier will be sent in the response.

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

The InetReceiveCmd event will receive the pszFile, nBitsPerPixel and nOrder information in the Params parameter. The pszFile information will be in Params.ParamValue(0). The nBitsPerPixel information will be in Params.ParamValue(1), and so forth.

See Also

Elements: | InetSendLoadRsp method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendLoadRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendLoadRsp (long nCommandID, long nBitmapID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a load response to a remote computer.

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

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

The InetReceiveRsp event will receive the nBitmapID information in the Params parameter. The nBitmapID information will be in Params.ParamValue(0).

See Also

Elements: | InetSendLoadCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendLoadRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendLoadRsp2 (long nCommandID, long nBitmapID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a load response to a remote computer.

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

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

The InetReceiveRsp2 event will receive the nBitmapID information in the Params parameter. The nBitmapID information will be in Params.ParamValue(0).

See Also

Elements: | InetSendLoadCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendRsp (InetCmdType Command, long nCommandID, ILEADRasterInetPacket Params, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a response to a remote computer.

This method sends a response to a command that was sent from a remote computer using the InetSendCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendRsp2 (InetCmdType Command, long nCommandID, ILEADRasterInetPacket Params, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a response to a remote computer.

This method sends a response to a command that was sent from a remote computer using the InetSendCmd2 method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendCmd2 method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSaveCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSaveCmd (long nCommandID, long nBitmapID, BSTR pszFile, short nFormat, short nBitsPerPixel, short nQFactor, VARIANT_BOOL bSaveMulti);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a save command to a remote computer.

The remote computer should respond by calling the InetSendSaveRsp method in its InetReceiveCmd event.

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

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

The InetReceiveCmd event will receive the nBitmapID, pszFile, nFormat, nBitsPerPixel, nQFactor and bSaveMulti information in the Params parameter. The nBitmapID information will be in Params.ParamValue(0). The pszFile information will be in Params.ParamValue(1), the nFormat information will be in Params.ParamValue(2), and so forth.

See Also

Elements: | InetSendSaveRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSaveRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSaveRsp (long nCommandID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a save response to a remote computer.

This method sends a response to a save command that was sent from a remote computer using the InetSendSaveCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendSaveCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSaveRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSaveRsp2 (long nCommandID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a save response to a remote computer.

This method sends a response to a save command that was sent from a remote computer using the InetSendSaveCmd method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendSaveCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSetRectCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSetRectCmd (long nCommandID, long nWindowID, DisplayRectType RectType, long nLeft, long nTop, long nWidth, long nHeight);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a set rectangle command to a remote computer.

The remote computer should respond by calling the InetSendSetRectRsp method in its InetReceiveCmd event.

The InetReceiveCmd event will receive the nWindowID, RectType, nLeft, nTop, nWidth and nHeight information in the Params parameter. The nWindowID information will be in Params.ParamValue(0). The DisplayRectType information will be in Params.ParamValue(1), and so forth.

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

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

See Also

Elements: | InetSendSetRectRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSetRectRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSetRectRsp (long nCommandID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a set rectangle response to a remote computer.

This method sends a response to a set rectangle command that was sent from a remote computer using the InetSendSetRectCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendSetRectCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSetRectRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSetRectRsp2 (long nCommandID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a set rectangle response to a remote computer.

This method sends a response to a set rectangle command that was sent from a remote computer using the InetSendSetRectCmd method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendSetRectCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendShowWinCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendShowWinCmd (long nCommandID, long nWindowID, long nCmdShow);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a show window command to a remote computer.

The remote computer should respond by calling the InetSendShowWinRsp method in its InetReceiveCmd event.

The InetReceiveCmd event will receive the nWindowID and the nCmdShow information in the Params parameter. The nWindowID information will be in Params.ParamValue(0) and the nCmdShow information will be in Params.ParamValue(1).

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

See Also

Elements: | InetSendShowWinRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendShowWinRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendShowWinRsp (long nCommandID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a show window response to a remote computer.

This method sends a response to a show window command that was sent from a remote computer using the InetSendShowWinCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendShowWinCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendShowWinRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendShowWinRsp2 (long nCommandID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a show window response to a remote computer.

This method sends a response to a show window command that was sent from a remote computer using the InetSendShowWinCmd method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendShowWinCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSizeWinCmd method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSizeWinCmd (long nCommandID, long nWindowID, long nLeft, long nTop, long nWidth, long nHeight);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a size window command to a remote computer.

The remote computer should respond by calling the InetSendSizeWinRsp method in its InetReceiveCmd event.

With this command, the local computer will signal the remote computer to size a window using the specified parameters.

When a response is received from a remote computer, the InetReceiveRsp event is triggered.

The InetReceiveCmd event will receive the nWindowID, nLeft, nTop, nWidth and nHeight information in the Params parameter. The nWindowID information will be in Params.ParamValue(0). The nLeft information will be in Params.ParamValue(1), and so forth.

See Also

Elements: | InetSendSizeWinRsp method, InetReceiveRsp event, InetReceiveCmd event
Topics: | Working with Internet Functionality: Command Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSizeWinRsp method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSizeWinRsp (long nCommandID, long nExtraDataSize, ILEADRasterVariant * ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses

Remarks

(Internet only) Sends a size window response to a remote computer.

This method sends a response to a size window command that was sent from a remote computer using the InetSendSizeWinCmd method.

When a command request is received from a remote computer, the InetReceiveCmd event is triggered.

See Also

Elements: | InetSendSizeWinCmd method, InetReceiveCmd event, InetReceiveRsp event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSizeWinRsp2 method (ILEADRasterInet)

Visual Basic Example

Visual C++ 5.0 Example

Syntax | short InetSendSizeWinRsp2 (long nCommandID, long nExtraDataSize, VARIANT ExtraData, short nStatus);
Overview | Refer to Sending Commands and Responses.

Remarks

(Internet only) Sends a size window response to a remote computer.

This method sends a response to a size window command that was sent from a remote computer using the InetSendSizeWinCmd method.

When a command request is received from a remote computer, the InetReceiveCmd2 event is triggered.

See Also

Elements: | InetSendSizeWinCmd method, InetReceiveCmd2 event, InetReceiveRsp2 event
Topics: | Working with Internet Functionality: Response Messages
 | Client-Server Diagram: Sending Commands and Responses


InetSendSound method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetSendSound (short iFormatTag, short iChannels, long lSamplesPerSec, long lAvgBytesPerSec, short iBlockAlign, short iBitsPerSample, short iExtraDataSize, ILEADRasterVariant * pExtraData, ILEADRasterVariant * pData, long lDataSize);
Overview | Refer to Implementing Internet Functionality.

Remarks

Sends wave sound data to all the remote computers in the SendList property.

This generates an InetReceiveSound event on the remote computer(s).

Before you can send data to a remote computer, you must have an open connection.

You can open a connection in two ways:

1) Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.

2) Connect to an existing server using the InetConnect method.

See Also

Elements: | SendList property, InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetSendData, InetReceiveBitmap event, InetReceiveData event, InetReceiveStart event, InetReceiveSound event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetSendSound2 method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetSendSound2 (short iFormatTag, short iChannels, long lSamplesPerSec, long lAvgBytesPerSec, short iBlockAlign, short iBitsPerSample, short iExtraDataSize, VARIANT pExtraData, VARIANT pData, long lDataSize);
Overview | Refer to Implementing Internet Functionality.

Remarks

Sends wave sound data to all the remote computers in the SendList property.

This generates an InetReceiveSound2 event on the remote computer(s).

Before you can send data to a remote computer, you must have an open connection.

You can open a connection in two ways:

1 | Setup the local computer as a server and listen for connections using the InetServerInit method. When connection requests are received, open the connection using the InetAcceptConnect method.
2 | Connect to an existing server using the InetConnect method.

See Also

Elements: | SendList property, InetServerInit method, InetConnect method, InetAcceptConnect method, InetAccept event, InetSendBitmap method, InetSendDIB method, InetSendData2, InetReceiveBitmap event, InetReceiveData2 event, InetReceiveStart event, InetReceiveSound2 event, InetError event
Topics | Working with Internet Functionality: Sending and Receiving Data


InetServerClose method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetServerClose (short iServer);
Overview | Refer to Implementing Internet Functionality.

Remarks

Shutdowns the server on the local computer.

Call this method to shutdown a server that was started using the InetServerInit method.

Once this method is completed, remote computers will not be able to connect until InetServerInit has been called to restart the server.

This method does not close any open connections. It only stops any new connection request from being accepted. To close open connections, you must use the InetDisconnect method.

See Also

Elements: | InetServerInit method, InetConnect method, InetError event, InetDisconnect method
Topics | Working with Internet Functionality: Network Connections


InetServerHandle property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetServerHandle
Overview | Refer to Implementing Internet Functionality.

Remarks

(Read Only) Gets the handle of the initialized server.

See Also

Elements | InetConnect method, InetServerClose method, InetAccept event, InetAcceptConnect method, InetError event, InetDisconnect method, InetServerInit method
Topics | Working with Internet Functionality: Network Connections


InetServerInit method (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short InetServerInit (short iPort);
Overview | Refer to Implementing Internet Functionality.

Remarks

Initializes the computer as a server.

This will allow other computers to connect to the server and transfer data.

Calling this method sets up iPort to listen for connection requests from remote computers.

Connection requests will be received in the InetAccept event, and can be accepted using the InetAcceptConnect method.

The InetServerInit method must be called by the host computer before other computers can connect using the InetConnect method.

To shut down the server, call the InetServerClose method.

Note:

The ConnectList property contains handles to all computers that are connected, regardless of the server which accepted the connection. If you wish to keep up with connections on a per server basis, you should use one control per server.

Call InetServerHandle property after this method to get the handle of the initialized server.

See Also

Elements: | InetConnect method, InetServerClose method, InetAccept event, InetAcceptConnect method, InetError event, InetDisconnect method, InetServerHandle property
Topics | Working with Internet Functionality: Network Connections


SendList property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SendList (short iIndex)
Overview | Refer to Implementing Internet Functionality.

Remarks

An array of computer handles to which data will be sent.

Use this property to create a list of remote computers to which you wish to send data using the InetSendData, InetSendBitmap, InetSendSound or InetSendDIB methods.

To remove a computer from the list, set the value of the desired index to 0. This will update the list and the SendListNum property.

When connections are removed from the ConnectList property in response to a call to InetDisconnected event, the corresponding computer handle is automatically removed from the SendList array.

See Also

Elements: | SendListNum property, InetSendData method, InetSendBitmap method, InetSendDIB method, InetSendSound method, InetSendSound method, ConnectList property
Topics | Working with Internet Functionality: Sending and Receiving Data


SendListNum property (ILEADRasterInet)

Visual Basic example

Visual C++ 5.0 example

Syntax | short SendListNum
Overview | Refer to Implementing Internet Functionality.

Remarks

(Read Only) Gets the number of items in the SendList array.

See Also

Elements: | SendList property, InetSendData method, InetSendBitmap method, InetSendDIB method
Topics | Working with Internet Functionality: Sending and Receiving Data


Raster Pro/Document/Medical Features

Raster Pro:

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

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

Document/Medical:

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

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

LEADTOOLS Document Imaging

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

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

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

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

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

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

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

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

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

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

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

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

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

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

LEADTOOLS Document Imaging Suite

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

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

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

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

LEADTOOLS Medical Imaging

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

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

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

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

LEADTOOLS Medical Imaging Suite

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

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

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

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

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


Document/Medical Support and Licensing Requirements

Document/Medical Licensing and Royalty Agreements:

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

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

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

Duplication and Distribution Agreements

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


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.


Syntax

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

Visual Basic Syntax

Visual C++ 5.0 Syntax


Visual Basic Constants for Key Codes

Do the following to find the Visual Basic key codes:

1. | On the View pull-down menu, select Object Browser....
2. | Select VB - Visual Basic objects and procedures.
3. | Select VBKeyCodeConstants.
4. | Select one of the listed constants.

A description of the constant appears at the bottom of the form.


Visual Basic Syntax

The syntax for the object's properties, methods, and events is the same as for other objects/controls in Visual Basic.

Whenever you declare a variable as a data type, you need to know how the ActiveX data type is expressed in Visual Basic. Refer to the following table for the appropriate data type:

ActiveX Data Type | Visual Basic Data Type
boolean | Boolean
BSTR | String
IPictureDisp | Picture
long | Long
OLE_HANDLE | Integer on a 16-bit system; Long on a 32-bit system
OLE_COLOR | Long color value (such as the RGB return value)
OLE_XPOS_PIXELS | Long
OLE_YPOS_PIXELS | Long
short | Integer
float | Single


Visual C++ 5.0 Syntax

In Version 5.0 of Visual C++, the Microsoft Foundation Class (MFC) library provides an ActiveX interface. This topic describes how to use the interface with the LEADTOOLS COM Objects.

To create an instance of the object at run time, use the CreateInstanceLic function:

ILEADRasterInet *pRasterInet;

//Create the RasterInet object
HRESULT hr;
CLSID clsid;

*pRet = NULL;

hr = CLSIDFromProgID("LEADInet.LEADInet.120", &clsid);
if(!FAILED(hr))
{
IClassFactory2 *pCF2=NULL;
hr = CoGetClassObject(clsid, CLSCTX_ALL, NULL, IID_IClassFactory2, (void**)&pCF2);
if(pCF2)
{
//ILEADRasterInet is licensed, so we need to pass a license key
hr = pCF2->CreateInstanceLic(NULL, NULL, IID_ILEADRasterInet, pszLic,
 (void**)pRasterInet);
pCF2->Release();
}
}

pszLic

Use the LEADTOOLS license string, which is always the first line in the LTOCX14.LIC file. For example: "LEADTOOLS OCX Copyright (c) 1991-2003 LEAD Technologies, Inc." If you do not specify this string correctly, the object will not be created.

To set a property value, the syntax is as follows:

m_controlname.Setpropertyname(value);

For example:

m_Lead1.SetRubberBandVisible(FALSE);

To get a property value, the syntax is as follows:

value = m_controlname.Getpropertyname();

For example:

HeightFactor = m_Lead1.GetBitmapHeight();

To set a property array value, the syntax is as follows:

m_controlname.Setpropertyname(index, value);

For example:

m_Lead1.SetRemapTable(MyIndex, (255 * Offset) / CurrentRange);

To get a property array value, the syntax is as follows:

value = m_controlname.Getpropertyname(index);

For example:

m_Lead1.SetBitmap(m_Lead1.GetColorPlanes(3)); // Copy the K plane


Visual C++ Key Codes

The following are the Visual C++ key codes:

VK_A through VK_Z are the same as their ASCII equivalents: 'A' thru 'Z'.
VK_0 through VK_9 are the same as their ASCII equivalents: '0' thru '9'.
VK_LBUTTON
VK_RBUTTON
VK_CANCEL
VK_MBUTTON
VK_BACK
VK_TAB
VK_CLEAR
VK_RETURN
VK_SHIFT
VK_CONTROL
VK_MENU
VK_PAUSE
VK_CAPITAL
VK_ESCAPE
VK_SPACE
VK_PRIOR
VK_NEXT
VK_END
VK_HOME
VK_LEFT
VK_UP
VK_RIGHT
VK_DOWN
VK_SELECT
VK_PRINT
VK_EXECUTE
VK_SNAPSHOT
VK_INSERT
VK_DELETE
VK_HELP

VK_NUMPAD0
VK_NUMPAD1
VK_NUMPAD2
VK_NUMPAD3
VK_NUMPAD4
VK_NUMPAD5
VK_NUMPAD6
VK_NUMPAD7
VK_NUMPAD8
VK_NUMPAD9
VK_MULTIPLY
VK_ADD
VK_SEPARATOR
VK_SUBTRACT
VK_DECIMAL
VK_DIVIDE
VK_F1
VK_F2
VK_F3
VK_F4
VK_F5
VK_F6
VK_F7
VK_F8
VK_F9
VK_F10
VK_F11
VK_F12
VK_F13
VK_F14
VK_F15
VK_F16
VK_F17
VK_F18
VK_F19
VK_F20
VK_F21
VK_F22
VK_F23
VK_F24
VK_NUMLOCK
VK_SCROLL


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.


iIndex Parameter For ConnectList

iIndex

Index into the array.


iServer Parameter For InetAcceptConnect

iServer

handle to the server on which to accept the connection.


Return for InetAcceptConnect

Return Value

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


iServer Parameter For InetAccept

iServer

Handle to the server that is receiving the connect request


iComputer Parameter For InetClearQueue

iComputer

handle to a remote computer


Return for InetClearQueue

Return Value

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


iComputer Parameter For InetConnected

iComputer

handle to the remote computer that has just been connected


iPort Parameter For InetConnect

iPort

the number of the port on the remote computer that is set up as a server. Possible values are:

Value | Meaning
0x015 | FTP
0x050 | Web server
0x077 | News
0x019 | Mail
0x017 | Telnet


pszComputer Parameter For InetConnect

pszComputer

Character string containing the name of the remote computer to which you wish to connect. This may be a URL like www.leadtools.com or an IP address.


Return for InetConnect

Return Value

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


iComputer Parameter For InetDataSent

iComputer

handle to the computer that received the data.


lSize Parameter For InetDataSent

lSize

the total amount of data that was sent to the remote computer.


iComputer Parameter For InetDisconnected

iComputer

handle to the remote computer that has just been disconnected


iComputer Parameter For InetDisconnect

iComputer

handle to the connected computer


Return for InetDisconnect

Return Value

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


iComputer Parameter For InetError

iComputer

handle to computer that received the error


iError Parameter For InetError

iError

Error code received


iMessage Parameter For InetError

iMessage

iMessage is one of the following:

Setting | Description
INET_CONNECT | [0x0000] error occurred connecting to remote computer
INET_DATA_READY | [0x0001] internal error - call tech support
INET_CLOSE | [0x0002] error occurred closing a connection
INET_CONNECT_REQUEST | [0x0003] error occurred while requesting to connect
INET_DATA_SENT | [0x0004] error occurred at the end of the send
INET_DATA_SENDING | [0x0005] error occurred while sending data
INET_DATA_START | [0x0006] error occurred starting to receive data
INET_DATA_RECEIVING | [0x0007] error occurred receiving data of unknown type
INET_IMAGE_RECEIVED | [0x0008] error occurred receiving an image
INET_MMEDIA_RECEIVED | [0x0009] error occurred receiving a multimedia object
INET_SOUND_RECEIVED | [0x000A] error occurred receiving sound data
INET_USER1_RECEIVED | [0x000B] error occurred receiving user data 1
INET_USER2_RECEIVED | [0x000C] error occurred receiving user data 2
INET_USER3_RECEIVED | [0x000D] error occurred receiving user data 3
INET_USER4_RECEIVED | [0x000E] error occurred receiving user data 4


Return for InetGetData2

Return Value

The extra data associated with a sound format.


Return for InetGetData

Return Value

An ILEADRasterVariant object which contains the extra data associated with a sound format.


iComputer Parameter For InetGetHostName

iComputer

Handle to a remote computer


iType Parameter For InetGetHostName

Type

type of name to get on the remote computer. Possible values are:

Value | Meaning
HOST_NAME_DESCP | the descriptive name of the remote computer.
HOST_NAME_IP | the IP address for the remote computer.


Return for InetGetHostName

Return Value

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


nMaskPlaneEnd Parameter For InetGetMagGlassData2

nMaskPlaneEnd

The end index of the mask plane array.


nMaskPlaneStart Parameter For InetGetMagGlassData2

nMaskPlaneStart

The start index of the mask plane array.


pRaster Parameter For InetGetMagGlassData2

pRaster

ILEADRaster interface that references the bitmap from which to get the Magnifying Glass data.


pvColorBuffer Parameter For InetGetMagGlassData2

pvColorBuffer

Address of the VARIANT byte array to be updated with the required colors that match the position of needed data on the mask plane array.


Return for InetGetMagGlassData2

Return Value

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


vMaskPlane Parameter For InetGetMagGlassData2

vMaskPlane

An array of bit flags which represents a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


nMaskPlaneEnd Parameter For InetGetMagGlassData

nMaskPlaneEnd

The end index of the mask plane array.


nMaskPlaneStart Parameter For InetGetMagGlassData

nMaskPlaneStart

The start index of the mask plane array.


pRaster Parameter For InetGetMagGlassData

pRaster

ILEADRaster interface that references the bitmap from which to get the Magnifying Glass data.


pvColorBuffer Parameter For InetGetMagGlassData

pvColorBuffer

An ILEADRasterVariant byte array object to be updated with the required colors that match the position of needed data on the mask plane array.


Return for InetGetMagGlassData

Return Value

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


vMaskPlane Parameter For InetGetMagGlassData

vMaskPlane

An array of bit flags which represents a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


iComputer Parameter For InetQueueSize

iComputer

handle to a remote computer


Return for InetQueueSize

Return Value

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


hBitmap Parameter For InetReceiveBitmap

hBitmap

handle to the received bitmap


iComputer Parameter For InetReceiveBitmap

iComputer

handle to the computer that received the bitmap


Command Parameter For InetReceiveCmd2

Command

Command received from the remote computer. For a list of possible values, refer to InetCmdType.


ExtraData Parameter For InetReceiveCmd2

ExtraData

Extra data sent with the command.


iComputer Parameter For InetReceiveCmd2

iComputer

Handle to the remote computer that sent the command.


nCommandID Parameter For InetReceiveCmd2

nCommandID

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 Parameter For InetReceiveCmd2

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).


nExtraDataSize Parameter For InetReceiveCmd2

nExtraDataSize

Size of any extra data sent with the command. Unused if ExtraData is NULL.


Params Parameter For InetReceiveCmd2

Params

Contains the parameter data sent with the command. For more information about the ILEADRasterInetPacket interface, refer to ILEADRasterInetPacket.


Command Parameter For InetReceiveCmd

Command

Command received from the remote computer. For a list of possible values, refer to InetCmdType.


ExtraData Parameter For InetReceiveCmd

ExtraData

Extra data sent with the command.


iComputer Parameter For InetReceiveCmd

iComputer

Handle to the remote computer that sent the command.


nCommandID Parameter For InetReceiveCmd

nCommandID

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 Parameter For InetReceiveCmd

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).


nExtraDataSize Parameter For InetReceiveCmd

nExtraDataSize

Size of any extra data sent with the command. Unused if ExtraData is NULL.


Params Parameter For InetReceiveCmd

Params

Contains the parameter data sent with the command. For more information about the ILEADRasterInetPacket interface, refer to ILEADRasterInetPacket.


iComputer Parameter For InetReceiveData2

iComputer

handle to the computer that received the data


iType Parameter For InetReceiveData2

iType

type of data being received. Possible values are:

Value | Meaning
IDATA_USER1 | user defined data 1
IDATA_USER2 | user defined data 2
IDATA_USER3 | user defined data 3
IDATA_USER4 | user defined data 4


lSize Parameter For InetReceiveData2

lSize

the size of the data buffer


pData Parameter For InetReceiveData2

pData

variant containing the received data


iComputer Parameter For InetReceiveData

iComputer

handle to the computer that received the data


iType Parameter For InetReceiveData

iType

type of data being received. Possible values are:

Value | Meaning
IDATA_USER1 | user defined data 1
IDATA_USER2 | user defined data 2
IDATA_USER3 | user defined data 3
IDATA_USER4 | user defined data 4


lSize Parameter For InetReceiveData

lSize

the size of the data buffer


pData Parameter For InetReceiveData

pData

An ILEADRasterVariant object which contains the received data.


Command Parameter For InetReceiveRsp2

Command

The command type which prompted this response. For a list of possible values, refer to InetCmdType.


ExtraData Parameter For InetReceiveRsp2

ExtraData

Extra data sent with the response.


iComputer Parameter For InetReceiveRsp2

iComputer

Handle to the remote computer that sent this response.


nCommandID Parameter For InetReceiveRsp2

nCommandID

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 Parameter For InetReceiveRsp2

nError

Indicates 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.


nExtraDataSize Parameter For InetReceiveRsp2

nExtraDataSize

Size of any extra data sent with the response.


nStatus Parameter For InetReceiveRsp2

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 Error Codes.


Params Parameter For InetReceiveRsp2

Params

Contains the parameter data sent with the response. For more information on the ILEADRasterInetPacket interface, refer to ILEADRasterInetPacket.


Command Parameter For InetReceiveRsp

Command

The command type which prompted this response. For a list of possible values, refer to InetCmdType.


ExtraData Parameter For InetReceiveRsp

ExtraData

Extra data sent with the response.


iComputer Parameter For InetReceiveRsp

iComputer

Handle to the remote computer that sent this response.


nCommandID Parameter For InetReceiveRsp

nCommandID

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 Parameter For InetReceiveRsp

nError

Indicates 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.


nExtraDataSize Parameter For InetReceiveRsp

nExtraDataSize

Size of any extra data sent with the response.


nStatus Parameter For InetReceiveRsp

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 Error Codes.


Params Parameter For InetReceiveRsp

Params

Contains the parameter data sent with the response. For more information on the ILEADRasterInetPacket interface, refer to ILEADRasterInetPacket.


iBitsPerSample Parameter For InetReceiveSound2

iBitsPerSample

value indicating the number of bits per sample.


iBlockAlign Parameter For InetReceiveSound2

iBlockAlign

value indicating the block size of the data.


iChannels Parameter For InetReceiveSound2

iChannels

value indicating the number of channels.


iComputer Parameter For InetReceiveSound2

iComputer

handle to computer receiving the sound.


iExtraDataSize Parameter For InetReceiveSound2

iExtraDataSize

value indicating the size of the extra data.


iFormatTag Parameter For InetReceiveSound2

iFormatTag

value indicating the format of the audio data


lAvgBytesPerSec Parameter For InetReceiveSound2

lAvgBytesPerSec

variable used for internal buffer estimation.


lDataSize Parameter For InetReceiveSound2

lDataSize

value indicating the amount of actual sound data.


lSamplesPerSec Parameter For InetReceiveSound2

lSamplesPerSec

value indicating the sample rate.


pData Parameter For InetReceiveSound2

pData

variant array of bytes of the actual sound data.


pExtraData Parameter For InetReceiveSound2

pExtraData

variant array of bytes that holds the extra data.


iBitsPerSample Parameter For InetReceiveSound

iBitsPerSample

value indicating the number of bits per sample.


iBlockAlign Parameter For InetReceiveSound

iBlockAlign

value indicating the block size of the data.


iChannels Parameter For InetReceiveSound

iChannels

value indicating the number of channels.


iComputer Parameter For InetReceiveSound

iComputer

handle to computer receiving the sound.


iExtraDataSize Parameter For InetReceiveSound

iExtraDataSize

value indicating the size of the extra data.


iFormatTag Parameter For InetReceiveSound

iFormatTag

value indicating the format of the audio data


lAvgBytesPerSec Parameter For InetReceiveSound

lAvgBytesPerSec

variable used for internal buffer estimation.


lDataSize Parameter For InetReceiveSound

lDataSize

value indicating the amount of actual sound data.


lSamplesPerSec Parameter For InetReceiveSound

lSamplesPerSec

value indicating the sample rate.


pData Parameter For InetReceiveSound

pData

An ILEADRasterVariant byte array object that holds the sound data.


pExtraData Parameter For InetReceiveSound

pExtraData

An ILEADRasterVariant byte array object that holds the extra data.


iComputer Parameter For InetReceiveStart

iComputer

handle to computer which is about to receive data


lSize Parameter For InetReceiveStart

lSize

total size of the data that will be received


iComputer Parameter For InetReceiving

iComputer

Handle to computer which is about to receive data


lSize Parameter For InetReceiving

lSize

Total size of the data that will be received


nBitmapID Parameter For InetSendAttachBitmapCmd

nBitmapID

The ID of the bitmap being attached. If the bitmap is successfully attached, then this bitmap will be painted whenever the window paints itself.


nCommandID Parameter For InetSendAttachBitmapCmd

nCommandID

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.


nWindowID Parameter For InetSendAttachBitmapCmd

nWindowID

The id of the window that was just created.


Return for InetSendAttachBitmapCmd

Return Value

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


ExtraData Parameter For InetSendAttachBitmapRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendAttachBitmapRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendAttachBitmapRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendAttachBitmapRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendAttachBitmapRsp2

Return Value

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


ExtraData Parameter For InetSendAttachBitmapRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendAttachBitmapRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendAttachBitmapRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendAttachBitmapRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendAttachBitmapRsp

Return Value

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


hBitmap Parameter For InetSendBitmap

pRaster

The ILEADRaster interface that references the bitmap to send to the remote computer.


iBitsPerPixel Parameter For InetSendBitmap

iBitsPerPixel

Resulting file's pixel depth.

The output file pixel depth. Note that not all bits per pixel are available to all file formats. Support for 12 and 16-bit grayscale images is available only in the Document/Medical edition. For valid values, refer to Formats of Output Files .


iFormat Parameter For InetSendBitmap

Format

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


iQuality Parameter For InetSendBitmap

Quality

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

For possible values, refer to Compression Quality Factors .


Return for InetSendBitmap

Return Value

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


nCommandID Parameter For InetSendCloseWinCmd

nCommandID

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.


nWindowID Parameter For InetSendCloseWinCmd

nWindowID

The id of the window to close.


Return for InetSendCloseWinCmd

Return Value

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


ExtraData Parameter For InetSendCloseWinRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendCloseWinRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendCloseWinRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendCloseWinRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendCloseWinRsp2

Return Value

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


ExtraData Parameter For InetSendCloseWinRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendCloseWinRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendCloseWinRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendCloseWinRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendCloseWinRsp

Return Value

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


Command Parameter For InetSendCmd2

Command

The command to send. For a list of possible values, refer to InetCmdType.


ExtraData Parameter For InetSendCmd2

ExtraData

Extra data to send with the command. Pass NULL if the command does not need to pass any extra data.


nCommandID Parameter For InetSendCmd2

nCommandID

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.


nExtraDataSize Parameter For InetSendCmd2

nExtraDataSize

Size of any extra data to send with the command. Unused if ExtraData is NULL.


Params Parameter For InetSendCmd2

Params

ILEADRasterInetPacket that contains parameter data to send with the command. For information about the information included in this parameter, refer to ILEADRasterInetPacket.


Return for InetSendCmd2

Return Value

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


Command Parameter For InetSendCmd

Command

The command to send. For a list of possible values, refer to InetCmdType.


ExtraData Parameter For InetSendCmd

ExtraData

Extra data to send with the command. Pass NULL if the command does not need to pass any extra data.


nCommandID Parameter For InetSendCmd

nCommandID

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.


nExtraDataSize Parameter For InetSendCmd

nExtraDataSize

Size of any extra data to send with the command. Unused if ExtraData is NULL.


Params Parameter For InetSendCmd

Params

ILEADRasterInetPacket that contains parameter data to send with the command. For information about the information included in this parameter, refer to ILEADRasterInetPacket.


Return for InetSendCmd

Return Value

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


nCommandID Parameter For InetSendCreateWinCmd

nCommandID

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.


nHeight Parameter For InetSendCreateWinCmd

nHeight

Requested height of the window's client area.


nLeft Parameter For InetSendCreateWinCmd

nLeft

X coordinate for the origin of the window to create.


nParentID Parameter For InetSendCreateWinCmd

nParentID

Id of the parent or owner window of the window being created.


nTop Parameter For InetSendCreateWinCmd

nTop

Y coordinate for the origin of the window to create.


nWidth Parameter For InetSendCreateWinCmd

nWidth

Requested width of the window's client area.


pszClassName Parameter For InetSendCreateWinCmd

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 Parameter For InetSendCreateWinCmd

pszWindowName

Character string containing the name of the window. This parameter can be an empty string ("").


Return for InetSendCreateWinCmd

Return Value

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


ulFlags Parameter For InetSendCreateWinCmd

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.


ExtraData Parameter For InetSendCreateWinRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendCreateWinRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendCreateWinRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendCreateWinRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


nWindowID Parameter For InetSendCreateWinRsp2

nWindowID

The id of the window that was just created. This id should be unique for each create request.


Return for InetSendCreateWinRsp2

Return Value

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


ExtraData Parameter For InetSendCreateWinRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendCreateWinRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendCreateWinRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendCreateWinRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


nWindowID Parameter For InetSendCreateWinRsp

nWindowID

The id of the window that was just created. This id should be unique for each create request.


Return for InetSendCreateWinRsp

Return Value

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


iType Parameter For InetSendData2

iType

Type of data to send to the remote computer. Possible values are:

Value | Meaning
IDATA_IMAGE | send an image; you would use this parameter if you have raw data for an image, if you have a DIB use the InetSendDib method instead, use InetSendBitmap method if you have the bitmap property from the LEADTOOLS main ActiveX control
IDATA_MMEDIA | multimedia object
IDATA_USER1 | user defined data 1
IDATA_USER2 | user defined data 2
IDATA_USER3 | user defined data 3
IDATA_USER4 | user defined data 4


lSize Parameter For InetSendData2

lSize

The size in bytes of the data buffer


pData Parameter For InetSendData2

pData

Pointer to the data to be sent to the remote computer. The data should be in a byte array.


Return for InetSendData2

Return Value

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


iType Parameter For InetSendData

iType

Type of data to send to the remote computer. Possible values are:

Value | Meaning
IDATA_IMAGE | send an image; you would use this parameter if you have raw data for an image, if you have a DIB use the InetSendDib method instead, use InetSendBitmap method if you have the bitmap property from the LEADTOOLS main ActiveX control
IDATA_MMEDIA | multimedia object
IDATA_USER1 | user defined data 1
IDATA_USER2 | user defined data 2
IDATA_USER3 | user defined data 3
IDATA_USER4 | user defined data 4


lSize Parameter For InetSendData

lSize

The size in bytes of the data buffer


pData Parameter For InetSendData

pData

Pointer to the data to be sent to the remote computer. The data should be in a byte array.


Return for InetSendData

Return Value

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


hDib Parameter For InetSendDIB

hDib

handle to the Windows device independent bitmap to send


iBitsPerPixel Parameter For InetSendDIB

iBitsPerPixel

Resulting file's pixel depth.

The output file pixel depth. Note that not all bits per pixel are available to all file formats. Support for 12 and 16-bit grayscale images is available only in the Document/Medical edition. For valid values, refer to Formats of Output Files .


iFormat Parameter For InetSendDIB

Format

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


iQuality Parameter For InetSendDIB

Quality

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

For possible values, refer to Compression Quality Factors .

This method can be used in any ControlMode.


Return for InetSendDIB

Return Value

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


nBitmapID Parameter For InetSendFreeBitmapCmd

nBitmapID

The ID of the bitmap that should be freed.


nCommandID Parameter For InetSendFreeBitmapCmd

nCommandID

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.


Return for InetSendFreeBitmapCmd

Return Value

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


ExtraData Parameter For InetSendFreeBitmapRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendFreeBitmapRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendFreeBitmapRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendFreeBitmapRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendFreeBitmapRsp2

Return Value

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


ExtraData Parameter For InetSendFreeBitmapRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendFreeBitmapRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendFreeBitmapRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendFreeBitmapRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendFreeBitmapRsp

Return Value

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


nBitmapID Parameter For InetSendGetMagGlassDataCmd2

nBitmapID

The ID of the bitmap to get Magnifying Glass data from.


nCommandID Parameter For InetSendGetMagGlassDataCmd2

nCommandID

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.


nMaskPlaneEnd Parameter For InetSendGetMagGlassDataCmd2

nMaskPlaneEnd

The end index of the mask plane array.


nMaskPlaneStart Parameter For InetSendGetMagGlassDataCmd2

nMaskPlaneStart

The start index of the mask plane array.


Return for InetSendGetMagGlassDataCmd2

Return Value

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


vMaskPlane Parameter For InetSendGetMagGlassDataCmd2

vMaskPlane

An array of bit flags which represents a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


nBitmapID Parameter For InetSendGetMagGlassDataCmd

nBitmapID

The ID of the bitmap to get Magnifying Glass data from.


nCommandID Parameter For InetSendGetMagGlassDataCmd

nCommandID

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.


nMaskPlaneEnd Parameter For InetSendGetMagGlassDataCmd

nMaskPlaneEnd

The end index of the mask plane array.


nMaskPlaneStart Parameter For InetSendGetMagGlassDataCmd

nMaskPlaneStart

The start index of the mask plane array.


Return for InetSendGetMagGlassDataCmd

Return Value

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


vMaskPlane Parameter For InetSendGetMagGlassDataCmd

vMaskPlane

An array of bit flags which represents a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


ExtraData Parameter For InetSendGetMagGlassDataRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendGetMagGlassDataRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendGetMagGlassDataRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nMaskPlaneEnd Parameter For InetSendGetMagGlassDataRsp2

nMaskPlaneEnd

The end index of the mask plane array.


nMaskPlaneStart Parameter For InetSendGetMagGlassDataRsp2

nMaskPlaneStart

The start index of the mask plane array.


nStatus Parameter For InetSendGetMagGlassDataRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendGetMagGlassDataRsp2

Return Value

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


vColorBuffer Parameter For InetSendGetMagGlassDataRsp2

vColorBuffer

A VARIANT byte array of colors that match the position of needed data in the mask plane array. This array of colors is obtained by calling the InetGetMagGlassData2 method.


vMaskPlane Parameter For InetSendGetMagGlassDataRsp2

vMaskPlane

An array of bit flags which represents a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


ExtraData Parameter For InetSendGetMagGlassDataRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendGetMagGlassDataRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendGetMagGlassDataRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nMaskPlaneEnd Parameter For InetSendGetMagGlassDataRsp

nMaskPlaneEnd

The end index of the mask plane array.


nMaskPlaneStart Parameter For InetSendGetMagGlassDataRsp

nMaskPlaneStart

The start index of the mask plane array.


nStatus Parameter For InetSendGetMagGlassDataRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendGetMagGlassDataRsp

Return Value

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


vColorBuffer Parameter For InetSendGetMagGlassDataRsp

vColorBuffer

A LEADRasterVariant byte array of colors that match the position of needed data in the mask plane array. This array of colors is obtained by calling the InetGetMagGlassData method.


vMaskPlane Parameter For InetSendGetMagGlassDataRsp

vMaskPlane

An array of bit flags which represents a mask plane. This array works as a plane for the parts of the bitmap that are not yet updated.


iComputer Parameter For InetSending

iComputer

Handle to the computer that is receiving the data.


lSize Parameter For InetSending

lSize

Amount of data that was sent to the remote computer.


nBitsPerPixel Parameter For InetSendLoadCmd

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


nCommandID Parameter For InetSendLoadCmd

nCommandID

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.


nOrder Parameter For InetSendLoadCmd

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 palletized 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.


pszFile Parameter For InetSendLoadCmd

pszFile

String containing the name of the image file to load. This should be the name of a file on the computer receiving the command.


Return for InetSendLoadCmd

Return Value

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


ExtraData Parameter For InetSendLoadRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nBitmapID Parameter For InetSendLoadRsp2

nBitmapID

The id of the bitmap that was loaded. This id should be unique for each load request.


nCommandID Parameter For InetSendLoadRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendLoadRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendLoadRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendLoadRsp2

Return Value

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


ExtraData Parameter For InetSendLoadRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nBitmapID Parameter For InetSendLoadRsp

nBitmapID

The id of the bitmap that was loaded. This id should be unique for each load request.


nCommandID Parameter For InetSendLoadRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendLoadRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendLoadRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendLoadRsp

Return Value

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


Command Parameter For InetSendRsp2

Command

The command type which prompted this response. For a list of possible values, refer to InetCmdType.


ExtraData Parameter For InetSendRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Params Parameter For InetSendRsp2

Params

ILEADRasterInetPacket that contains parameter data to send with the command. For information about the information included in this parameter, refer to ILEADRasterInetPacket. You can pass NULL if the only parameter needed is nStatus.


Return for InetSendRsp2

Return Value

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


Command Parameter For InetSendRsp

Command

The command type which prompted this response. For a list of possible values, refer to InetCmdType.


ExtraData Parameter For InetSendRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Params Parameter For InetSendRsp

Params

ILEADRasterInetPacket that contains parameter data to send with the command. For information about the information included in this parameter, refer to ILEADRasterInetPacket. You can pass NULL if the only parameter needed is nStatus.


Return for InetSendRsp

Return Value

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


bSaveMulti Parameter For InetSendSaveCmd

bSaveMulti

Flag that indicates how to save a file as a multi-page file. Possible values are:

Value | Meaning
SAVE_OVERWRITE | [0x0000] Overwrite the file.
SAVE_APPEND | [0x0001] Append to the end of the file.
SAVE_REPLACE | [0x0002] Replace a page.
SAVE_INSERT | [0x0003] Insert a page.


nBitmapID Parameter For InetSendSaveCmd

nBitmapID

Id of the bitmap to save.


nBitsPerPixel Parameter For InetSendSaveCmd

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 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.


nCommandID Parameter For InetSendSaveCmd

nCommandID

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.


nFormat Parameter For InetSendSaveCmd

nFormat

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


nQFactor Parameter For InetSendSaveCmd

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 .


pszFile Parameter For InetSendSaveCmd

pszFile

String containing the name of the image file to save.


Return for InetSendSaveCmd

Return Value

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


ExtraData Parameter For InetSendSaveRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendSaveRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendSaveRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendSaveRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendSaveRsp2

Return Value

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


ExtraData Parameter For InetSendSaveRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendSaveRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendSaveRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendSaveRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendSaveRsp

Return Value

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


nCommandID Parameter For InetSendSetRectCmd

nCommandID

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.


nHeight Parameter For InetSendSetRectCmd

nHeight

Height of the display rectangle.


nLeft Parameter For InetSendSetRectCmd

nLeft

X coordinate of the origin of the display rectangle.


nTop Parameter For InetSendSetRectCmd

nTop

Y coordinate of the origin of the display rectangle.


nWidth Parameter For InetSendSetRectCmd

nWidth

Width of the display rectangle.


nWindowID Parameter For InetSendSetRectCmd

nWindowID

The id of the window to receive the command.


RectType Parameter For InetSendSetRectCmd

RectType

Type of rectangle to set. For possible values, refer to DisplayRectType.


Return for InetSendSetRectCmd

Return Value

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


ExtraData Parameter For InetSendSetRectRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendSetRectRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendSetRectRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendSetRectRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendSetRectRsp2

Return Value

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


ExtraData Parameter For InetSendSetRectRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendSetRectRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendSetRectRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendSetRectRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendSetRectRsp

Return Value

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


nCmdShow Parameter For InetSendShowWinCmd

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.


nCommandID Parameter For InetSendShowWinCmd

nCommandID

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.


nWindowID Parameter For InetSendShowWinCmd

nWindowID

The id of the window to show.


Return for InetSendShowWinCmd

Return Value

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


ExtraData Parameter For InetSendShowWinRsp2

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendShowWinRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendShowWinRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendShowWinRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendShowWinRsp2

Return Value

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


ExtraData Parameter For InetSendShowWinRsp

ExtraData

Extra data to send with the response. Pass NULL if the response does not need to pass any extra data.


nCommandID Parameter For InetSendShowWinRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendShowWinRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendShowWinRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendShowWinRsp

Return Value

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


nCommandID Parameter For InetSendSizeWinCmd

nCommandID

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.


nHeight Parameter For InetSendSizeWinCmd

nHeight

New height of window.


nLeft Parameter For InetSendSizeWinCmd

nLeft

X coordinate of the new origin of the window.


nTop Parameter For InetSendSizeWinCmd

nTop

Y coordinate of the new origin of the window.


nWidth Parameter For InetSendSizeWinCmd

nWidth

New width of window.


nWindowID Parameter For InetSendSizeWinCmd

nWindowID

The id of the window to size. This id should be unique for each window.


Return for InetSendSizeWinCmd

Return Value

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


ExtraData Parameter For InetSendSizeWinRsp2

ExtraData

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nCommandID Parameter For InetSendSizeWinRsp2

nCommandID

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.


nExtraDataSize Parameter For InetSendSizeWinRsp2

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendSizeWinRsp2

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendSizeWinRsp2

Return Value

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


ExtraData Parameter For InetSendSizeWinRsp

ExtraData

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nCommandID Parameter For InetSendSizeWinRsp

nCommandID

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.


nExtraDataSize Parameter For InetSendSizeWinRsp

nExtraDataSize

Size of any extra data to send with the response. Unused if ExtraData is NULL.


nStatus Parameter For InetSendSizeWinRsp

nStatus

Status of the original command. If the command completes successfully, this should be 0. Otherwise, it should be one of the Error Codes.


Return for InetSendSizeWinRsp

Return Value

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


iBitsPerSample Parameter For InetSendSound2

iBitsPerSample

value indicating the number of bits per sample.


iBlockAlign Parameter For InetSendSound2

iBlockAlign

value indicating the block size of the data.


iChannels Parameter For InetSendSound2

iChannels

value indicating the number of channels.


iExtraDataSize Parameter For InetSendSound2

iExtraDataSize

value indicating the size of the extra data.


iFormatTag Parameter For InetSendSound2

iFormatTag

value indicating the format of the audio data.


lAvgBytesPerSec Parameter For InetSendSound2

lAvgBytesPerSec

variable used for internal buffer estimation.


lDataSize Parameter For InetSendSound2

lDataSize

value indicating the amount of actual sound data.


lSamplesPerSec Parameter For InetSendSound2

lSamplesPerSec

value indicating the sample rate.


pData Parameter For InetSendSound2

pData

variant array of bytes of the actual sound data.


pExtraData Parameter For InetSendSound2

pExtraData

variant array of bytes that holds the extra data.


Return for InetSendSound2

Return Value

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


iBitsPerSample Parameter For InetSendSound

iBitsPerSample

value indicating the number of bits per sample.


iBlockAlign Parameter For InetSendSound

iBlockAlign

value indicating the block size of the data.


iChannels Parameter For InetSendSound

iChannels

value indicating the number of channels.


iExtraDataSize Parameter For InetSendSound

iExtraDataSize

value indicating the size of the extra data.


iFormatTag Parameter For InetSendSound

iFormatTag

value indicating the format of the audio data.


lAvgBytesPerSec Parameter For InetSendSound

lAvgBytesPerSec

variable used for internal buffer estimation.


lDataSize Parameter For InetSendSound

lDataSize

value indicating the amount of actual sound data.


lSamplesPerSec Parameter For InetSendSound

lSamplesPerSec

value indicating the sample rate.


pData Parameter For InetSendSound

pData

An ILEADRasterVariant byte array object that holds the sound data.


pExtraData Parameter For InetSendSound

pExtraData

An ILEADRasterVariant byte array object that holds the extra data.


Return for InetSendSound

Return Value

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


iServer Parameter For InetServerClose

iServer

Handle to a server computer, obtained by calling the InetServerInit method


Return for InetServerClose

Return Value

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


iPort Parameter For InetServerInit

iPort

the number of the port to set up as a server

Value | Meaning
0x015 | FTP
0x050 | Web server
0x077 | News
0x019 | Mail
0x017 | Telnet


Return for InetServerInit

Return Value

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


iIndex Parameter For SendList

iIndex

index into the array.