dsmpccli.h

来自「Simple Module Procedure Call for windows」· C头文件 代码 · 共 55 行

H
55
字号
//
//        (S)imple (M)odule (P)rocedure (C)all
//
//  Version 1.1.3
//
//        SIC Dynamics        Copyright(C) - 1999
//
//  SMPC client declarations
//
#ifndef __DSMPCCLI_H
#define __DSMPCCLI_H

#include <smpc/dsmpc.h>

// SMPC-Client implementation
class DSmpcClient
{
 protected:
  DSmpc* smpc;
  dword sid;
  dword timeout;
  int error;
  dword type;

 public:
  DSmpcClient(DSmpc* _smpc, dword _sid = 0, dword _timeout = 0)
  { smpc = _smpc; sid = _sid; timeout = _timeout; error = Smpc_Success; type = 0; }

  // Server control
  dword Sid(void) const { return sid; }
  dword Sid(dword _sid) { return sid = _sid; }

  // Timeout control
  dword Timeout(void) const { return timeout; }
  dword Timeout(dword _timeout) { return timeout = _timeout; }

  // SMPC-Call
  int Call(dword proc, DSmpcParam* sp = 0, dword sn = 0, DSmpcParam* rp = 0, dword rn = 0)
  { return error = (smpc ? smpc->Call(sid,type = Type(),proc,sp,sn,rp,rn,timeout) : Smpc_Err_System); }

  // Get last Call error
  int Error(void) const { return error; }

  // Get remote server type after Call
  dword RemoteType(void) const { return type; }

  // Overwrite server type definition
  virtual dword Type(void) const { return 0; }

  // About server
  char* About(char*, unsigned);
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?