Ethernet Developers Guide
76
840 USE 115 00 Version 1.0
The member function rx_ms
calls the window socket recv function to read data.
The recv function either returns a non ne
ative number that is the number of b
tes
read or it returns an error. If the number b
tes read is zero, then the connection no
lon
er exits, and rx_ms
closes the socket, and sets the transmit state to IDLE. If
the recv function returns the error indicatin
that no receive data is available, then
rx_ms
ust returns. For an
other recv function error, rx_ms
closes the socket,
and sets the transmit state to IDLE.
B.12 Displaying on the Screen
CSample_View m_displa
member indicates the displa
t
pe. The different t
pes
of the displa
s and the CSample_View member functions for showin
the displa
are as follows.
1.
Displa
in
the connection state. The different connection states displa
ed are
IDLE, RESOLVING NAME, and CONNECTING. ConnPaint member function
displa
s the connection state.
2.
GetStatsPaint member function displa
s the results of a
et statistics re
uest.
3.
ClearStatsPaint member function displa
s the results of a clear statisitics
re
uest.
4.
ReadRe
Paint member function displa
s the results of a read re
ister re
uest.
5.
WriteRe
Paint member function displa
s the results of a write re
ister re
uest.
MFC architectual framework calls CSample_View OnDraw member function to
process the window WM_PAINT messa
e. OnDraw examines m_displa
member
variable and calls the correspondin
member function described in the previous
para
raph. Whenever CSample_View needs to displa
a result, it calls Cview
Invalidate function which causes a WM_PAINT messa
e.
CSample_View is derived from MFC CScrollView class. This class handles the
scroll lo
ic. To perform the scroll lo
ic, CScrollView re
uires the size of the
document. It is informed of the document size via its SetScrollSizes member
function.
CSample_View UpdateScrollSizes member function based on the displa
t
pe
calculates the document size, and then calls SetScrollSizes. CSample_View calls
UpdateScrollSizes when the displa
t
pe chan
es or when the user chan
es the
window size.
Comments to this Manuals