The information in this article applies to:
SUMMARYThe Visual Basic custom control (VBX) architecture assumes that a controls model structure and related data structures will be in the default data segment for the VBX. This means that controls developed with the control development kit (CDK) for Visual Basic should be compiled either through the medium-memory model or with an explicit NEAR declaration on the appropriate data structures. Failure to declare variables with an explicit NEAR declaration will result in the following error:
MORE INFORMATIONVisual Basic expects that the model structure will reside in the default data segment for the VBX and that all pointers in the model structure will be near pointers. When you use the medium-memory model to compile, pointers are near by default. If you need to compile using another memory model that does not assume near pointers, then you need to force the compiler to generate near addresses for your property list, event list, and model structure. You can do this by putting the NEAR keyword in the corresponding declarations. Below is a code fragment taken from the Circ1 sample:
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:
Now, even if you compile with another memory model that does not default to
near pointers, near pointers will be generated for these constructs.
Additionally, if you have custom properties or custom events, you will need to declare them as "near" also. Below is an example custom property taken from Circ3:
However, it too must be modified as follows:
Additional query words: 3.00
Keywords : |
Last Reviewed: January 25, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |