Article ID: 119672
Article Last Modified on 10/29/2003
PPROPINFO Circle_Properties[] =
{
PPROPINFO_STD_CTLNAME,
...
PEVENTINFO Circle_Events[] =
{
PEVENTINFO_STD_CLICK,
...
MODEL modelCircle =
{
VB_VERSION, // VB version being used
...
Because there are no specific NEAR/FAR declarations in the above examples,
the compiler will use the default for the given memory model. You can,
however, force these pointers to be NEAR by specifying NEAR in the
declaration:
PPROPINFO NEAR Circle_Properties[] =
{
PPROPINFO_STD_CTLNAME,
...
PEVENTINFO NEAR Circle_Events[] =
{
PEVENTINFO_STD_CLICK,
...
char NEAR szCircle[] = "Circle"; // Must be NEAR
char NEAR szCirc1[] = "CIRC1"; // Must be NEAR
MODEL NEAR modelCircle = // Must be NEAR
{
VB_VERSION, // VB version being used
0, // MODEL flags
(PCTLPROC)CircleCtlProc, // Control procedure
CS_VREDRAW | CS_HREDRAW, // Class style
WS_BORDER, // Default Windows style
0, // Size of CIRCLE structure
IDBMP_CIRCLE, // Palette bitmap ID
szCircle, // Default control name
szCirc1, // Visual Basic class name
NULL, // Parent class name
Circle_Properties, // Property information table
Circle_Events, // Event information table
IPROP_CIRCLE_HEIGHT, // Default property
IEVENT_CIRCLE_CLICK, // Default event
-1 // Property representing value of ctl
};
Now, even if you compile with another memory model that does not default to
near pointers, near pointers will be generated for these constructs.
PROPINFO Property_CircleShape =
{
"CircleShape",
...
However, it too must be modified as follows:
char NEAR szCircleProperty[] = "CircleShape";
PROPINFO NEAR Property_CircleShape =
{
szCircleProperty,
...
Additional query words: 3.00
Keywords: KB119672