Wide Studio Programmer's Guide

Wide Studio Home
Up to


How to access to the member instances



How to access to the member instances in the class event procedures

To 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 method

To 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 1.3

For Use with Wide Studio Release 1.3, Summer 2001


Wide Stuido Home | Up to

Copyright(C) T. Hirabayashi, 2000-2001 Last modified: August 20, 2001