|
Overview |
|
|
|
Group |
|
|
|
Quick Info
Windows NT
| Yes
| Win95
| Yes
| Win32s
| Yes
| Import Library
| user32.lib
| Header File
| ddeml.h
| Unicode
| No
| Platform Notes
| None
|
|
|
DdeClientTransaction
The DdeClientTransaction function begins a data transaction between a client and a server. Only a
dynamic data exchange (DDE) client application can call this function, and the
application can use it only after establishing a conversation with the server.
HDDEDATA DdeClientTransaction(
LPBYTE pData,
| // pointer to data to pass to server
| DWORD cbData,
| // length of data
| HCONV hConv,
| // handle to conversation
| HSZ hszItem,
| // handle to item name string
| UINT wFmt,
| // clipboard data format
| UINT wType,
| // transaction type
| DWORD dwTimeout,
| // time-out duration
| LPDWORD pdwResult
| // pointer to transaction result
| );
|
|
Parameters
pData
Points to the beginning of the data the client must pass to the server.
Optionally, an application can specify the data handle (HDDEDATA) to pass to
the server and in that case the cbData parameter should be set to 0xFFFFFFFF. This parameter is required only if the wType parameter is XTYP_EXECUTE or XTYP_POKE. Otherwise, this parameter should be NULL.
For the optional usage of this parameter, XTYP_POKE transactions where pData is a data handle, the handle must have been created by a previous call to the DdeCreateDataHandle function, employing the same data format specified in the wFmt parameter.
cbData
Specifies the length, in bytes, of the data pointed to by the pData parameter. A value of 0xFFFFFFFF indicates that pData is a data handle that identifies the data being sent.
hConv
Identifies the conversation in which the transaction is to take place.
hszItem
Identifies the data item for which data is being exchanged during the
transaction. This handle must have been created by a previous call to the DdeCreateStringHandle function. This parameter is ignored (and should be set to 0L) if the wType parameter is XTYP_EXECUTE.
wFmt
Specifies the standard clipboard format in which the data item is being
submitted or requested.
If the transaction specified by the wType parameter does not pass data or is XTYP_EXECUTE, this parameter should be
zero.
If the transaction specified by the wType parameter references non-execute DDE data (XTYP_POKE, XTYP_ADVSTART,
XTYP_ADVSTOP, XTYP_REQUEST), the wFmt value must be either a valid predefined (CF_) DDE format or a valid
registered clipboard format.
wType
Specifies the transaction type. This parameter can be one of the following
types:
Type
| Meaning
| XTYP_ADVSTART
| Begins an advise loop. Any number of distinct advise loops can exist within a
conversation. An application can alter the advise loop type by combining the
XTYP_ADVSTART transaction type with one or more of the following flags:
|
Flag
| Meaning
| XTYPF_NODATA
| Instructs the server to notify the client of any data changes without actually
sending the data. This flag gives the client the option of ignoring the
notification or requesting the changed data from the server.
| XTYPF_ACKREQ
| Instructs the server to wait until the client acknowledges that it received
the previous data item before sending the next data item. This flag prevents a
fast server from sending data faster than the client can process it.
| XTYP_ADVSTOP
| Ends an advise loop.
| XTYP_EXECUTE
| Begins an execute transaction.
| XTYP_POKE
| Begins a poke transaction.
| XTYP_REQUEST
| Begins a request transaction.
|
dwTimeout
Specifies the maximum length of time, in milliseconds, that the client will
wait for a response from the server application in a synchronous transaction.
This parameter should be TIMEOUT_ASYNC for asynchronous transactions.
pdwResult
Points to a variable that receives the result of the transaction. An
application that does not check the result can use NULL for this value. For synchronous
transactions, the low-order word of this variable contains any applicable DDE_
flags resulting from the transaction. This provides support for applications
dependent on DDE_APPSTATUS bits. It is, however, recommended that applications no
longer use these bits because they may not be supported in future versions of
the Dynamic Data Exchange Management Library (DDEML). For asynchronous transactions, this variable is filled with a unique
transaction identifier for use with the DdeAbandonTransaction function and the XTYP_XACT_COMPLETE transaction.
Return Values
If the function succeeds, the return value is a data handle that identifies
the data for successful synchronous transactions in which the client expects data
from the server. The return value is nonzero for successful asynchronous
transactions and for synchronous transactions in which the client does not expect
data. The return value is zero for all unsuccessful transactions.
Errors
The DdeGetLastError function can be used to get the error code, which may be one of the following
values:
DMLERR_ADVACKTIMEOUT
DMLERR_BUSY
DMLERR_DATAACKTIMEOUT
DMLERR_DLL_NOT_INITIALIZED
DMLERR_EXECACKTIMEOUT
DMLERR_INVALIDPARAMETER
DMLERR_MEMORY_ERROR
DMLERR_NO_CONV_ESTABLISHED
DMLERR_NO_ERROR
DMLERR_NOTPROCESSED
DMLERR_POKEACKTIMEOUT
DMLERR_POSTMSG_FAILED
DMLERR_REENTRANCY
DMLERR_SERVER_DIED
DMLERR_UNADVACKTIMEOUT
Remarks
When an application has finished using the data handle returned by DdeClientTransaction, the application should free the handle by calling the DdeFreeDataHandle function.
Transactions can be synchronous or asynchronous. During a synchronous
transaction, DdeClientTransaction does not return until the transaction either completes successfully or fails.
Synchronous transactions cause a client to enter a modal loop while waiting
for various asynchronous events. Because of this, a client application can still
respond to user input while waiting on a synchronous transaction, but the
application cannot begin a second synchronous transaction because of the activity
associated with the first. DdeClientTransaction fails if any instance of the same task has a synchronous transaction already
in progress.
During an asynchronous transaction, DdeClientTransaction returns after the transaction has begun, passing a transaction identifier for
reference. When the server's DDE callback function finishes processing an
asynchronous transaction, the system sends an XTYP_XACT_COMPLETE transaction to the
client. This transaction provides the client with the results of the
asynchronous transaction that it initiated by calling DdeClientTransaction. A client application can choose to abandon an asynchronous transaction by
calling the DdeAbandonTransaction function.
See Also
DdeAbandonTransaction, DdeAccessData, DdeConnect, DdeConnectList, DdeCreateDataHandle, DdeCreateStringHandle, DdeFreeDataHandle, XTYP_ADVSTART, XTYP_ADVSTOP, XTYP_EXECUTE, XTYP_POKE, XTYP_REQUEST
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|