interfdde.C File Reference

#include "interfdde.h"
#include "win_mem_alloc.h"

Include dependency graph for interfdde.C:

Go to the source code of this file.

Defines

#define MSG_ERROR14   "parameter(s) type incorrect.\r\n"
#define MSG_ERROR15   "2 parameters required.\r\n"

Functions

int InterfaceWindowsDDEopen _PARAMS ((char *fname))


Define Documentation

#define MSG_ERROR14   "parameter(s) type incorrect.\r\n"

Definition at line 6 of file interfdde.C.

#define MSG_ERROR15   "2 parameters required.\r\n"

Definition at line 7 of file interfdde.C.


Function Documentation

int InterfaceWindowsDDEopen _PARAMS ( (char *fname  ) 

Definition at line 9 of file interfdde.C.

References CheckLhs, CheckRhs, CreateVarFromPtr, cstk, DDEOpenConnection(), FALSE, FREE, GetRhsVar, GetType, LhsVar, m1, MALLOC, Max, MSG_ERROR14, MSG_ERROR15, n1, NULL, Rhs, sci_strings, and TRUE.

00010 {
00011         static int l1,n1,m1;
00012         Rhs=Max(0,Rhs);
00013         CheckRhs(2,2);
00014         CheckLhs(0,1);
00015 
00016         if (Rhs == 2)
00017         {
00018                 int TypeVar1=GetType(1);
00019                 int TypeVar2=GetType(2);
00020 
00021                 if ( (TypeVar1 == sci_strings) && (TypeVar2 == sci_strings) )
00022                 {
00023                         char *param1=NULL,*param2=NULL;
00024                         
00025                         GetRhsVar(1,"c",&m1,&n1,&l1);
00026                     param1=cstk(l1);
00027 
00028                         GetRhsVar(2,"c",&m1,&n1,&l1);
00029                     param2=cstk(l1);
00030 
00031                         if ( DDEOpenConnection(param1,param2) )
00032                         {
00033                                 int *paramoutINT=(int*)MALLOC(sizeof(int));
00034                                 *paramoutINT=(int)(TRUE);
00035                                 n1=1;
00036                                 CreateVarFromPtr(1, "i", &n1, &n1, &paramoutINT);
00037                                 LhsVar(1)=1;
00038                                 FREE(paramoutINT);
00039                         }
00040                         else
00041                         {
00042                                 int *paramoutINT=(int*)MALLOC(sizeof(int));
00043                                 *paramoutINT=(int)(FALSE);
00044                                 n1=1;
00045                                 CreateVarFromPtr(1, "i", &n1, &n1, &paramoutINT);
00046                                 LhsVar(1)=1;
00047                                 FREE(paramoutINT);
00048                         }
00049                 }
00050                 else 
00051                 {
00052                         Scierror(999,MSG_ERROR14);
00053                 }
00054         }
00055         else
00056         {
00057                 Scierror(999,MSG_ERROR15);
00058         }
00059         return 0;
00060 }

Here is the call graph for this function:


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