Interface DdemlUtil.IDdeClient
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
DdemlUtil.DdeClient
,DdemlUtil.StandaloneDdeClient
- Enclosing class:
- DdemlUtil
public static interface DdemlUtil.IDdeClient extends Closeable
The IDdeClient defines functions that wrap a ddeml instance. and are not tied to conversation.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abandonTransactions()
Abandons all asynchronous transaction and releases all resources associated with the transaction.Pointer
accessData(Ddeml.HDDEDATA hData, WinDef.DWORDByReference pcbDataSize)
An application must call the DdeUnaccessData function when it has finished accessing the data in the object.Ddeml.HDDEDATA
addData(Ddeml.HDDEDATA hData, Pointer pSrc, int cb, int cbOff)
Adds data to the specified Dynamic Data Exchange (DDE) object.DdemlUtil.IDdeConnection
connect(Ddeml.HSZ service, Ddeml.HSZ topic, Ddeml.CONVCONTEXT convcontext)
Establishes a conversation with a server application that supports the specified service name and topic name pair.DdemlUtil.IDdeConnection
connect(String service, String topic, Ddeml.CONVCONTEXT convcontext)
Establishes a conversation with a server application that supports the specified service name and topic name pair.DdemlUtil.IDdeConnectionList
connectList(Ddeml.HSZ service, Ddeml.HSZ topic, DdemlUtil.IDdeConnectionList existingList, Ddeml.CONVCONTEXT ctx)
Establishes a conversation with all server applications that support the specified service name and topic name pair.DdemlUtil.IDdeConnectionList
connectList(String service, String topic, DdemlUtil.IDdeConnectionList existingList, Ddeml.CONVCONTEXT ctx)
Establishes a conversation with all server applications that support the specified service name and topic name pair.Ddeml.HDDEDATA
createDataHandle(Pointer pSrc, int cb, int cbOff, Ddeml.HSZ hszItem, int wFmt, int afCmd)
Creates a Dynamic Data Exchange (DDE) object and fills the object with data from the specified buffer.Ddeml.HSZ
createStringHandle(String value)
Creates a handle that identifies the specified string.boolean
enableCallback(int wCmd)
Enables or disables transactions for a specific conversation or for all conversations currently established by the calling application.void
freeDataHandle(Ddeml.HDDEDATA hData)
Frees a Dynamic Data Exchange (DDE) object and deletes the data handle associated with the object.boolean
freeStringHandle(Ddeml.HSZ value)
Frees a string handle in the calling application.int
getData(Ddeml.HDDEDATA hData, Pointer pDst, int cbMax, int cbOff)
Copies data from the specified Dynamic Data Exchange (DDE) object to the specified local buffer.Integer
getInstanceIdentitifier()
int
getLastError()
void
initialize(int afCmd)
Registers an application with the Dynamic Data Exchange Management Library (DDEML).boolean
keepStringHandle(Ddeml.HSZ value)
Increments the usage count associated with the specified handle.void
nameService(Ddeml.HSZ name, int afCmd)
Registers or unregisters the service names a Dynamic Data Exchange (DDE) server supports.void
nameService(String name, int afCmd)
Registers or unregisters the service names a Dynamic Data Exchange (DDE) server supports.void
postAdvise(Ddeml.HSZ hszTopic, Ddeml.HSZ hszItem)
Causes the system to send an XTYP_ADVREQ transaction to the calling (server) application's Dynamic Data Exchange (DDE) callback function for each client with an active advise loop on the specified topic and item.void
postAdvise(String hszTopic, String hszItem)
Causes the system to send an XTYP_ADVREQ transaction to the calling (server) application's Dynamic Data Exchange (DDE) callback function for each client with an active advise loop on the specified topic and item.String
queryString(Ddeml.HSZ value)
Copies text associated with a string handle into a buffer.void
registerAdvdataHandler(DdemlUtil.AdvdataHandler handler)
void
registerAdvReqHandler(DdemlUtil.AdvreqHandler handler)
void
registerAdvstartHandler(DdemlUtil.AdvstartHandler handler)
void
registerAdvstopHandler(DdemlUtil.AdvstopHandler handler)
void
registerConnectConfirmHandler(DdemlUtil.ConnectConfirmHandler handler)
void
registerConnectHandler(DdemlUtil.ConnectHandler handler)
void
registerDisconnectHandler(DdemlUtil.DisconnectHandler handler)
void
registerErrorHandler(DdemlUtil.ErrorHandler handler)
void
registerExecuteHandler(DdemlUtil.ExecuteHandler handler)
void
registerMonitorHandler(DdemlUtil.MonitorHandler handler)
void
registerPokeHandler(DdemlUtil.PokeHandler handler)
void
registerRegisterHandler(DdemlUtil.RegisterHandler handler)
void
registerRequestHandler(DdemlUtil.RequestHandler handler)
void
registerUnregisterHandler(DdemlUtil.UnregisterHandler handler)
void
registerWildconnectHandler(DdemlUtil.WildconnectHandler handler)
void
registerXactCompleteHandler(DdemlUtil.XactCompleteHandler handler)
void
unaccessData(Ddeml.HDDEDATA hData)
Unaccesses a Dynamic Data Exchange (DDE) object.boolean
uninitialize()
Frees all Dynamic Data Exchange Management Library (DDEML) resources associated with the calling application.void
unregisterAdvdataHandler(DdemlUtil.AdvdataHandler handler)
void
unregisterAdvReqHandler(DdemlUtil.AdvreqHandler handler)
void
unregisterAdvstartHandler(DdemlUtil.AdvstartHandler handler)
void
unregisterAdvstopHandler(DdemlUtil.AdvstopHandler handler)
void
unregisterConnectConfirmHandler(DdemlUtil.ConnectConfirmHandler handler)
void
unregisterConnectHandler(DdemlUtil.ConnectHandler handler)
void
unregisterDisconnectHandler(DdemlUtil.DisconnectHandler handler)
void
unregisterErrorHandler(DdemlUtil.ErrorHandler handler)
void
unregisterExecuteHandler(DdemlUtil.ExecuteHandler handler)
void
unregisterMonitorHandler(DdemlUtil.MonitorHandler handler)
void
unregisterPokeHandler(DdemlUtil.PokeHandler handler)
void
unregisterRegisterHandler(DdemlUtil.RegisterHandler handler)
void
unregisterRequestHandler(DdemlUtil.RequestHandler handler)
void
unregisterUnregisterHandler(DdemlUtil.UnregisterHandler handler)
void
unregisterWildconnectHandler(DdemlUtil.WildconnectHandler handler)
void
unregisterXactCompleteHandler(DdemlUtil.XactCompleteHandler handler)
DdemlUtil.IDdeConnection
wrap(Ddeml.HCONV conv)
Wrap a connection handle into a IDdeConnection helper class.
-
-
-
Method Detail
-
getInstanceIdentitifier
Integer getInstanceIdentitifier()
-
initialize
void initialize(int afCmd) throws DdemlUtil.DdemlException
Registers an application with the Dynamic Data Exchange Management Library (DDEML). An application must call this function before calling any other Dynamic Data Exchange Management Library (DDEML) function.- Parameters:
afCmd
- A set of APPCMD_, CBF_, and MF_ flags. The APPCMD_ flags provide special instructions to DdeInitialize. The CBF_ flags specify filters that prevent specific types of transactions from reaching the callback function. The MF_ flags specify the types of DDE activity that a DDE monitoring application monitors. Using these flags enhances the performance of a DDE application by eliminating unnecessary calls to the callback function.This parameter can be one or more of the following values.
Value Meaning - APPCLASS_MONITOR
- 0x00000001L
Makes it possible for the application to monitor DDE activity in the system. This flag is for use by DDE monitoring applications. The application specifies the types of DDE activity to monitor by combining one or more monitor flags with the APPCLASS_MONITOR flag. For details, see the following Remarks section.
- APPCLASS_STANDARD
- 0x00000000L
Registers the application as a standard (nonmonitoring) DDEML application.
- APPCMD_CLIENTONLY
- 0x00000010L
Prevents the application from becoming a server in a DDE conversation. The application can only be a client. This flag reduces consumption of resources by the DDEML. It includes the functionality of the CBF_FAIL_ALLSVRXACTIONS flag.
- APPCMD_FILTERINITS
- 0x00000020L
Prevents the DDEML from sending XTYP_CONNECT and XTYP_WILDCONNECT transactions to the application until the application has created its string handles and registered its service names or has turned off filtering by a subsequent call to the DdeNameService or DdeInitialize function. This flag is always in effect when an application calls DdeInitialize for the first time, regardless of whether the application specifies the flag. On subsequent calls to DdeInitialize, not specifying this flag turns off the application's service-name filters, but specifying it turns on the application's service name filters.
- CBF_FAIL_ALLSVRXACTIONS
- 0x0003f000
Prevents the callback function from receiving server transactions. The system returns DDE_FNOTPROCESSED to each client that sends a transaction to this application. This flag is equivalent to combining all CBF_FAIL_ flags.
- CBF_FAIL_ADVISES
- 0x00004000
Prevents the callback function from receiving XTYP_ADVSTART and XTYP_ADVSTOP transactions. The system returns DDE_FNOTPROCESSED to each client that sends an XTYP_ADVSTART or XTYP_ADVSTOP transaction to the server.
- CBF_FAIL_CONNECTIONS
- 0x00002000
Prevents the callback function from receiving XTYP_CONNECT and XTYP_WILDCONNECT transactions.
- CBF_FAIL_EXECUTES
- 0x00008000
Prevents the callback function from receiving XTYP_EXECUTE transactions. The system returns DDE_FNOTPROCESSED to a client that sends an XTYP_EXECUTE transaction to the server.
- CBF_FAIL_POKES
- 0x00010000
Prevents the callback function from receiving XTYP_POKE transactions. The system returns DDE_FNOTPROCESSED to a client that sends an XTYP_POKE transaction to the server.
- CBF_FAIL_REQUESTS
- 0x00020000
Prevents the callback function from receiving XTYP_REQUEST transactions. The system returns DDE_FNOTPROCESSED to a client that sends an XTYP_REQUEST transaction to the server.
- CBF_FAIL_SELFCONNECTIONS
- 0x00001000
Prevents the callback function from receiving XTYP_CONNECT transactions from the application's own instance. This flag prevents an application from establishing a DDE conversation with its own instance. An application should use this flag if it needs to communicate with other instances of itself but not with itself.
- CBF_SKIP_ALLNOTIFICATIONS
- 0x003c0000
Prevents the callback function from receiving any notifications. This flag is equivalent to combining all CBF_SKIP_ flags.
- CBF_SKIP_CONNECT_CONFIRMS
- 0x00040000
Prevents the callback function from receiving XTYP_CONNECT_CONFIRM notifications.
- CBF_SKIP_DISCONNECTS
- 0x00200000
Prevents the callback function from receiving XTYP_DISCONNECT notifications.
- CBF_SKIP_REGISTRATIONS
- 0x00080000
Prevents the callback function from receiving XTYP_REGISTER notifications.
- CBF_SKIP_UNREGISTRATIONS
- 0x00100000
Prevents the callback function from receiving XTYP_UNREGISTER notifications.
- MF_CALLBACKS
- 0x08000000
Notifies the callback function whenever a transaction is sent to any DDE callback function in the system.
- MF_CONV
- 0x40000000
Notifies the callback function whenever a conversation is established or terminated.
- MF_ERRORS
- 0x10000000
Notifies the callback function whenever a DDE error occurs.
- MF_HSZ_INFO
- 0x01000000
Notifies the callback function whenever a DDE application creates, frees, or increments the usage count of a string handle or whenever a string handle is freed as a result of a call to the DdeUninitialize function.
- MF_LINKS
- 0x20000000
Notifies the callback function whenever an advise loop is started or ended.
- MF_POSTMSGS
- 0x04000000
Notifies the callback function whenever the system or an application posts a DDE message.
- MF_SENDMSGS
- 0x02000000
Notifies the callback function whenever the system or an application sends a DDE message.
If the function failsa DdemlException is raised with one of the following errroCodes:
- DMLERR_DLL_USAGE
- DMLERR_INVALIDPARAMETER
- DMLERR_SYS_ERROR
- Throws:
DdemlUtil.DdemlException
-
createStringHandle
Ddeml.HSZ createStringHandle(String value) throws DdemlUtil.DdemlException
Creates a handle that identifies the specified string. A Dynamic Data Exchange (DDE) client or server application can pass the string handle as a parameter to other Dynamic Data Exchange Management Library (DDEML) functions.- Parameters:
value
- The string for which a handle is to be created. This string can be up to 255 characters. The reason for this limit is that DDEML string management functions are implemented using atoms.- Returns:
- If the function succeeds, the return value is a string
handle. A parameter NULL will cause NULL to be returned.
If the function fails, a DdemlException is raised with the corresponding errorCode:
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
- DMLERR_SYS_ERROR
- Throws:
DdemlUtil.DdemlException
-
queryString
String queryString(Ddeml.HSZ value) throws DdemlUtil.DdemlException
Copies text associated with a string handle into a buffer.- Parameters:
value
- A handle to the string to copy. This handle must have been created by a previous call to the DdeCreateStringHandle function.- Returns:
- String corresponding to the supplied handle
- Throws:
DdemlUtil.DdemlException
-
freeStringHandle
boolean freeStringHandle(Ddeml.HSZ value)
Frees a string handle in the calling application.- Parameters:
value
- A handle to the string handle to be freed. This handle must have been created by a previous call to the createStringHandle function. A NULL value will be silently ignored.- Returns:
- true if the function succeeds.
-
keepStringHandle
boolean keepStringHandle(Ddeml.HSZ value)
Increments the usage count associated with the specified handle. This function enables an application to save a string handle passed to the application's Dynamic Data Exchange (DDE) callback function. Otherwise, a string handle passed to the callback function is deleted when the callback function returns. This function should also be used to keep a copy of a string handle referenced by the CONVINFO structure returned by the DdeQueryConvInfo function.- Parameters:
value
- A handle to the string handle to be saved.- Returns:
- true if the function succeeded
-
nameService
void nameService(Ddeml.HSZ name, int afCmd) throws DdemlUtil.DdemlException
Registers or unregisters the service names a Dynamic Data Exchange (DDE) server supports. This function causes the system to send XTYP_REGISTER or XTYP_UNREGISTER transactions to other running Dynamic Data Exchange Management Library (DDEML) client applications.- Parameters:
name
- A handle to the string that specifies the service name the server is registering or unregistering. An application that is unregistering all of its service names should set this parameter to 0L.afCmd
- The service name options. This parameter can be one of the following values.Value Meaning DNS_REGISTER Registers the error code service name. DNS_UNREGISTER Unregisters the error code service name. If the hsz1 parameter is 0L, all service names registered by the server will be unregistered. DNS_FILTERON Turns on service name initiation filtering. The filter prevents a server from receiving XTYP_CONNECT transactions for service names it has not registered. This is the default setting for this filter.
If a server application does not register any service names, the application cannot receive XTYP_WILDCONNECT transactions.DNS_FILTEROFF Turns off service name initiation filtering. If this flag is specified, the server receives an XTYP_CONNECT transaction whenever another DDE application calls the DdeConnect function, regardless of the service name. If the function fails, a DdemlException is raised with the corresponding errorCode:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_DLL_USAGE
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
- Throws:
DdemlUtil.DdemlException
-
nameService
void nameService(String name, int afCmd) throws DdemlUtil.DdemlException
Registers or unregisters the service names a Dynamic Data Exchange (DDE) server supports. This function causes the system to send XTYP_REGISTER or XTYP_UNREGISTER transactions to other running Dynamic Data Exchange Management Library (DDEML) client applications.- Parameters:
name
- A string that specifies the service name the server is registering or unregistering. An application that is unregistering all of its service names should set this parameter to NULL.afCmd
- The service name options. This parameter can be one of the following values.Value Meaning DNS_REGISTER Registers the error code service name. DNS_UNREGISTER Unregisters the error code service name. If the hsz1 parameter is 0L, all service names registered by the server will be unregistered. DNS_FILTERON Turns on service name initiation filtering. The filter prevents a server from receiving XTYP_CONNECT transactions for service names it has not registered. This is the default setting for this filter.
If a server application does not register any service names, the application cannot receive XTYP_WILDCONNECT transactions.DNS_FILTEROFF Turns off service name initiation filtering. If this flag is specified, the server receives an XTYP_CONNECT transaction whenever another DDE application calls the DdeConnect function, regardless of the service name. If the function fails, a DdemlException is raised with the corresponding errorCode:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_DLL_USAGE
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
- Throws:
DdemlUtil.DdemlException
-
getLastError
int getLastError()
- Returns:
- See
Ddeml
.DMLERR_*
-
connect
DdemlUtil.IDdeConnection connect(Ddeml.HSZ service, Ddeml.HSZ topic, Ddeml.CONVCONTEXT convcontext)
Establishes a conversation with a server application that supports the specified service name and topic name pair. If more than one such server exists, the system selects only one.- Parameters:
service
- A handle to the string that specifies the service name of the server application with which a conversation is to be established. This handle must have been created by a previous call to the DdeCreateStringHandle function. If this parameter is 0L, a conversation is established with any available server.topic
- A handle to the string that specifies the name of the topic on which a conversation is to be established. This handle must have been created by a previous call to DdeCreateStringHandle. If this parameter is 0L, a conversation on any topic supported by the selected server is established.convcontext
- A pointer to the CONVCONTEXT structure that contains conversation context information. If this parameter is NULL, the server receives the default CONVCONTEXT structure during the XTYP_CONNECT or XTYP_WILDCONNECT transaction.- Returns:
- an established connection
If the function fails, a DdemlException is raised with the corresponding errorCode:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_CONV_ESTABLISHED
- DMLERR_NO_ERROR
-
connect
DdemlUtil.IDdeConnection connect(String service, String topic, Ddeml.CONVCONTEXT convcontext)
Establishes a conversation with a server application that supports the specified service name and topic name pair. If more than one such server exists, the system selects only one.- Parameters:
service
- The service name of the server application with which a conversation is to be established. If this parameter is NULL, a conversation is established with any available server.topic
- The name of the topic on which a conversation is to be established. If this parameter is NULL, a conversation on any topic supported by the selected server is established.convcontext
- A pointer to the CONVCONTEXT structure that contains conversation context information. If this parameter is NULL, the server receives the default CONVCONTEXT structure during the XTYP_CONNECT or XTYP_WILDCONNECT transaction.- Returns:
- an established connection
If the function fails, a DdemlException is raised with the corresponding errorCode:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_CONV_ESTABLISHED
- DMLERR_NO_ERROR
-
createDataHandle
Ddeml.HDDEDATA createDataHandle(Pointer pSrc, int cb, int cbOff, Ddeml.HSZ hszItem, int wFmt, int afCmd)
Creates a Dynamic Data Exchange (DDE) object and fills the object with data from the specified buffer. A DDE application uses this function during transactions that involve passing data to the partner application.- Parameters:
pSrc
- The data to be copied to the DDE object. If this parameter is NULL, no data is copied to the object.cb
- The amount of memory, in bytes, to copy from the buffer pointed to by pSrc. (include the terminating NULL, if the data is a string). If this parameter is zero, the pSrc parameter is ignored.cbOff
- An offset, in bytes, from the beginning of the buffer pointed to by the pSrc parameter. The data beginning at this offset is copied from the buffer to the DDE object.hszItem
- A handle to the string that specifies the data item corresponding to the DDE object. This handle must have been created by a previous call to the DdeCreateStringHandle function. If the data handle is to be used in an XTYP_EXECUTE transaction, this parameter must be 0L.wFmt
- The standard clipboard format of the data.afCmd
- The creation flags. This parameter can be HDATA_APPOWNED, which specifies that the server application calling the DdeCreateDataHandle function owns the data handle this function creates. This flag enables the application to share the data handle with other DDEML applications rather than creating a separate handle to pass to each application. If this flag is specified, the application must eventually free the shared memory object associated with the handle by using the DdeFreeDataHandle function. If this flag is not specified, the handle becomes invalid in the application that created the handle after the data handle is returned by the application's DDE callback function or is used as a parameter in another DDEML function.- Returns:
- If the function succeeds, the return value is a data handle.
If the function fails a DdeException is raised with the following errorCodes:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_MEMORY_ERROR
- DMLERR_NO_ERROR
-
freeDataHandle
void freeDataHandle(Ddeml.HDDEDATA hData)
Frees a Dynamic Data Exchange (DDE) object and deletes the data handle associated with the object.- Parameters:
hData
- A handle to the DDE object to be freed. This handle must have been created by a previous call to the DdeCreateDataHandle function or returned by the DdeClientTransaction function.If the function fails a DdeException is raised with the following errorCodes:
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
-
addData
Ddeml.HDDEDATA addData(Ddeml.HDDEDATA hData, Pointer pSrc, int cb, int cbOff)
Adds data to the specified Dynamic Data Exchange (DDE) object. An application can add data starting at any offset from the beginning of the object. If new data overlaps data already in the object, the new data overwrites the old data in the bytes where the overlap occurs. The contents of locations in the object that have not been written to are undefined.- Parameters:
hData
- A handle to the DDE object that receives additional data.pSrc
- The data to be added to the DDE object.cb
- The length, in bytes, of the data to be added to the DDE object, including the terminating NULL, if the data is a string.cbOff
- An offset, in bytes, from the beginning of the DDE object. The additional data is copied to the object beginning at this offset.- Returns:
- If the function succeeds, the return value is a new handle to
the DDE object. The new handle is used in all references to the
object.
If the function fails a DdeException is raised with the following errorCodes:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_MEMORY_ERROR
- DMLERR_NO_ERROR
-
getData
int getData(Ddeml.HDDEDATA hData, Pointer pDst, int cbMax, int cbOff)
Copies data from the specified Dynamic Data Exchange (DDE) object to the specified local buffer.- Parameters:
hData
- A handle to the DDE object that contains the data to copy.pDst
- A pointer to the buffer that receives the data. If this parameter is NULL, the DdeGetData function returns the amount of data, in bytes, that would be copied to the buffer.cbMax
- The maximum amount of data, in bytes, to copy to the buffer pointed to by the pDst parameter. Typically, this parameter specifies the length of the buffer pointed to by pDst.cbOff
- An offset within the DDE object. Data is copied from the object beginning at this offset.- Returns:
- If the pDst parameter points to a buffer, the return value is
the size, in bytes, of the memory object associated with the data
handle or the size specified in the cbMax parameter, whichever is
lower.
If the function fails a DdeException is raised with the following errorCodes:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
-
accessData
Pointer accessData(Ddeml.HDDEDATA hData, WinDef.DWORDByReference pcbDataSize)
An application must call the DdeUnaccessData function when it has finished accessing the data in the object.- Parameters:
hData
- A handle to the DDE object to be accessed.pcbDataSize
- A pointer to a variable that receives the size, in bytes, of the DDE object identified by the hData parameter. If this parameter is NULL, no size information is returned.- Returns:
- If the function succeeds, the return value is a pointer to
the first byte of data in the DDE object.
If the function fails a DdeException is raised with the following errorCodes:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
-
unaccessData
void unaccessData(Ddeml.HDDEDATA hData)
Unaccesses a Dynamic Data Exchange (DDE) object. An application must call this function after it has finished accessing the object.- Parameters:
hData
- A handle to the DDE object.If the function fails a DdeException is raised with the following errorCodes:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
-
postAdvise
void postAdvise(Ddeml.HSZ hszTopic, Ddeml.HSZ hszItem)
Causes the system to send an XTYP_ADVREQ transaction to the calling (server) application's Dynamic Data Exchange (DDE) callback function for each client with an active advise loop on the specified topic and item. A server application should call this function whenever the data associated with the topic name or item name pair changes.- Parameters:
hszTopic
- A handle to a string that specifies the topic name. To send notifications for all topics with active advise loops, an application can set this parameter to 0L.hszItem
- A handle to a string that specifies the item name. To send notifications for all items with active advise loops, an application can set this parameter to 0L.If the function fails a DdeException is raised with the following errorCodes:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_DLL_USAGE
- DMLERR_NO_ERROR
-
postAdvise
void postAdvise(String hszTopic, String hszItem)
Causes the system to send an XTYP_ADVREQ transaction to the calling (server) application's Dynamic Data Exchange (DDE) callback function for each client with an active advise loop on the specified topic and item. A server application should call this function whenever the data associated with the topic name or item name pair changes.- Parameters:
hszTopic
- A string that specifies the topic name. To send notifications for all topics with active advise loops, an application can set this parameter to NULL.hszItem
- A string that specifies the item name. To send notifications for all items with active advise loops, an application can set this parameter to NULL.If the function fails a DdeException is raised with the following errorCodes:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_DLL_USAGE
- DMLERR_NO_ERROR
-
abandonTransactions
void abandonTransactions()
Abandons all asynchronous transaction and releases all resources associated with the transaction.If the method fails a DdeException will be raised with the corresponding errorCode:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
- DMLERR_UNFOUND_QUEUE_ID
-
connectList
DdemlUtil.IDdeConnectionList connectList(Ddeml.HSZ service, Ddeml.HSZ topic, DdemlUtil.IDdeConnectionList existingList, Ddeml.CONVCONTEXT ctx)
Establishes a conversation with all server applications that support the specified service name and topic name pair. An application can also use this function to obtain a list of conversation handles by passing the function an existing conversation handle. The Dynamic Data Exchange Management Library removes the handles of any terminated conversations from the conversation list. The resulting conversation list contains the handles of all currently established conversations that support the specified service name and topic name.- Parameters:
service
- A handle to the string that specifies the service name of the server application with which a conversation is to be established. If this parameter is 0L, the system attempts to establish conversations with all available servers that support the specified topic name.topic
- A handle to the string that specifies the name of the topic on which a conversation is to be established. This handle must have been created by a previous call to the DdeCreateStringHandle function. If this parameter is 0L, the system will attempt to establish conversations on all topics supported by the selected server (or servers).existingList
- An existinct conversation list to be enumerated. This parameter should be NULL if a new conversation list is to be established.ctx
- A pointer to the CONVCONTEXT structure that contains conversation-context information. If this parameter is NULL, the server receives the default CONVCONTEXT structure during the XTYP_CONNECT or XTYP_WILDCONNECT transaction.- Returns:
- The new ConnectionList
If the function fails a DdeException is raised with the appropriate errorCode:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_CONV_ESTABLISHED
- DMLERR_NO_ERROR
- DMLERR_SYS_ERROR
-
connectList
DdemlUtil.IDdeConnectionList connectList(String service, String topic, DdemlUtil.IDdeConnectionList existingList, Ddeml.CONVCONTEXT ctx)
Establishes a conversation with all server applications that support the specified service name and topic name pair. An application can also use this function to obtain a list of conversation handles by passing the function an existing conversation handle. The Dynamic Data Exchange Management Library removes the handles of any terminated conversations from the conversation list. The resulting conversation list contains the handles of all currently established conversations that support the specified service name and topic name.- Parameters:
service
- A string that specifies the service name of the server application with which a conversation is to be established. If this parameter is NULL, the system attempts to establish conversations with all available servers that support the specified topic name.topic
- A string that specifies the name of the topic on which a conversation is to be established. If this parameter is NULL, the system will attempt to establish conversations on all topics supported by the selected server (or servers).existingList
- An existinct conversation list to be enumerated. This parameter should be NULL if a new conversation list is to be established.ctx
- A pointer to the CONVCONTEXT structure that contains conversation-context information. If this parameter is NULL, the server receives the default CONVCONTEXT structure during the XTYP_CONNECT or XTYP_WILDCONNECT transaction.- Returns:
- The new ConnectionList
If the function fails a DdeException is raised with the appropriate errorCode:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_CONV_ESTABLISHED
- DMLERR_NO_ERROR
- DMLERR_SYS_ERROR
-
enableCallback
boolean enableCallback(int wCmd)
Enables or disables transactions for a specific conversation or for all conversations currently established by the calling application.- Parameters:
wCmd
- The function code. This parameter can be one of the following values.Value Meaning EC_ENABLEALL Enables all transactions for the specified conversation. EC_ENABLEONE Enables one transaction for the specified conversation. EC_DISABLE Disables all blockable transactions for the specified conversation. A server application can disable the following transactions:
- XTYP_ADVSTART
- XTYP_ADVSTOP
- XTYP_EXECUTE
- XTYP_POKE
- XTYP_REQUEST
A client application can disable the following transactions:
- XTYP_ADVDATA
- XTYP_XACT_COMPLETE
EC_QUERYWAITING Determines whether any transactions are in the queue for the specified conversation. - Returns:
- If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
If the wCmd parameter is EC_QUERYWAITING, and the application transaction queue contains one or more unprocessed transactions that are not being processed, the return value is TRUE; otherwise, it is FALSE.
If the function fails a DdeException is raised with the appropriate errorCode:
- DMLERR_DLL_NOT_INITIALIZED
- DMLERR_INVALIDPARAMETER
- DMLERR_NO_ERROR
-
uninitialize
boolean uninitialize()
Frees all Dynamic Data Exchange Management Library (DDEML) resources associated with the calling application.- Returns:
- true if function succeeded
-
wrap
DdemlUtil.IDdeConnection wrap(Ddeml.HCONV conv)
Wrap a connection handle into a IDdeConnection helper class.- Parameters:
conv
- HCONV structure to wrap- Returns:
- wrapped IDdeConnection
-
registerAdvstartHandler
void registerAdvstartHandler(DdemlUtil.AdvstartHandler handler)
-
unregisterAdvstartHandler
void unregisterAdvstartHandler(DdemlUtil.AdvstartHandler handler)
-
registerAdvstopHandler
void registerAdvstopHandler(DdemlUtil.AdvstopHandler handler)
-
unregisterAdvstopHandler
void unregisterAdvstopHandler(DdemlUtil.AdvstopHandler handler)
-
registerConnectHandler
void registerConnectHandler(DdemlUtil.ConnectHandler handler)
-
unregisterConnectHandler
void unregisterConnectHandler(DdemlUtil.ConnectHandler handler)
-
registerAdvReqHandler
void registerAdvReqHandler(DdemlUtil.AdvreqHandler handler)
-
unregisterAdvReqHandler
void unregisterAdvReqHandler(DdemlUtil.AdvreqHandler handler)
-
registerRequestHandler
void registerRequestHandler(DdemlUtil.RequestHandler handler)
-
unregisterRequestHandler
void unregisterRequestHandler(DdemlUtil.RequestHandler handler)
-
registerWildconnectHandler
void registerWildconnectHandler(DdemlUtil.WildconnectHandler handler)
-
unregisterWildconnectHandler
void unregisterWildconnectHandler(DdemlUtil.WildconnectHandler handler)
-
registerAdvdataHandler
void registerAdvdataHandler(DdemlUtil.AdvdataHandler handler)
-
unregisterAdvdataHandler
void unregisterAdvdataHandler(DdemlUtil.AdvdataHandler handler)
-
registerExecuteHandler
void registerExecuteHandler(DdemlUtil.ExecuteHandler handler)
-
unregisterExecuteHandler
void unregisterExecuteHandler(DdemlUtil.ExecuteHandler handler)
-
registerPokeHandler
void registerPokeHandler(DdemlUtil.PokeHandler handler)
-
unregisterPokeHandler
void unregisterPokeHandler(DdemlUtil.PokeHandler handler)
-
registerConnectConfirmHandler
void registerConnectConfirmHandler(DdemlUtil.ConnectConfirmHandler handler)
-
unregisterConnectConfirmHandler
void unregisterConnectConfirmHandler(DdemlUtil.ConnectConfirmHandler handler)
-
registerDisconnectHandler
void registerDisconnectHandler(DdemlUtil.DisconnectHandler handler)
-
unregisterDisconnectHandler
void unregisterDisconnectHandler(DdemlUtil.DisconnectHandler handler)
-
registerErrorHandler
void registerErrorHandler(DdemlUtil.ErrorHandler handler)
-
unregisterErrorHandler
void unregisterErrorHandler(DdemlUtil.ErrorHandler handler)
-
registerRegisterHandler
void registerRegisterHandler(DdemlUtil.RegisterHandler handler)
-
unregisterRegisterHandler
void unregisterRegisterHandler(DdemlUtil.RegisterHandler handler)
-
registerXactCompleteHandler
void registerXactCompleteHandler(DdemlUtil.XactCompleteHandler handler)
-
unregisterXactCompleteHandler
void unregisterXactCompleteHandler(DdemlUtil.XactCompleteHandler handler)
-
registerUnregisterHandler
void registerUnregisterHandler(DdemlUtil.UnregisterHandler handler)
-
unregisterUnregisterHandler
void unregisterUnregisterHandler(DdemlUtil.UnregisterHandler handler)
-
registerMonitorHandler
void registerMonitorHandler(DdemlUtil.MonitorHandler handler)
-
unregisterMonitorHandler
void unregisterMonitorHandler(DdemlUtil.MonitorHandler handler)
-
-