网站首页  词典首页

请输入您要查询的函数:

 

术语 ddeclienttransaction
释义 DdeClientTransaction
语法:
HDDEDATA DdeClientTransaction( LPBYTE pData,
DWORD cbData,
HCONV hConv,
HSZ hszItem,
UINT wFmt,
UINT wType,
DWORD dwTimeout,
LPDWORD pdwResult
);
DdeClientTransaction功能
该DdeClientTransaction功能开始在客户端和服务器的数据交易。只有动态数据交换(DDE)客户端应用程序可以调用这个函数,应用程序可以使用只有在建立与服务器的会话了。
参数
pData
[in]指向的数据开始,客户端必须通过到服务器。
或者,应用程序可以指定数据处理(HDDEDATA)传递到服务器,而在此cbData参数应设置为-1的情况。此参数是必需只有wType参数XTYP_EXECUTE或XTYP_POKE。否则,此参数应为NULL。
对于此参数可选的使用,XTYP_POKE交易情况pData是数据处理的处理必须是因先前调用DdeCreateDataHandle函数创建,采用相同的数据格式中的wFmt参数中指定。
cbData
[in]指定的长度,以字节的数据指出,由pData参数,包括终止空,如果数据是一个字符串。值为-1表示pData是数据处理,标识发送的数据。
hConv
[in]句柄谈话,其中交易的发生地。
hszItem
[in]句柄数据项的数据,它在交易过程中被交换。这种处理,必须是被以前的调用DdeCreateStringHandle函数创建。此参数被忽略(并应设置为0L)如果wType参数XTYP_EXECUTE。
wFmt
[in]指定的标准剪贴板格式,其中数据项,正在提交或请求。
如果被wType参数指定的交易不通过数据或XTYP_EXECUTE,此参数应为零。
如果被wType参数引用非执行DDE数据(XTYP_POKE,XTYP_ADVSTART,XTYP_ADVSTOP,XTYP_REQUEST),该wFmt值指定的交易必须是一个有效的预定义(CF_)DDE的格式或有效注册剪贴板格式。
wType
[in]指定交易类型。此参数可以是下列值之一。
XTYP_ADVSTART
开始一个通知循环。任何不同意见可以存在于循环会话数。应用程序可以改变的建议相结合,XTYP_ADVSTART交易型循环型的一个或多个以下标志:FlagMeaning
XTYPF_NODATAInstructs服务器以通知没有实际发送数据的任何数据更改客户端。这个标志使客户端忽略的通知或要求从服务器已更改的数据选项。
XTYPF_ACKREQInstructs服务器等待客户端确认收到交到下一个数据项上的数据项。此标志阻止发送数据的速度超过了客户端可以处理它快速的服务器。
XTYP_ADVSTOP
完一个通知循环。
XTYP_EXECUTE
开始一个执行交易。
XTYP_POKE
开始一戳交易。
XTYP_REQUEST
开始交易的请求。
dwTimeout
[in]指定的时间上限,以毫秒为单位,在客户端将等待从同步交易服务器应用程序的响应。此参数应当TIMEOUT_ASYNC异步交易。
pdwResult
[out]指向一个变量,它接收的交易的结果。一个应用程序,不检查的结果可以使用此值为NULL。同步交易,低这个变量的命令字包含任何适用的交易产生的DDE_标志。这为应用程序DDE_APPSTATUS位依赖的支持。然而,建议应用程序不再使用这些,因为他们可能不符合的动态数据交换管理库(DDEML的)的未来版本的支持位。异步交易,这个变量是洋溢着同DdeAbandonTransaction功能和XTYP_XACT_COMPLETE交易使用唯一事务标识符。
返回值
如果函数成功,返回值是一个数据处理标识成功,其中客户期望从服务器数据的同步交易的数据。返回值为非零成功交易和异步同步交易的客户端不期望的数据。返回值是所有失败的交易为零。
该DdeGetLastError函数可用于获得错误代码,它可以是下列值之一:
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
备注
当一个应用程序在使用完处理DdeClientTransaction返回的数据,应用程序应该自由的处理函数调用DdeFreeDataHandle。
交易可以同步或异步。在同步交易,DdeClientTransaction不会返回,直到成功完成交易或或失败。同步交易,导致客户端进入一个模式循环,同时为各种异步事件等待。正因为如此,客户端应用程序仍然可以响应用户输入的同时同步交易等,但应用程序不能开始,因为与第一个有关的活动的第二个同步交易。 DdeClientTransaction失败如果任何相同的任务,例如已经进行同步交易。
在异步交易,DdeClientTransaction返回后,交易已经开始,通过进行参考事务标识符。当服务器的DDE回调函数完成处理异步交易时,系统发送一个XTYP_XACT_COMPLETE交易客户端。此次交易提供了交易的异步,它通过调用DdeClientTransaction发起的结果客户端。 A client application can choose to abandon an asynchronous transaction by calling the DdeAbandonTransaction function.
功能信息
最低DLL版本 user32.dll
在Ddeml.h HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
参见
动态数据交换管理库概况,DdeAbandonTransaction,DdeAccessData,DdeConnect,DdeConnectList,DdeCreateDataHandle,DdeCreateStringHandle,DdeFreeDataHandle,XTYP_ADVSTART,XTYP_ADVSTOP,XTYP_EXECUTE,XTYP_POKE,XTYP_REQUEST
==英文原文==DdeClientTransaction Function
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.
Syntax
HDDEDATA DdeClientTransaction( LPBYTE pData,
DWORD cbData,
HCONV hConv,
HSZ hszItem,
UINT wFmt,
UINT wType,
DWORD dwTimeout,
LPDWORD pdwResult
);
Parameters
pData
[in] Pointer 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 -1. 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
[in] Specifies the length, in bytes, of the data pointed to by the pData parameter, including the terminating NULL, if the data is a string. A value of -1 indicates that pData is a data handle that identifies the data being sent.
hConv
[in] Handle to the conversation in which the transaction is to take place.
hszItem
[in] Handle to 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
[in] 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
[in] Specifies the transaction type. This parameter can be one of the following values.
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: FlagMeaning
XTYPF_NODATAInstructs 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_ACKREQInstructs 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
[in] Specifies the maximum amount 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
[out] Pointer 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 Value
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.
The DdeGetLastError function can be used to get the error code, which can 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.
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Ddeml.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
See Also
Dynamic Data Exchange Management Library Overview , DdeAbandonTransaction , DdeAccessData , DdeConnect , DdeConnectList , DdeCreateDataHandle , DdeCreateStringHandle , DdeFreeDataHandle , XTYP_ADVSTART , XTYP_ADVSTOP , XTYP_EXECUTE , XTYP_POKE , XTYP_REQUEST
==原始网址==http://msdn.microsoft.com/en-us/library/ms648743(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 11:27:20