1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
   | class CSerial : public CWnd
{
protected:
	DECLARE_DYNCREATE(CSerial)
public:
	CLSID const& GetClsid()
	{
		static CLSID const clsid
			= { 0x47696120, 0x35bb, 0x11d1, { 0x9a, 0xca, 0x0, 0x60, 0x97, 0xb7, 0xce, 0x79 } };
		return clsid;
	}
	virtual BOOL Create(LPCTSTR lpszClassName,
		LPCTSTR lpszWindowName, DWORD dwStyle,
		const RECT& rect,
		CWnd* pParentWnd, UINT nID,
		CCreateContext* pContext = NULL)
	{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }
 
    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
		const RECT& rect, CWnd* pParentWnd, UINT nID,
		CFile* pPersist = NULL, BOOL bStorage = FALSE,
		BSTR bstrLicKey = NULL)
	{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
		pPersist, bStorage, bstrLicKey); }
 
// Attributes
public:
	BOOL GetDataAsString();
	void SetDataAsString(BOOL);
 
	                  .
                          .
                          .
 
	BOOL GetDisableAsyncTimeout();
	void SetDisableAsyncTimeout(BOOL);
 
// Operations
public:
	void Write(const VARIANT& data);
	VARIANT Read(const VARIANT& bufferSize);
	void Configure();
	void WriteAsync(const VARIANT& data);
	void Stop();
	void ReadAsync(const VARIANT& bufferSize);
	void Reset();
	CCWTasks GetTasks();
	void ImportStyle(LPCTSTR FileName);
	void ExportStyle(LPCTSTR FileName);
	long GetBytesWritten();
	void ClearInputBuffer();
	long GetBytesAtPort();
	void SerialPortBreak(const VARIANT& delay);
	void AboutBox();
}; |