home *** CD-ROM | disk | FTP | other *** search
- //*************************************************************
- // File name: MYRCMD.H
- //
- //*************************************************************
-
- #ifndef INC_MYRCMD_H
- #define INC_MYRCMD_H
-
- #ifndef IGBOOL
- #ifdef __WIN32
- typedef int IGBOOL;
- #else
- typedef long IGBOOL;
- #endif
- #endif
-
- #include "myrddedf.h"
- #include "vwdde.h"
-
- #define CONNECT_RETRY_COUNT (50) /* Number of times to retry the operation */
- #define DEFAULT_TIMEOUT_VALUE (1000) /* Time in milliseconds for synchronous sends */
- #define POP_MESSAGE_QUEUE (WM_USER+55)
-
- #define MESSAGE_QUEUE_WINDOW_NAME "QueueWindow"
-
- typedef struct {
- void *Next;
- void *pData;
- } QueueMessage, *pQueueMessage;
-
- typedef struct {
- HANDLE hThreadDLLHandle; /* Handle to the DLL for the process */
- DWORD hInstance; /* Instance of the DDEML attach */
- HCONV hConversation; /* The DDEML conversation handle */
- HSZ hServerName; /* Global handle of our server name */
- HSZ hTopicName; /* Global handle of our topic name */
- HSZ hItemName; /* Global handle of our item name */
- HWND hNotifyWindow; /* Handle of client window for notifications */
- DWORD lTransID; /* DDEML Client transaction result */
- BOOL bForceSynchronous; /* If must perform execution synchronously */
- LPSTR pServerName; /* String format of server name - user specified */
- BOOL bExecutionReturn; /* Flag indicating an execution_return message occurred */
- HWND hQueueWindow; /* The window that is used by the message queue */
- pQueueMessage pMessageQHead; /* The head of the message queue */
- pQueueMessage pMessageQTail; /* The tail of the message queue */
- int nNumberMessages; /* The number of messages in the message queue */
- CRITICAL_SECTION CriticalSection; /* The semaphore used to control message queue access */
- } DDE_DATA;
-
- /* Internal DLL routines */
- HDDEDATA EXPENTRY DDECallback(WORD wType, WORD wFmt, HCONV hConv, HSZ hsz1,
- HSZ hsz2, HDDEDATA hData, DWORD lData1, DWORD lData2);
-
- BOOL ddeInit(void);
- void ddeUnInit(void);
- HDDEDATA PerformClientSend(void *pData, DWORD lDataLength, UINT uType, BOOL bSync);
- DWORD CalculateAllocationLength(ExecutionCommandType Command, void *pData);
- void InitializeDDEControlBlock(void);
- void ClearDDEControlBlock(void);
- void FreeDDEServerNameString(void);
- void DestroyDDEControlBlock(void);
- BOOL WaitForExecReturn(void);
-
- // queue funcs
- void AddToMessageQ(LPARAM pData);
- pQueueMessage PopMessageQ(void);
- int NumberMessagesInQ(void);
- void ClearMessageQ(void);
- void DeleteQMessage(pQueueMessage pMsg);
-
- // queue window funcs
- void startQueueWindow(DDE_DATA *pDDEData);
- void stopQueueWindow(DDE_DATA *pDDEData);
- long FAR PASCAL QueueProc(HWND hWnd, unsigned iMessage, WORD wParam, LONG lParam);
-
- #endif // INC_MYRCMD_H
-