DDE.h File Reference

#include <windows.h>

Include dependency graph for DDE.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

BOOL DDEExecute (char *szCommand, int TimeOut)
BOOL DDERequest (char *szItem, int TimeOut, char *Result)
BOOL DDEPoke (char *szItem, char *szData, int TimeOut)
BOOL DDEOpenConnection (char *strServeur, char *strTopic)
BOOL DDECloseConnection (void)
BOOL DDEIsOpen (void)


Function Documentation

BOOL DDECloseConnection ( void   ) 

Definition at line 66 of file DDE.c.

References DDEInUse, FALSE, hConv, idInst, NULL, and TRUE.

Referenced by _PARAMS().

00067 {
00068         BOOL bOK=FALSE;
00069 
00070         if (DDEInUse)
00071         {
00072                 DDEInUse=FALSE;
00073                 DdeDisconnect(hConv);
00074                 DdeUninitialize(idInst);
00075                 idInst=0;
00076                 hConv=NULL;
00077                 bOK=TRUE;
00078         }
00079         else
00080         {
00081                 bOK=FALSE;
00082         }
00083         return bOK;
00084 }

Here is the caller graph for this function:

BOOL DDEExecute ( char *  szCommand,
int  TimeOut 
)

Definition at line 86 of file DDE.c.

References FALSE, hConv, idInst, L, NULL, and TRUE.

00087 {
00088         BOOL bOK=TRUE;
00089 
00090     HDDEDATA hData = DdeCreateDataHandle(idInst, (LPBYTE)szCommand,
00091                                lstrlen(szCommand)+1, 0, NULL, CF_TEXT, 0);
00092     if (hData==NULL)
00093         {
00094                 bOK=FALSE;        
00095     }
00096     else    
00097         {
00098                 HDDEDATA ReturnValue=NULL;
00099                 bOK=TRUE;
00100                 if (TimeOut>0)
00101                 {
00102                         TimeOut=TIMEOUT_ASYNC;
00103                 }
00104 
00105                 ReturnValue=DdeClientTransaction((LPBYTE)hData, 0xFFFFFFFF, hConv, 0L, 0,
00106                              XTYP_EXECUTE, TimeOut, NULL);
00107                 
00108                 if (!ReturnValue) bOK=FALSE;
00109     }
00110         return bOK;
00111 }

BOOL DDEIsOpen ( void   ) 

Definition at line 25 of file DDE.c.

References DDEInUse.

00026 {
00027         return DDEInUse;
00028 }

BOOL DDEOpenConnection ( char *  strServeur,
char *  strTopic 
)

Definition at line 30 of file DDE.c.

References DdeCallback(), DDEInUse, FALSE, hConv, idInst, NULL, TRUE, and UINT.

Referenced by _PARAMS().

00031 {
00032         UINT iReturn=DMLERR_NO_ERROR;
00033         BOOL bOK=TRUE;
00034         
00035         if (DDEInUse)
00036         {
00037                 bOK=FALSE;
00038         }
00039         else
00040         {
00041                 iReturn = DdeInitialize(&idInst, (PFNCALLBACK)DdeCallback, 
00042                             APPCLASS_STANDARD | APPCMD_CLIENTONLY, 0 );
00043                 if (iReturn!=DMLERR_NO_ERROR)
00044                 {
00045                         bOK=FALSE;
00046                 }
00047                 else
00048                 {
00049                         HSZ hszApp, hszTopic;
00050                         hszApp = DdeCreateStringHandle(idInst, strServeur, 0);
00051                         hszTopic = DdeCreateStringHandle(idInst, strTopic, 0);
00052                         hConv = DdeConnect(idInst, hszApp, hszTopic, NULL);
00053                         DdeFreeStringHandle(idInst, hszApp);
00054                         DdeFreeStringHandle(idInst, hszTopic);
00055                         if (hConv == NULL)
00056                         {
00057                                 DdeUninitialize(idInst);
00058                                 bOK=FALSE;
00059                         }
00060                         DDEInUse=TRUE;
00061                 }
00062         }
00063     return bOK;
00064 }

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL DDEPoke ( char *  szItem,
char *  szData,
int  TimeOut 
)

Definition at line 140 of file DDE.c.

References FALSE, hConv, idInst, NULL, and TRUE.

00141 {
00142         BOOL bOK=TRUE;
00143         HDDEDATA ReturnValue=NULL;
00144 
00145     HSZ hszItem = DdeCreateStringHandle(idInst, szItem, 0);
00146         if ( TimeOut < 0 )
00147         {
00148                 TimeOut=3000;
00149         }
00150         
00151         ReturnValue=DdeClientTransaction((LPBYTE)szData, (DWORD)(lstrlen(szData)+1),
00152                                                         hConv, hszItem, CF_TEXT,
00153                                                         XTYP_POKE, TimeOut, NULL);
00154 
00155         if (!ReturnValue) bOK=FALSE;
00156     if (!DdeFreeStringHandle(idInst, hszItem)) bOK=FALSE;
00157 
00158         return bOK;
00159 }

BOOL DDERequest ( char *  szItem,
int  TimeOut,
char *  Result 
)

Definition at line 113 of file DDE.c.

References FALSE, hConv, idInst, NULL, and TRUE.

00114 {
00115         BOOL bOK=FALSE;
00116         HDDEDATA hData =NULL;
00117 
00118     HSZ hszItem = DdeCreateStringHandle(idInst, szItem, 0);
00119 
00120         if ( TimeOut < 0 )
00121         {
00122                 TimeOut=3000;
00123         }
00124         
00125         hData = DdeClientTransaction(NULL,0,hConv,hszItem,CF_TEXT, 
00126                                  XTYP_REQUEST,TimeOut, NULL);
00127     if (hData==NULL)
00128     {
00129         bOK=FALSE;
00130     }
00131     else
00132     {
00133         DdeGetData(hData, (unsigned char *)Result, (DWORD)strlen(Result), 0);
00134                 if ( DdeGetLastError(idInst) == DMLERR_NO_ERROR ) bOK=TRUE;
00135     }
00136 
00137         return bOK;
00138 }


Generated on Sun Mar 4 16:14:16 2007 for Scilab [trunk] by  doxygen 1.5.1