Lost the value variable I set in setup(), it is reset to 0 in the update() function

Hi, apologies if this has been asked before. Ive searched and couldn’t find anything.
I modified ofxOpenNI by adding a new variable, openNIDevice.xnMaxUsers. (type XnUInt16 xnMaxUsers)
I initialize it in the setup since its value won’t change, but when I check its value within update() is reset to 0 and it shouldn’t. So I have to set it in the update().
Any ideas? Thanks.

oF 0.8.0
OS: Ubuntu 12.04 64 bits

Have you tried initializing it in the header, and then setting the value in setup()?

@AceSlowman I don’t know how to do it, since this variable doesn’t belong to the testApp class. It belongs to a class that is used by testApp, the ofxOpenNI class. The idea is to make its value seteable according to the needs, that’s why I do the setting on demand.

class ofxOpenNI {
    public:
       :::::::::::::::::::::.
   XnUInt16 cantUsers;
   }

According to the C++ specification I can’t set this value within the class declaration (.h)

void testApp::setup {
    openNIDevice.cantUsers = 2;  // 
}

void testApp::update {
     openNIDevice.update();
    //I check openNIDevice.cantUsers its value is 0, so I need to set it up again

    openNIDevice.cantUsers = 2;  
   // more sentences
}