11.04.2014 Views

Advanced MFC Programming

Advanced MFC Programming

Advanced MFC Programming

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 16. Context Sensitive Help<br />

Summary<br />

1) To support DDE in an application, function ::DdeInitialize(…) must be called to initialize it; also,<br />

before the application exits, function ::DdeUninitialize(…) must be called to uninitialize the DDE.<br />

1) The server must register DDE service by calling function ::DdeNameService(…). Before the server<br />

exits, it must call the same function to unregister the service.<br />

1) Before DDE client initiates any transaction, it must call function ::DdeConnect(…) to obtain a<br />

conversation handle that can be used to identify the server in the following transactions.<br />

1) A server can support several topics, under each topic there may be several items supported. When<br />

initiating a transaction, the client need to specify both of them.<br />

5) Data can not be exchanged directly between two processes. Instead, it must be sent either by data<br />

handle or by DDE object. In the former case, the data can be accessed by calling functions<br />

::DdeAccessData(…). Function ::DdeUnaccessData(…) can be used to unaccess data and<br />

::DdeFreeDataHandle(…) can be used to free data. In the later case, the data can be retrieved by<br />

calling function ::DdeGetData(…). To create a data handle, we can use function<br />

::DdeCreateDataHandle(…).<br />

1) In DDE model, two strings can be compared by their handles. In order to do this, we need to call<br />

function ::DdeCmpStringHandles(…).<br />

1) Data request transaction can be used to request data from the server.<br />

1) Advise transaction can be used to let the client monitor the changes on the data stored on the server<br />

side.<br />

1) Poke transaction can be used by the client to update the data stored on the server side.<br />

1) Execute transaction can be used by the client to let commands be executed on the server side.<br />

1) There are two types of transmission modes: synchronous and asynchronous. Synchronous transaction<br />

is easy to implement, but asynchronous transaction is more efficient under certain conditions.<br />

1) Program Manager is a DDE server that supports execute transaction.<br />

480

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!