M
mlieberman
I accidentally sent my query before it was done.
I have inherited a vison system written in C++ with microsoft MFC.
I want to use a class function RefreshDisplay() in other non-inheriting
classes and open code functions. RefreshDisplay() is defined as:
Device.h includes:
class CDevice
{
public:
...
int RefreshDisplay();
...
}
Device.cpp includes
int CDevice::RefreshDisplay(){...}
The header "Device.h" was included in both "otherClass.cpp" and in
"ourUtils.cpp"
and when called referred to as "CDevice::RefreshDisplay."
In both cases ver 6.0 Visual C++ 6.0 gives the same build/compile
message:
file.cpp(line) error C2352: 'CDevice::RefreshDisplay' : illegal call of
non-static member function
x:\devices\device.h(67) : see declaration of 'RefreshDisplay'
but I see nothing that is declared static, i.e.,
here is the relevant code:in the class CotherClass,
In OtherClass.h
class CotherClass
{
public:
...
bool PrepImage( (long& imgRaw, bool bFFC, bool bScale, bool bDif);
...
}
In otherClass.cpp
#include "otherClass.h"
#include "Device.h"
bool CSWPreProc:repImage( .... nothing static ...) {... }
similarly in the open code function
In ourUtil.h
int ourUtil1(long imgIn, int bt, long& imgDeNoise);
In ourUtil.cpp
#include "ourUtil.h"
#include "device.h"
int ourUtil1(long imgIn, int bt, long& imgDeNoise)
{
...
CDevice::RefreshDisplay();
...
}
How can I get around this non recognition problem?
I have inherited a vison system written in C++ with microsoft MFC.
I want to use a class function RefreshDisplay() in other non-inheriting
classes and open code functions. RefreshDisplay() is defined as:
Device.h includes:
class CDevice
{
public:
...
int RefreshDisplay();
...
}
Device.cpp includes
int CDevice::RefreshDisplay(){...}
The header "Device.h" was included in both "otherClass.cpp" and in
"ourUtils.cpp"
and when called referred to as "CDevice::RefreshDisplay."
In both cases ver 6.0 Visual C++ 6.0 gives the same build/compile
message:
file.cpp(line) error C2352: 'CDevice::RefreshDisplay' : illegal call of
non-static member function
x:\devices\device.h(67) : see declaration of 'RefreshDisplay'
but I see nothing that is declared static, i.e.,
here is the relevant code:in the class CotherClass,
In OtherClass.h
class CotherClass
{
public:
...
bool PrepImage( (long& imgRaw, bool bFFC, bool bScale, bool bDif);
...
}
In otherClass.cpp
#include "otherClass.h"
#include "Device.h"
bool CSWPreProc:repImage( .... nothing static ...) {... }
similarly in the open code function
In ourUtil.h
int ourUtil1(long imgIn, int bt, long& imgDeNoise);
In ourUtil.cpp
#include "ourUtil.h"
#include "device.h"
int ourUtil1(long imgIn, int bt, long& imgDeNoise)
{
...
CDevice::RefreshDisplay();
...
}
How can I get around this non recognition problem?