PUBLIC.H
资源名称:SNMP范例源代码.zip [点击查看]
上传用户:shgx688
上传日期:2009-12-27
资源大小:855k
文件大小:3k
源码类别:
SNMP编程
开发平台:
MultiPlatform
- #if !defined(PUBLIC_H)
- #define PUBLIC_H
- #include <mmsystem.h>
- //#include "hwt.rh"
- //#include "hwtom.h"
- #define DownRect 1
- #define UpRect 2
- #define BlackRect 3
- #define WhiteRect 4
- #define ColorRect 5
- /*
- class CMsgBox : public CWnd{
- public :
- CMsgBox();
- char Text[100];
- void Paint(CDC& dc, bool erase, CRect& rect);
- void SetText(char * text);
- };
- */
- class Animated {
- public:
- Animated( int numB, char far* name, int delayTics, int endTics = 0 ,BOOL isCallIn = 0 );
- ~Animated();
- void DisplayBegin(CDC& dc, int x, int y);
- void DisplayNext(CDC& dc);
- BOOL IsRunning() {
- if(Stoping)
- return 0;
- return WaitingTic;
- }
- void Stop(CDC& dc);
- int X; // position of bitmap
- int Y;
- BOOL IsCallIn;
- private:
- int Stoping;
- int DelayTics; // Amount to delay between frames (18.2 ticks/sec)
- int EndTics; // Amount to delay after sequence
- int WaitingTic; // Countdown for animation timing
- int SoundCnt;
- int NumBmps; // number of bitmaps
- int CurBmp; // currently displayed bitmap
- CBitmap** Bmps; // bitmaps
- };
- /*
- class TSendLetter{
- public:
- TSendLetter(int r232ID = 1);
- int R232ID;
- int recnt; //重发次数
- int timeout; //waittime
- BYTE SpLetters[120];
- BYTE NormalLetter[120];
- BOOL SendSucc;
- void Send(int type);
- int SendLetterOrder;
- BOOL RecieveAnswer(BYTE *wrk);
- int LetterLength;
- int SpLetterLength;
- BOOL Install50(BYTE,BYTE);
- BOOL Install51();
- BOOL Install52();
- BOOL InstallNormal(BYTE *wrk);
- private:
- TSendLetter(const TSendLetter&);
- TSendLetter& operator=(const TSendLetter&);
- };
- class TRecieveLetter{
- public:
- TRecieveLetter();
- BYTE * Letter;
- BYTE MyLetter[120];
- int RecieveLetterNum;
- void Answer();
- int HandLetter();
- BOOL IsLegal();
- int cmpcheck(BYTE *p);
- void del20(BYTE *p);
- private:
- TRecieveLetter(const TRecieveLetter&);
- TRecieveLetter& operator=(const TRecieveLetter&);
- };
- class CSeleDlg : public CDialog {
- public:
- static char sele;
- const char **Item;
- int ItemNum;
- CSeleDlg(CWnd* parent, const char* name,const char ** item,int itemnum,int initsele=1);
- virtual bool EvIniCDialog(HWND hWndFocus);
- void Enter1(){sele=1;}
- void Enter2(){sele=2;}
- void Enter3(){sele=3;}
- void Enter4(){sele=4;}
- void Enter5(){sele=5;}
- void Enter6(){sele=6;}
- void Enter7(){sele=7;}
- void Enter8(){sele=8;}
- void Enter9(){sele=9;}
- void Enter10(){sele=10;}
- void EnterCancel(){sele=99;OnOK();}
- void EnterOk(){OnOK();}
- private:
- CSeleDlg(const CSeleDlg&);
- CSeleDlg& operator=(const CSeleDlg&);
- DECLARE_RESPONSE_TABLE(CSeleDlg);
- };
- */
- void myrect(CDC& dc,int x1,int y1,int x2,int y2,int type,COLORREF color=RGB(0,100,100));
- void DrawBMP(CDC& dc, int x, int y, CBitmap& bitmap); //画位图
- void DrawNum(CDC& dc,char * Num, int x, int y, int len = 20 );
- void BCD_Asc(unsigned char *pnt,char * destr,int len);
- void ByteCat(BYTE *,BYTE *,int ,int);
- int copyfile(char *sourcefile,char *objectfile);
- void strtodata(int bytelength,CString sourcestr,BYTE * resultbyte);
- int asc_BCD(char * sasc ,char * DBCD,int type);
- int asc_bin(char * sasc, char * DBCD);
- #endif