WideStudio/MWT Logo
WideStudio/MWT
Programming Guide
WideStudio/MWT Index
Table of contents


How to access to the member instances



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

To access to the member instance, the instance needs to be defined as "member" of the user defined class. See [Class application window: chapter [How to make a instance be member]]

The following shows a sample of a user defined class: sample.

The variable: sample* base is the pointer of the sample class. Then you can access to the member instance: base->newvlab000 which name is newvlab000 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: newvlab000 which name is newvlab000 for example.


//a sample of the method.
void sample::method1(long data){
  newvlab000->setProperty(WSNuserValue,data);
  ...
}


Document Release 3.90 for WideStudio/MWT ver 3.90, Jul 2005


WideStudio/MWT documents index | Table of contents

Copyright(C) WideStudio/MWT Development Team, 1999-2005 Last modified: Jul 31, 2005