| 1 | // Header for using DDEClient.dll in other C/C++ programs |
|---|
| 2 | // |
|---|
| 3 | // Author: Robert Matovinovic |
|---|
| 4 | // Version: 0.02 |
|---|
| 5 | // Date: 04.10.2006 |
|---|
| 6 | // |
|---|
| 7 | #include "windows.h" |
|---|
| 8 | |
|---|
| 9 | // DDE data structure for access data received by DDE transaction |
|---|
| 10 | typedef struct { |
|---|
| 11 | // pointer to begin of dde data returned by DdeAccessData |
|---|
| 12 | BYTE* pData; |
|---|
| 13 | // length of dde data returned by DdeAccessData |
|---|
| 14 | DWORD dwLen; |
|---|
| 15 | // string pointer to dde data, if the data should accessed as string |
|---|
| 16 | char* pszData; |
|---|
| 17 | // ID of transaction, used to determine completion of asynchronous transaction |
|---|
| 18 | DWORD dwTransID; |
|---|
| 19 | // ID of transaction, returned by callback function with asynch. transaction |
|---|
| 20 | DWORD dwCbTransID; |
|---|
| 21 | // string for access type of data |
|---|
| 22 | char szAccType[7]; |
|---|
| 23 | } DCDATAACCESS; |
|---|
| 24 | |
|---|
| 25 | #define DCDllImport extern "C" _declspec( dllimport ) |
|---|
| 26 | |
|---|
| 27 | // |
|---|
| 28 | // imported variables |
|---|
| 29 | // |
|---|
| 30 | // boolean used by DCLastError |
|---|
| 31 | DCDllImport bool bDCErrorExport; |
|---|
| 32 | // pointer to dde data access structure |
|---|
| 33 | DCDllImport DCDATAACCESS* *DCDA; |
|---|
| 34 | |
|---|
| 35 | // |
|---|
| 36 | // imported functions |
|---|
| 37 | // |
|---|
| 38 | DCDllImport bool DCRequestString(WORD wC, |
|---|
| 39 | char szItem[], |
|---|
| 40 | int nTimeout); |
|---|
| 41 | DCDllImport bool DCRequest(WORD wC, |
|---|
| 42 | char szItem[], |
|---|
| 43 | char szFormat[], |
|---|
| 44 | int nTimeout ); |
|---|
| 45 | DCDllImport bool DCTransaction(WORD wC, |
|---|
| 46 | char szType[], |
|---|
| 47 | char szItem[], |
|---|
| 48 | char szData[], |
|---|
| 49 | char szFormat[], |
|---|
| 50 | int nTimeout, |
|---|
| 51 | char szAccess[]); |
|---|
| 52 | DCDllImport bool DCConnect(WORD* pConvNo, |
|---|
| 53 | char szService[], |
|---|
| 54 | char szTopic[]); |
|---|
| 55 | DCDllImport bool DCDisconnect(WORD wConvNo); |
|---|
| 56 | DCDllImport bool DCInit(); |
|---|
| 57 | DCDllImport bool DCUninit(); |
|---|
| 58 | DCDllImport char* DCLastError(); |
|---|
| 59 | DCDllImport bool DCAsynchTransactionCompleted(WORD wC, DWORD dwTransID, bool bWait); |
|---|
| 60 | DCDllImport bool DCFreeDdeMem(WORD wC); |
|---|
| 61 | DCDllImport void DCFinalize(); |
|---|
| 62 | DCDllImport bool DCAbandonTransaction(WORD wC, DWORD dwTransID); |
|---|
| 63 | DCDllImport char* DCVersion(); |
|---|
| 64 | |
|---|