thanx JPN. Here's what i did based on your advice and looking around a bit on the web: first, I removed the "Comp" struct from the "Window" constructor function (above) and have created a new class in separate files:
dafo.h
#ifndef DAFO_H
#define DAFO_H
class Dafo
{
private:
static short dataNUM_TOTc;
//other variables.......
public:
Dafo();
~Dafo();
//GETs
static short get_dataNUM_TOTc() { return dataNUM_TOTc; }
//SETs
static void set_dataNUM_TOTc(short value) { dataNUM_TOTc = value; }
};
#endif
#ifndef DAFO_H
#define DAFO_H
class Dafo
{
private:
static short dataNUM_TOTc;
//other variables.......
public:
Dafo();
~Dafo();
//GETs
static short get_dataNUM_TOTc() { return dataNUM_TOTc; }
//SETs
static void set_dataNUM_TOTc(short value) { dataNUM_TOTc = value; }
};
#endif
To copy to clipboard, switch view to plain text mode
I initialize the private variables in dafo.cpp like so:
#include "dafo.h"
short Dafo::dataNUM_TOTc = 7;
// other variables
Dafo::Dafo(void){
}
Dafo::~Dafo(){
// delete this;
}
#include "dafo.h"
short Dafo::dataNUM_TOTc = 7;
// other variables
Dafo::Dafo(void){
}
Dafo::~Dafo(){
// delete this;
}
To copy to clipboard, switch view to plain text mode
...and that's it. Now I can access get/set member functions of Dafo from any class-file which includes: #include "dafo.h"
Anyway, pretty basic C++ I guess, but I thought I would post this in case I've made some obvious C++ programming/protocol mistakes that someone might point out.
thanks again
Bookmarks