123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- // Variable.h: interface for the CVariable class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_VARIABLE_H__E5BEB1C8_4FE2_4705_986A_1E1D779EC41F__INCLUDED_)
- #define AFX_VARIABLE_H__E5BEB1C8_4FE2_4705_986A_1E1D779EC41F__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include<Afxdisp.h>
- class EXPORT_CLASS CVariable : public COleVariant
- {
- friend CDataNodeBase;
- public:
- CVariable();
- virtual ~CVariable();
- virtual CString GetTextValue();
- virtual void SetTextValue(CString strTextValue, VARTYPE vtSrc);
- virtual CString GetSaveFmtTxt();
- virtual void SetSaveFmtTxt(CString strSaveFmtTxt);
- VARTYPE GetVarType();
- static CString GetTypeName(VARTYPE vt);
- CVariable& operator = (COleVariant & var);
- // 获取特性
- virtual CString GetAttributesMsg();
- // 设置特性
- void SetAttributes(BOOL bIsDesignTimeVar, BOOL bCanRead, BOOL bCanWrite, VARTYPE vtSrc);
-
- protected:
- void SetString (LPCTSTR lpszSrc, VARTYPE vtSrc);
- CString m_strTextValue;
- BOOL m_bCanRead;
- BOOL m_bCanWrite;
- BOOL m_bIsDesignTimeVar;// 1: 设计时变量, -1:纯运行时变量,此类变量不需要保存, 0: 运行时变量,但此类变量需要保存
- };
- #define DefineSetVariableValue(Var, Value) \
- {\
- *((COleVariant*)Var) = Value;\
- }\
- #define DefineVar(Var) (*((COleVariant*)Var))
- #endif // !defined(AFX_VARIABLE_H__E5BEB1C8_4FE2_4705_986A_1E1D779EC41F__INCLUDED_)
|