![]() |
How to access to the member instancesHow to access to the member instances in the class event proceduresTo acess to the member instance, it needs that the instance is defined as "member" of the user defined class. See [Class application window: capter[How to make a instance be member]]The following shows a sample of a user defined class: sample. The variable: samlple* base is the pointer of the sample class. Then you can access to the member instance: base->newlab000 which name is newlab000 for example. #include <sample.h> void sample::event_procedure(WSCbase* object){ sample* base = (sample*)object->getUserData(WS_BASE_CLASS); ... //Access the member instance... WSCvariant val = base->newvlab000->getProperty(WSNuserValue); ... } How to access to the member instances in the methodTo access to the member instance in the class event procedure, it needs "base->", but in the method, it does no need "base->".The following is the sample of a user defined class: sample. Then you can access to the member instance directly: newlab000 which name is newlab000 for example. //a sample of the method. void sample::method1(long data){ newvlab000->setProperty(WSNuserValue,data); ... } Document Release 3.0 For Use with Wide Studio Release 3.0, Summer 2002
|