Advertisement
Guest User

pmospipe.h

a guest
Aug 24th, 2013
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 13.96 KB | None | 0 0
  1.    
  2. #ifndef _PIPESDLL_H
  3. #define _PIPESDLL_H
  4.  
  5.  
  6. #ifdef _DEBUG
  7. #pragma comment (lib, "\\PROMOS16\\lib\\pmospipeD.lib")
  8. #else
  9. #pragma comment (lib, "\\PROMOS16\\lib\\pmospipe.lib")
  10. #endif
  11.  
  12.  
  13. #define NO_PIPE_EXISTS      -2
  14. #define TOO_MANY_PIPES      -3
  15. #define PIPE_EXISTS         -4
  16. #define NO_POINT_EXISTS     -5  // equivalent zu DMS: POINT_NOT_EXIST=2
  17. #define NO_TYPE_MATCH       -6
  18.  
  19. #define PROJ_DIR    "Proj"
  20.  
  21.  
  22. // Filter für Remote-GE und WebServer: "System:Node:NODExy:ABC.." -> "System:Node:<akt.Adr>:ABC.."
  23. void SetLanguageIdxStr(TCHAR* sPCName, TCHAR* sLanguage, int nLanguage);    // set language for all connections from this PCName
  24.  
  25.  
  26. int _stdcall ReceiveBlocking(SOCKET sock, char *buffer, int len);
  27. int _stdcall SendBlocking(SOCKET sock, const char FAR *buffer, int len);
  28. int _stdcall SendNonBlocking(clientEx *cl, const char FAR *buffer, int len);
  29.  
  30.  
  31. // Callback access (non-blocking) to DMS ///////////////////////////////////////////////////////
  32. // ZS 19.11.2010: neu _cdecl anstatt _stdcall: wegen C# Anbindung
  33. int /*_cdecl*/ _stdcall ConnectDMSidle(TCHAR *lpszPipename,client *cl,int (*fun_ptr)(comm *msg),int (*idle_ptr)(comm *msg));
  34. int /*_cdecl*/ _stdcall ConnectDMSidleEx(TCHAR *lpszPipename,clientEx *cl,int (*fun_ptr)(comm *msg),int (*idle_ptr)(comm *msg));
  35. int /*_cdecl*/ _stdcall ConnectDMS(TCHAR *lpszPipename,client *cl,int (*fun_ptr)(comm *msg));
  36. int /*_cdecl*/ _stdcall ConnectDMSEx(TCHAR *lpszPipename,clientEx *cl,int (*fun_ptr)(comm *msg));
  37. int /*_cdecl*/ _stdcall DisconnectDMS(client* cl);
  38. int /*_cdecl*/ _stdcall DisconnectDMSEx(clientEx* cl);
  39.  
  40. int _stdcall SendPipe(comm *msg,client *cl);            // Old function non blocking
  41. int _stdcall SendPipeEx(comm *msg,clientEx *cl);        // New function non blocking
  42. int _stdcall SendPipeBulkEx(comm *msg, clientEx *cl, int nBulkLen);
  43. int _stdcall SendPrgName(client* dms, TCHAR* name);
  44. int _stdcall SendPrgNameEx(clientEx* dms, TCHAR* name);
  45.  
  46. int _stdcall RegisterDMS(client* dms, char* name, int obj_id);
  47. int _stdcall RegisterDMSEx(clientEx* dms, char* name, int obj_id);
  48. int _stdcall RegRightsDMS(clientEx* dms, char* name, int obj_id);
  49. int _stdcall UnregisterDMS(client* dms, char* name, int obj_id);    // Old function non blocking
  50. int _stdcall UnregisterDMSEx(clientEx* dms, char* name, int obj_id);// New function non blocking
  51.  
  52. int _stdcall SendBitDMS(client* dms, TCHAR* name, tBIT wert);
  53. int _stdcall SendBitDMSEx(clientEx* dms, TCHAR* name, tBIT wert);
  54. int _stdcall SendBysDMS(client* dms, TCHAR* name, tBYS wert);
  55. int _stdcall SendBysDMSEx(clientEx* dms, TCHAR* name, tBYS wert);
  56. int _stdcall SendByuDMS(client* dms, TCHAR* name, tBYU wert);
  57. int _stdcall SendByuDMSEx(clientEx* dms, TCHAR* name, tBYU wert);
  58. int _stdcall SendWosDMS(client* dms, TCHAR* name, tWOS wert);
  59. int _stdcall SendWosDMSEx(clientEx* dms, TCHAR* name, tWOS wert);
  60. int _stdcall SendWouDMS(client* dms, TCHAR* name, tWOU wert);
  61. int _stdcall SendWouDMSEx(clientEx* dms, TCHAR* name, tWOU wert);
  62. int _stdcall SendDwsDMS(client* dms, TCHAR* name, tDWS wert);
  63. int _stdcall SendDwsDMSEx(clientEx* dms, TCHAR* name, tDWS wert);
  64. int _stdcall SendDwuDMS(client* dms, TCHAR* name, tDWU wert);
  65. int _stdcall SendDwuDMSEx(clientEx* dms, TCHAR* name, tDWU wert);
  66. int _stdcall SendFltDMS(client* dms, TCHAR* name, tFLT wert);
  67. int _stdcall SendFltDMSEx(clientEx* dms, TCHAR* name, tFLT wert);
  68. int _stdcall SendStrDMS(client* dms, TCHAR* name, tSTR* wert);
  69. int _stdcall SendStrDMSEx(clientEx* dms, TCHAR* name, tSTR* wert);
  70.  
  71. // return last error of previous operation (=GetLastError() or =0 if OK)
  72. int _stdcall    DMS_Error(void);
  73.  
  74. // Direct access (blocking) to DMS ///////////////////////////////////////////////////////
  75. int _stdcall    DMS_Connect(TCHAR *lpszPipename, HANDLE& pipe);
  76. int _stdcall    DMS_ConnectEx(TCHAR *lpszPipename, int& idx);
  77. int _stdcall    DMS_ConnEx(TCHAR *lpszPipename);    // ---> für TestComplete special only
  78. int _stdcall    DMS_Close(HANDLE pipe);
  79. int _stdcall    DMS_CloseEx(int idx);
  80. int _stdcall    CDMS_Close(CDMSData *pDMS);
  81. HANDLE _stdcall DMS_GetPipe(int idx);
  82. int _stdcall    DMS_Send(HANDLE pipe, comm *msg);
  83. int _stdcall    DMS_SendEx(int idx, comm *msg);
  84. int _stdcall    CDMS_Send(CDMSData *pDMS, comm *msg);
  85. int _stdcall    DMS_SendPrgName(HANDLE pipe, TCHAR* name);
  86. int _stdcall    DMS_SendPrgNameEx(int idx, TCHAR* name);
  87. int _stdcall    CDMS_SendPrgName(CDMSData *pDMS, TCHAR* name);
  88. int _stdcall    DMS_Create(HANDLE pipe, TCHAR   *name, char type);
  89. int _stdcall    DMS_CreateEx(int idx, TCHAR *name, char type);
  90. int _stdcall    CDMS_Create(CDMSData *pDMS, TCHAR   *name, char type);
  91. int _stdcall    DMS_CreateRemanent(HANDLE pipe, TCHAR   *name, char type);
  92. int _stdcall    DMS_CreateRemanentEx(int idx, TCHAR *name, char type);
  93. int _stdcall    CDMS_CreateRemanent(CDMSData *pDMS, TCHAR   *name, char type);
  94. int _stdcall    DMS_CreatePoint(HANDLE pipe, TCHAR  *name, char type, char rights);
  95. int _stdcall    DMS_CreatePointEx(int idx, TCHAR    *name, char type, char rights);
  96. int _stdcall    CDMS_CreatePoint(CDMSData *pDMS, TCHAR  *name, char type, char rights);
  97. int _stdcall    DMS_Delete(HANDLE pipe, TCHAR   *name);
  98. int _stdcall    DMS_DeleteEx(int idx, TCHAR *name);
  99. int _stdcall    CDMS_Delete(CDMSData *pDMS, TCHAR   *name);
  100. int _stdcall    DMS_Rename(HANDLE pipe, TCHAR   *nameOld, TCHAR *nameNew);
  101. int _stdcall    DMS_RenameEx(int idx, TCHAR *nameOld, TCHAR *nameNew);
  102. int _stdcall    CDMS_Rename(CDMSData *pDMS, TCHAR   *nameOld, TCHAR *nameNew);
  103. int _stdcall    DMS_SendCode(HANDLE pipe, int code);
  104. int _stdcall    DMS_SendCodeEx(int idx, int code);
  105. int _stdcall    CDMS_SendCode(CDMSData *pDMS, int code);
  106. int _stdcall    DMS_SaveTree(HANDLE pipe, TCHAR* Filename, TCHAR* Vorlage);
  107. int _stdcall    DMS_SaveTreeEx(int idx, TCHAR* Filename, TCHAR* Vorlage);
  108. int _stdcall    CDMS_SaveTree(CDMSData *pDMS, TCHAR* Filename, TCHAR* Vorlage);
  109.  
  110. int _stdcall    DMS_InsertBMO(int idx, TCHAR* sBmo, TCHAR* sDms);
  111.  
  112. // ret on ERROR: -1(general), -2(NO_PIPE_EXISTS), -5(NO_POINT_EXISTS),
  113. // or else on OK:  ID_NONE=0, ID_BIT=1..ID_STR=9..
  114. int  _stdcall   DMS_ReadType(HANDLE pipe, TCHAR *name);
  115. int  _stdcall   DMS_ReadTypeEx(int idx, TCHAR *name);
  116. int  _stdcall   CDMS_ReadType(CDMSData *pDMS, TCHAR *name);
  117.  
  118. // Für PmosPipe DMS_Write.. Funktionen, welche eingebaute Filterfunktion für Remote-GE und WebServer haben:
  119. // der DMS-Name wird dann transformiert: "System:Node:NODExy:ABC.." -> "System:Node:<ClAdr>:ABC.."
  120. BOOL _stdcall   DMS_SetClientAdr(int idx, TCHAR *ClAdr);
  121.  
  122. int  _stdcall   DMS_WriteBIT(HANDLE pipe, TCHAR *name, tBIT bwert);
  123. int  _stdcall   DMS_WriteBITEx(int idx, TCHAR *name, tBIT bwert);
  124. int  _stdcall   CDMS_WriteBIT(CDMSData *pDMS, TCHAR *name, tBIT bwert);
  125. int  _stdcall   DMS_WriteBYS(HANDLE pipe, TCHAR *name, tBYS wert);
  126. int  _stdcall   DMS_WriteBYSEx(int idx, TCHAR *name, tBYS wert);
  127. int  _stdcall   CDMS_WriteBYS(CDMSData *pDMS, TCHAR *name, tBYS wert);
  128. int  _stdcall   DMS_WriteBYU(HANDLE pipe, TCHAR *name, tBYU wert);
  129. int  _stdcall   DMS_WriteBYUEx(int idx, TCHAR *name, tBYU wert);
  130. int  _stdcall   CDMS_WriteBYU(CDMSData *pDMS, TCHAR *name, tBYU wert);
  131. int  _stdcall   DMS_WriteWOS(HANDLE pipe, TCHAR *name, tWOS wert);
  132. int  _stdcall   DMS_WriteWOSEx(int idx, TCHAR *name, tWOS wert);
  133. int  _stdcall   CDMS_WriteWOS(CDMSData *pDMS, TCHAR *name, tWOS wert);
  134. int  _stdcall   DMS_WriteWOU(HANDLE pipe, TCHAR *name, tWOU wert);
  135. int  _stdcall   DMS_WriteWOUEx(int idx, TCHAR *name, tWOU wert);
  136. int  _stdcall   CDMS_WriteWOU(CDMSData *pDMS, TCHAR *name, tWOU wert);
  137. int  _stdcall   DMS_WriteDWS(HANDLE pipe, TCHAR *name, tDWS wert);
  138. int  _stdcall   DMS_WriteDWSEx(int idx, TCHAR *name, tDWS wert);
  139. int  _stdcall   CDMS_WriteDWS(CDMSData *pDMS, TCHAR *name, tDWS wert);
  140. int  _stdcall   DMS_WriteDWU(HANDLE pipe, TCHAR *name, tDWU wert);
  141. int  _stdcall   DMS_WriteDWUEx(int idx, TCHAR *name, tDWU wert);
  142. int  _stdcall   CDMS_WriteDWU(CDMSData *pDMS, TCHAR *name, tDWU wert);
  143. int  _stdcall   DMS_WriteFLT(HANDLE pipe, TCHAR *name, tFLT wert);
  144. int  _stdcall   DMS_WriteFLTEx(int idx, TCHAR *name, tFLT wert);
  145. int  _stdcall   CDMS_WriteFLT(CDMSData *pDMS, TCHAR *name, tFLT wert);
  146. int  _stdcall   DMS_WriteSTR(HANDLE pipe, TCHAR *name, tSTR *wert);
  147. int  _stdcall   DMS_WriteSTREx(int idx, TCHAR *name, tSTR *wert);
  148. int  _stdcall   CDMS_WriteSTR(CDMSData *pDMS, TCHAR *name, tSTR *wert);
  149.  
  150. // all Reads(): OK: return 0
  151. //              ERR: return <>0: NO_PIPE_EXISTS=-2, POINT_NOT_EXIST=2, INVALID_MSG=1 etc.
  152. int  _stdcall   DMS_ReadFLT (HANDLE pipe, TCHAR *name, tFLT& wert);
  153. int  _stdcall   DMS_ReadFLTEx (int idx, TCHAR *name, tFLT& wert);
  154. int  _stdcall   CDMS_ReadFLT (CDMSData *pDMS, TCHAR *name, tFLT& wert);
  155. int  _stdcall   DMS_ReadBIT (HANDLE pipe, TCHAR *name, tBIT& zustand);
  156. int  _stdcall   DMS_ReadBITEx (int idx, TCHAR *name, tBIT& zustand);
  157. int  _stdcall   CDMS_ReadBIT (CDMSData *pDMS, TCHAR *name, tBIT& zustand);
  158. tBIT _stdcall   DMS_RdBITEx(int idx, TCHAR *name);
  159. int  _stdcall   DMS_ReadBYS (HANDLE pipe, TCHAR *name, tBYS& zustand);
  160. int  _stdcall   DMS_ReadBYSEx (int idx, TCHAR *name, tBYS& zustand);
  161. int  _stdcall   CDMS_ReadBYS (CDMSData *pDMS, TCHAR *name, tBYS& zustand);
  162. int  _stdcall   DMS_ReadBYU (HANDLE pipe, TCHAR *name, tBYU& zustand);
  163. int  _stdcall   DMS_ReadBYUEx (int idx, TCHAR *name, tBYU& zustand);
  164. int  _stdcall   CDMS_ReadBYU (CDMSData *pDMS, TCHAR *name, tBYU& zustand);
  165. int  _stdcall   DMS_ReadWOU (HANDLE pipe, TCHAR *name, tWOU& wert);
  166. int  _stdcall   DMS_ReadWOUEx (int idx, TCHAR *name, tWOU& wert);
  167. int  _stdcall   CDMS_ReadWOU (CDMSData *pDMS, TCHAR *name, tWOU& wert);
  168. tWOU _stdcall   DMS_RdWOUEx (int idx, TCHAR *name);
  169. int  _stdcall   DMS_ReadWOS (HANDLE pipe, TCHAR *name, tWOS& wert);
  170. int  _stdcall   DMS_ReadWOSEx (int idx, TCHAR *name, tWOS& wert);
  171. int  _stdcall   CDMS_ReadWOS (CDMSData *pDMS, TCHAR *name, tWOS& wert);
  172. tWOS _stdcall   DMS_RdWOSEx (int idx, TCHAR *name);
  173. int  _stdcall   DMS_ReadDWU (HANDLE pipe, TCHAR *name, tDWU& wert);
  174. int  _stdcall   DMS_ReadDWUEx (int idx, TCHAR *name, tDWU& wert);
  175. int  _stdcall   CDMS_ReadDWU (CDMSData *pDMS, TCHAR *name, tDWU& wert);
  176. tDWU _stdcall   DMS_RdDWUEx (int idx, TCHAR *name);
  177. int  _stdcall   DMS_ReadDWS (HANDLE pipe, TCHAR *name, tDWS& wert);
  178. int  _stdcall   DMS_ReadDWSEx (int idx, TCHAR *name, tDWS& wert);
  179. int  _stdcall   CDMS_ReadDWS (CDMSData *pDMS, TCHAR *name, tDWS& wert);
  180. tDWS _stdcall   DMS_RdDWSEx(int idx, TCHAR *name);
  181. int  _stdcall   DMS_ReadSTR (HANDLE pipe, TCHAR *name, tSTR* cwert);
  182. int  _stdcall   DMS_ReadSTREx (int idx, TCHAR *name, tSTR* cwert);
  183. int _stdcall    CDMS_ReadSTR(CDMSData *pDMS, TCHAR *name, tSTR* wert);
  184. TCHAR* _stdcall DMS_RdSTREx(int idx, TCHAR *name);
  185.  
  186. char _stdcall   DMS_GetRights(HANDLE pipe, TCHAR *Name);
  187. char _stdcall   DMS_GetRightsEx(int idx, TCHAR *Name);
  188. char _stdcall   CDMS_GetRights(CDMSData *pDMS, TCHAR *Name);
  189. char _stdcall   DMS_SetRights(HANDLE pipe, TCHAR *Name, char rights);
  190. char _stdcall   DMS_SetRightsEx(int idx, TCHAR *Name, char rights);
  191. char _stdcall   CDMS_SetRights(CDMSData *pDMS, TCHAR *Name, char rights);
  192.  
  193. int  _stdcall   DMS_FindNames(HANDLE pipe, TCHAR *Name);
  194. int _stdcall    DMS_FindNamesEx(int idx, TCHAR *Name);
  195. int _stdcall    CDMS_FindNames(CDMSData *pDMS, TCHAR *Name);
  196. TCHAR* _stdcall DMS_Find(int nummer, int& typ);
  197. TCHAR* _stdcall DMS_FindNext(int& typ);
  198. TCHAR* _stdcall DMS_FindVal(int nummer, int& typ, value_type* value);
  199. TCHAR* _stdcall DMS_FindNextVal(int& typ, value_type* value);
  200. int  _stdcall   DMS_FindInt(int nummer);
  201. float _stdcall  DMS_FindFlt(int nummer);
  202. TCHAR* _stdcall DMS_FindStr(int nummer);
  203.  
  204. void   _stdcall DMS_FindMessageFilter(TCHAR* filter);
  205. int    _stdcall DMS_FindMessage(HANDLE pipe, TCHAR *Name);
  206. int    _stdcall DMS_FindMessageEx(int idx, TCHAR *Name);
  207. int _stdcall    CDMS_FindMessage(CDMSData *pDMS, TCHAR *Name);
  208. TCHAR* _stdcall DMS_FindNextMessage(Message* msg);
  209. void _stdcall   DMS_ResetMessage(int pos);
  210. int    _stdcall DMS_FindValMessage(HANDLE pipe, TCHAR *Name);
  211. int    _stdcall DMS_FindValMessageEx(int idx, TCHAR *Name);
  212. int _stdcall    CDMS_FindValMessage(CDMSData *pDMS, TCHAR *Name);
  213. TCHAR* _stdcall DMS_FindNextValMessage(Message* msg);
  214. void _stdcall   DMS_ResetValMessage(int pos);
  215.  
  216.  
  217. TCHAR* _stdcall DMS_GetSPS(HANDLE pipe, TCHAR *name);
  218. TCHAR* _stdcall DMS_GetSPSEx(int idx, TCHAR *name);
  219. TCHAR* _stdcall CDMS_GetSPS(CDMSData *pDMS, TCHAR *name);
  220.  
  221. int  _stdcall   DMS_GetNames(HANDLE pipe, TCHAR *name);
  222. int  _stdcall   DMS_GetNamesEx(int idx, TCHAR *name);
  223. int _stdcall    CDMS_GetNames(CDMSData *pDMS, TCHAR *name);
  224. TCHAR* _stdcall DMS_GetNextName(HANDLE pipe, int& sons);
  225. TCHAR* _stdcall DMS_GetNextNameEx(int& sons);
  226.  
  227. int _stdcall DMS_Login(HANDLE pipe, TCHAR* host, TCHAR *name, tSTR* passwort);
  228. int _stdcall DMS_LoginEx(int idx, TCHAR* host, TCHAR *name, tSTR* passwort);
  229. int _stdcall CDMS_Login(CDMSData *pDMS, TCHAR* host, TCHAR *name, tSTR* passwort);
  230. UINT _stdcall DMS_ReadUser(HANDLE pipe, TCHAR* User, TCHAR* Comment);
  231. UINT _stdcall DMS_ReadUserEx(int idx, TCHAR* User, TCHAR* Comment);
  232. UINT _stdcall CDMS_ReadUser(CDMSData *pDMS, TCHAR* User, TCHAR* Comment);
  233. UINT _stdcall DMS_ReadUserRights(int idx, TCHAR* User, TCHAR* Comment);
  234.  
  235. int _stdcall DMS_FindAddendumEx(int idx, TCHAR *DMSName, TCHAR* Addendum);
  236. int _stdcall DMS_FindAddendum(HANDLE pipe, TCHAR *DMSName, TCHAR* Addendum);
  237. int _stdcall CDMS_FindAddendum(CDMSData *pDMS, TCHAR *DMSName, TCHAR* Addendum);
  238.  
  239.  
  240. TCHAR *ftoa(double wert, int ks = 2);
  241.  
  242. void __stdcall SetProjectDir(TCHAR *path);
  243. int __stdcall ChangeDir(int where, BOOL ShowError = TRUE);
  244.  
  245.  
  246. BOOL sendToPort(TCHAR* IPAdress, int port, TCHAR* sMsg, TCHAR* errStr, int &errNr, HANDLE Stop_SockThread);
  247.  
  248. // Dateidefinitionen
  249. //#define   INI_FILE    "promos.ini"
  250. #define CFG_FILE    "promos.cfg"
  251. #define START_FILE  ".\\start.def"
  252. #define STOP_FILE   ".\\stop.def"
  253.  
  254. #define CFG_DIR     ".\\cfg\\"
  255. #define SCR_DIR     ".\\scr\\"
  256. #define MAC_DIR     ".\\mac\\"
  257. #define BMP_DIR     ".\\bmp\\"
  258. #define LIC_DIR     ".\\lic\\"
  259. #define DRV_DIR     ".\\drv\\"
  260. #define DAT_DIR     ".\\dat\\"
  261. #define BIN_DIR     ".\\bin\\"
  262. #define LOG_DIR     ".\\log\\"
  263. #define RTF_DIR     ".\\rtf\\"
  264. #define WWW_DIR     ".\\www\\"
  265. #define IMG_DIR     ".\\www\\img\\"
  266. #define LIB_DIR     ".\\www\\lib\\"
  267. #define PPC_DIR     "\\ppc\\"
  268.  
  269.  
  270. #define PRJDIR      0
  271. #define CFGDIR      1
  272. #define SCRDIR      2
  273. #define MACDIR      3
  274. #define BMPDIR      4
  275. #define LICDIR      5
  276. #define DRVDIR      6
  277. #define DATDIR      7
  278. #define LOGDIR      8
  279. #define RTFDIR      9
  280. #define WWWDIR      10
  281.  
  282. #endif //  _PIPESDLL_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement