OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Typedefs
_
b
c
d
h
i
j
m
o
p
r
s
t
u
y
Enumerations
a
o
s
t
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
x
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
~
Variables
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Typedefs
c
d
e
i
l
p
r
s
t
v
Enumerations
c
h
p
q
s
t
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Related Symbols
d
g
i
o
s
t
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
Functions
_
c
d
g
i
m
o
s
t
w
Variables
Typedefs
Enumerations
Enumerator
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
▼
OWLNext
►
Overview of ObjectWindows
Accessing application objects
Finding the object
Creating a small application
Using WinMain and OwlMain
►
About command enabling
►
ObjectWindows Exception Handling
Todo List
►
Topics
►
Namespaces
►
Classes
▼
Files
▼
File List
►
documentation
▼
include
►
ocf
▼
owl
►
private
animctrl.h
►
appdict.h
►
applicat.h
►
bardescr.h
bitmapga.h
►
bitset.h
btntextg.h
button.h
buttonga.h
celarray.h
checkbox.h
►
checklst.h
►
chooseco.h
►
choosefo.h
clipboar.h
clipview.h
cmdline.h
►
codepages.h
►
colmnhdr.h
►
color.h
►
combobex.h
combobox.h
►
commctrl.h
commdial.h
►
commview.h
configfl.h
►
contain.h
control.h
controlb.h
controlg.h
►
coolbar.h
►
date.h
►
datetime.h
dc.h
►
decframe.h
►
decmdifr.h
►
defs.h
dialog.h
dibitmap.h
►
dispatch.h
►
docking.h
►
docmanag.h
►
doctpl.h
►
docview.h
draglist.h
drawitem.h
edit.h
editfile.h
editsear.h
editview.h
►
eventhan.h
►
exbase.h
►
except.h
►
file.h
filedoc.h
►
filename.h
►
findrepl.h
►
fixedpnt.h
flatctrl.h
floatfra.h
►
framewin.h
fscroll.h
►
functor.h
►
gadget.h
►
gadgetwi.h
gauge.h
►
gdibase.h
►
gdiobjec.h
►
gdiplus.h
►
geometry.h
►
glyphbtn.h
groupbox.h
►
hlpmanag.h
hotkey.h
imagelst.h
inputdia.h
ipaddres.h
►
layoutco.h
layoutwi.h
►
lclstrng.h
listbox.h
listboxview.h
►
listview.h
►
listviewctrl.h
►
listwind.h
►
mailer.h
►
mci.h
►
mdi.h
►
mdichild.h
►
memcbox.h
►
menu.h
menugadg.h
►
messageb.h
►
metafile.h
modegad.h
►
module.h
monthcal.h
►
msgthred.h
►
notetab.h
►
objstrm.h
►
opensave.h
owlall.h
owlcore.h
►
owlvcl.h
pager.h
►
panespli.h
pch.h
►
picker.h
picklist.h
pictwind.h
►
pointer.h
popupgad.h
posclass.h
preclass.h
preview.h
prevwin.h
►
printdia.h
►
printer.h
profile.h
progressbar.h
►
property.h
►
propsht.h
psview.h
radiobut.h
►
rcntfile.h
►
registry.h
►
resource.h
►
richedit.h
richedpr.h
richedv.h
rolldial.h
►
scrollba.h
►
scroller.h
►
serialze.h
►
shddel.h
►
shellitm.h
►
shelwapi.h
signatur.h
►
slider.h
►
splashwi.h
►
splitter.h
►
static.h
►
statusba.h
►
streambl.h
►
string.h
syslink.h
►
system.h
►
tabbed.h
►
tabctrl.h
►
template.h
►
textgadg.h
►
theme.h
►
thread.h
►
time.h
►
timegadg.h
tinycapt.h
►
toolbox.h
►
tooltip.h
►
transfer.h
►
transferbuffer.h
►
trayicon.h
►
treeviewctrl.h
►
treewind.h
►
uihelper.h
►
uimetric.h
►
updown.h
►
validate.h
►
window.h
►
windowev.h
►
winsock.h
►
wskaddr.h
►
wskerr.h
►
wskhostm.h
►
wskservm.h
►
wsksock.h
►
wsksockd.h
►
wsksockm.h
►
wsyscls.h
►
wsysinc.h
►
source
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
wskhostm.h
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// ObjectWindows
3
// Copyright (c) 1995, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Winsock for OWL subsystem.
7
/// Based on work by Paul Pedriana, 70541.3223@compuserve.com
8
//----------------------------------------------------------------------------
9
10
#if !defined(OWL_WSKHOSTM_H)
11
#define OWL_WSKHOSTM_H
12
13
#include <
owl/private/defs.h
>
14
#if defined(BI_HAS_PRAGMA_ONCE)
15
# pragma once
16
#endif
17
18
#include <
owl/defs.h
>
19
#include <
owl/window.h
>
20
#include <
owl/winsock.h
>
21
22
23
namespace
owl
{
24
25
//
26
// Forward ref.
27
//
28
class
_OWLCLASS
TSocketAddress;
29
30
#define WINSOCK_NOERROR (int)0
31
#define WINSOCK_ERROR (int)SOCKET_ERROR
32
33
//
34
// Supposedly in RFC 883.
35
//
36
#define N_MAX_HOST_NAME 128
37
#define MSG_HOST_INFO_NOTIFY ((UINT)(WM_USER+303))
38
39
class
_OWLCLASS
THostInfoManager;
40
41
#include <
owl/preclass.h
>
42
43
//
44
/// \class THostInfoWindow
45
// ~~~~~ ~~~~~~~~~~~~~~~
46
/// A private class created by THostInfoManager to catch WinSock messages.
47
//
48
class
_OWLCLASS
THostInfoWindow
:
public
TWindow
{
49
public
:
50
THostInfoWindow
(
THostInfoManager
*
hostInfoManagerParent
);
51
52
TResult
DoNotification(
TParam1
,
TParam2
);
53
54
public_data
:
55
/// Object to notify of Winsock events
56
//
57
THostInfoManager
* HostInfoManagerParent;
58
59
DECLARE_RESPONSE_TABLE
(
THostInfoWindow
);
60
};
48
class
_OWLCLASS
THostInfoWindow
:
public
TWindow
{
…
};
61
62
//
63
/// \class THostEntry
64
// ~~~~~ ~~~~~~~~~~
65
/// THostEntry encapsulates the attributes of a host (hostent).
66
//
67
class
_OWLCLASS
THostEntry
:
public
hostent {
68
public
:
69
THostEntry
();
70
71
int
GetAddressCount();
72
ulong
GetINetAddress();
73
74
/// An internet addressing -specific function.
75
//
76
ulong
GetNthINetAddress(
int
nIndex
= 0);
77
};
67
class
_OWLCLASS
THostEntry
:
public
hostent {
…
};
78
79
//
80
/// \class THostInfoManager
81
// ~~~~~ ~~~~~~~~~~~~~~~~
82
/// The THostInfoManager class (and its friend class THostInfoWindow) encapsulate
83
/// the Winsock database functions gethostbyname(), gethostbyaddr(), and
84
/// gethostname(). These blocking (gethostby...) and non-blocking (gethostname)
85
/// functions return information about the host in a hostent structure.
86
//
87
class
_OWLCLASS
THostInfoManager
{
88
public
:
89
THostInfoManager
();
90
virtual
~THostInfoManager
();
91
92
int
GetLastError();
93
int
GetHostName(
char
*
name
,
int
nameLength
=
N_MAX_HOST_NAME
);
94
int
GetHostAddress(
char
*
szHostAddress
,
const
char
*
szHostName
);
95
int
GetHostAddress(
TSocketAddress
&
sAddress
,
const
char
*
szHostName
);
96
int
GetHostInfo(
THostEntry
*&
hEntry
,
const
TSocketAddress
&
sAddress
);
97
int
GetHostInfo(
THostEntry
*&
hEntry
,
const
char
*
szName
);
98
int
GetHostInfoAsync(
HANDLE
&
hTheHostRequest
,
TSocketAddress
&
sAddress
);
99
int
GetHostInfoAsync(
HANDLE
&
hTheHostRequest
,
char
*
szName
);
100
int
GetHostInfoAsync(
TWindow
&
wndNotify
,
HANDLE
&
hTheHostRequest
,
101
TSocketAddress
&
sAddress
,
uint
nMessage
=
MSG_HOST_INFO_NOTIFY
,
102
char
*
chBuffer
= 0);
103
int
GetHostInfoAsync(
TWindow
&
wndNotify
,
HANDLE
&
hTheHostRequest
,
104
char
*
szName
,
uint
nMessage
=
MSG_HOST_INFO_NOTIFY
,
105
char
*
chBuffer
= 0);
106
int
CancelHostRequest(
HANDLE
hTheHostRequest
= 0);
107
short
GetHostRequestCompleted();
108
static
int
HostEntryToAddress(
THostEntry
*
hEntry
,
char
*
szAddress
);
109
static
int
HostEntryToAddress(
THostEntry
*
hEntry
,
TSocketAddress
&
sAddress
);
110
111
// !CQ public?
112
// Set to point to HostInfoBuffer.
113
//
114
public_data
:
115
THostEntry
* HostEntry;
116
117
protected
:
118
bool
HostRequestCompleted
;
///< Flag if host completed last request
119
HANDLE
HostRequest
;
///< Handle of host to get info about
120
int
LastError
;
///< Last error code
121
char
HostInfoBuffer[
MAXGETHOSTSTRUCT
];
///< Used for calls to WSAAsync...()
122
THostInfoWindow
HostWindow
;
///< Hidden window to catch notifications
123
124
void
SetHostRequestCompleted(
int
error
);
125
126
friend
class
THostInfoWindow
;
127
};
87
class
_OWLCLASS
THostInfoManager
{
…
};
128
129
#include <
owl/posclass.h
>
130
131
//----------------------------------------------------------------------------
132
// Inline implementations
133
//
134
135
//
136
/// Returns the Internet address of the host.
137
//
138
inline
ulong
139
THostEntry::GetINetAddress
()
140
{
141
return
GetNthINetAddress
(0);
142
}
139
THostEntry::GetINetAddress
() {
…
}
143
144
//
145
/// This function returns the last error code.
146
//
147
inline
int
148
THostInfoManager::GetLastError
()
149
{
150
return
LastError
;
151
}
148
THostInfoManager::GetLastError
() {
…
}
152
153
//
154
/// This function returns true if the host completed the last requested transaction.
155
/// \todo really return a short? HostRequestCompleted is bool
156
//
157
inline
short
158
THostInfoManager::GetHostRequestCompleted
()
159
{
160
return
HostRequestCompleted
;
161
}
158
THostInfoManager::GetHostRequestCompleted
() {
…
}
162
163
}
// OWL namespace
164
165
166
#endif
// OWL_WSKHOSTM_H
VarType
Definition
safearray.h:14
owl::THostEntry
THostEntry encapsulates the attributes of a host (hostent).
Definition
wskhostm.h:67
owl::THostEntry::GetINetAddress
ulong GetINetAddress()
Returns the Internet address of the host.
Definition
wskhostm.h:139
owl::THostEntry::GetNthINetAddress
ulong GetNthINetAddress(int nIndex=0)
An internet addressing -specific function.
Definition
wskhostm.cpp:84
owl::THostInfoManager
The THostInfoManager class (and its friend class THostInfoWindow) encapsulate the Winsock database fu...
Definition
wskhostm.h:87
owl::THostInfoManager::GetHostRequestCompleted
short GetHostRequestCompleted()
This function returns true if the host completed the last requested transaction.
Definition
wskhostm.h:158
owl::THostInfoManager::HostRequest
HANDLE HostRequest
Handle of host to get info about.
Definition
wskhostm.h:119
owl::THostInfoManager::LastError
int LastError
Last error code.
Definition
wskhostm.h:120
owl::THostInfoManager::HostRequestCompleted
bool HostRequestCompleted
Flag if host completed last request.
Definition
wskhostm.h:118
owl::THostInfoManager::HostWindow
THostInfoWindow HostWindow
Hidden window to catch notifications.
Definition
wskhostm.h:122
owl::THostInfoManager::GetLastError
int GetLastError()
This function returns the last error code.
Definition
wskhostm.h:148
owl::THostInfoWindow
A private class created by THostInfoManager to catch WinSock messages.
Definition
wskhostm.h:48
owl::TSocketAddress
The TSocketAddress class stores a Winsock socket address.
Definition
wskaddr.h:38
owl::TWindow
TWindow, derived from TEventHandler and TStreamableBase, provides window-specific behavior and encaps...
Definition
window.h:414
DECLARE_RESPONSE_TABLE
#define DECLARE_RESPONSE_TABLE(cls)
Definition
eventhan.h:436
owl
Object Windows Library (OWLNext Core)
Definition
animctrl.h:22
owl::ulong
unsigned long ulong
Definition
number.h:26
owl::TParam2
LPARAM TParam2
Second parameter type.
Definition
dispatch.h:55
owl::TParam1
WPARAM TParam1
First parameter type.
Definition
dispatch.h:54
owl::uint
unsigned int uint
Definition
number.h:25
defs.h
General definitions used by all ObjectWindows programs.
public_data
#define public_data
Definition
defs.h:207
defs.h
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
posclass.h
preclass.h
window.h
Base window class TWindow definition, including HWND encapsulation.
winsock.h
Main header of the Winsock OWL subsystem.
MSG_HOST_INFO_NOTIFY
#define MSG_HOST_INFO_NOTIFY
Definition
wskhostm.h:37
N_MAX_HOST_NAME
#define N_MAX_HOST_NAME
Definition
wskhostm.h:36
include
owl
wskhostm.h
Generated by
1.10.0