vedranp
Član broj: 26421 Poruke: 56 194.106.164.*
|
Zasto mislis da nije iz mfc-a ako sam rekao da sam tamo nasao?
U Visual studiu 6.0
Project/add to project/components and control/Active x Control/
i nadjes PortController class.
Hvala za GetTickCount()!
pozdrav
a evo i deklaracije klase
#if !defined(AFX_PORTCONTROLLER_H__AD8A6E73_F747_4276_A464_9D3EF9EB76DE__INCLUDED_)
#define AFX_PORTCONTROLLER_H__AD8A6E73_F747_4276_A464_9D3EF9EB76DE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CPortController : public CWnd
{
protected:
DECLARE_DYNCREATE(CPortController)
public:
CLSID const& GetClsid()
{
static CLSID const clsid
= { 0x3f40e581, 0xc9da, 0x42a6, { 0x89, 0x54, 0x4b, 0x70, 0xcc, 0x91, 0x6a, 0x8d } };
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:
// Operations
public:
long GetBaudRate();
void SetBaudRate(long nNewValue);
short GetDataBits();
void SetDataBits(short nNewValue);
short GetParity();
void SetParity(short nNewValue);
short GetStopBits();
void SetStopBits(short nNewValue);
CString GetPortName();
long GetCd();
long GetCts();
long GetDsr();
long GetDtr();
void SetDtr(long nNewValue);
long GetDtrDsr();
void SetDtrDsr(long nNewValue);
long GetRtsCts();
void SetRtsCts(long nNewValue);
long GetRts();
void SetRts(long nNewValue);
long GetXonXoff();
void SetXonXoff(long nNewValue);
long GetPortHandle();
long GetBreak();
void SetBreak(long nNewValue);
long GetBytesUsedRQ();
long GetBytesUsedTQ();
long GetRing();
CString GetEventChar();
void SetEventChar(LPCTSTR lpszNewValue);
long GetFireOnEventChar();
void SetFireOnEventChar(long nNewValue);
long GetEnableReadOnEventChar();
void SetEnableReadOnEventChar(long nNewValue);
void Open(LPCTSTR PortName, LPCTSTR Settings);
void Close();
long Write(LPCTSTR WriteBuffer, long NumBytesToWrite, long Timeout);
CString Read(long NumBytesToRead, long Timeout, long* pNumBytesRead);
void ClearRQ();
void ClearTQ();
void GetErrorStatus(long* ParityError, long* FramingError, long* OverrunError);
void SendXon();
void SendXoff();
long WriteBinary(long pWriteBuffer, long NumBytesToWrite, long Timeout);
long ReadBinary(long NumBytesToRead, long Timeout, long* pNumBytesRead);
long GetIsOpen();
};
#endif // !defined(AFX_PORTCONTROLLER_H__AD8A6E73_F747_4276_A464_9D3EF9EB76DE__INCLUDED_)
|