Win32::DDE::Client - Perl extension for Win32 DDE client


NAME

Win32::DDE::Client - Perl extension for Win32 DDE client


SYNOPSIS

  use Win32::DDE::Client;
  $Client = new Win32::DDE::Client ('Server', 'Topic');
  die "Unable to initiate conversation" if $Client->Error;
  defined ($hesays = $Client->Request ('ITEM1')) ||
        die "DDE request failed";
  $Client->Poke ('ITEM2', 'VALUE2') ||
        die "DDE poke failed";
  $Client->Execute ('COMMAND') ||
        die "DDE execute failed";
  $Client->Disconnect;


DESCRIPTION

Win32::DDE::Client is a class implementing a simple DDE client in Perl.


CONSTRUCTOR

new (SERVER, TOPIC)
This is the constructor for a new Win32::DDE::Client object. SERVER and TOPIC are the server and topic names for the server to connect to. A server object will be returned, regardless of the success or failure of the connect; you will have to use the Error method to figure out if the connect succeeded or not.


METHODS

Unless otherwise stated all methods return either a true or false value, with true meaning that the operation was a success. When a method states that it returns a value, failure will be returned as undef.

Request(ITEM)
Returns the value of ITEM from the DDE server.

Poke (ITEM, VALUE)
Pokes VALUE into ITEM at the DDE server.

Execute (CMD)
Executes CMD at the DDE server.

Disconnect
Disconnects from the DDE server. This will get done when the object is DESTROYed, but you can make it happen sooner by invoking it explicitly.

Error
Returns the error code from the last DDE operation that took place (the connect that took place in the constructor, a Request, Poke, or Execute). Error codes can be checked using the Win32::DDE::DMLERR* functions (DMLERR_NO_ERROR, DMLERR_NO_CONV_ESTABLISHED, and DMLERR_NOTPROCESSED are particularly popular).

See the ErrorText function in the Win32::DDE manpage for a way to make these useful.

ErrorMessage
Returns a somewhat cryptic error message from the last DDE operation that took place (the connect that took place in the constructor, a Request, Poke, or Execute).

This method will give a little more detail than a Win32::DDE::ErrorMessage($Client->Error).

Timeout ([NEWVALUE])
If NEWVALUE is present, set the timeout value (in milliseconds) used for DDE operations; return the old value.

The timeout value is initially set to $Win32::DDE::Client::Timeout when the object is constructed. $Win32::DDE::Client::Timeout is set to 1000 when the module is loaded.


AUTHORS

Doug Breshears Gurusamy Sarathy, gsar@umich.edu current maintainer, Doug Wegscheid, wegscd@whirlpool.com


SEE ALSO

the Win32::DDE manpage

 Win32::DDE::Client - Perl extension for Win32 DDE client