DdePostAdvise function

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.

Syntax


BOOL WINAPI DdePostAdvise(
  _In_  DWORD idInst,
  _In_  HSZ hszTopic,
  _In_  HSZ hszItem
);

Parameters

idInst [in]

Type: DWORD

The application instance identifier obtained by a previous call to the DdeInitialize function.

hszTopic [in]

Type: HSZ

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 [in]

Type: HSZ

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.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

The DdeGetLastError function can be used to get the error code, which can be one of the following values:

DMLERR_DLL_NOT_INITIALIZED
DMLERR_DLL_USAGE
DMLERR_NO_ERROR

Remarks

A server that has nonenumerable topics or items should set the hszTopic and hszItem parameters to NULL so that the system generates transactions for all active advise loops. The server's DDE callback function returns NULL for any advise loops that must not be updated.

If a server calls DdePostAdvise with a topic, item, and format name set that includes the set currently being handled in an XTYP_ADVREQ callback, a stack overflow can result.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Ddeml.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
DdeInitialize
XTYP_ADVREQ
Conceptual
Dynamic Data Exchange Management Library

 

 

Community Additions

ADD
Show:
© 2014 Microsoft