mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
5 years ago | |
---|---|---|
.. | ||
cenumpt.cpp | 5 years ago | |
cenumpt.h | 5 years ago | |
clsid.c | 5 years ago | |
clsid.h | 5 years ago | |
cpoint.cpp | 5 years ago | |
cpoint.h | 5 years ago | |
cpoly.cpp | 5 years ago | |
cpoly.h | 5 years ago | |
hostenv.h | 5 years ago | |
macmain.cpp | 5 years ago | |
makefile | 5 years ago | |
misc.cpp | 5 years ago | |
mk.bat | 5 years ago | |
mk.cmd | 5 years ago | |
readme.txt | 5 years ago | |
resource.h | 5 years ago | |
spoly.def | 5 years ago | |
spoly.h | 5 years ago | |
spoly.ico | 5 years ago | |
spoly.r | 5 years ago | |
spoly.r32 | 5 years ago | |
spoly.rc | 5 years ago | |
spoly.reg | 5 years ago | |
statbar.cpp | 5 years ago | |
statbar.h | 5 years ago | |
winmain.cpp | 5 years ago |
readme.txt
------------------------------------
OLE Automation Sample Program: SPoly
------------------------------------
SPoly is a program which draws polygons. The only way to
make spoly draw a polygon is to use its programmability
interface.
One OLE Automation object is exposed by Spoly:
* spoly.application
Spoly.Application is the object associated with spoly's main
window. It controls drawing polygons and clearing the display.
-----------------
Program Structure
-----------------
SPoly implements IDispatch by hand for spoly.application.
------------------------------------
Methods defined on spoly.application
------------------------------------
Name Description
------------------------------------------------------------------
Draw() Draw the polygon.
Reset() Delete all points from the polygon.
AddPoint(X, Y) Add a point with coordinates (x,y)
to the polygon
EnumPoints() as VT_ENUM Return a collection of the polygon's
points
GetXOrigin() as short Get the X origin of the polygon.
SetXOrigin(x as short) Set the X origin of the polygon.
GetYOrigin() as short Get the Y origin of the polygon.
SetYOrigin(y as short) Set the Y origin of the polygon.
GetWidth() as short Get and the line width of the polygon.
SetWidth(width as short) Set the line width of the polygon.
---------------------------
Shortcomings of this sample
---------------------------
1. Many items in this sample should be properties. Instead,
they are implemented as methods. Anything which behaves like
an attribute of the object should be a property.
2. This is not a good example of how to implement a collection.