classes and the namespace operator ::
-
okey dokey. I have 2 classes: class imageViewer{...}; class camData{...}; imageViewer has a function called funcA(); camData has a function called funcB(); I wanted to call funcA; in funcB(); i.e.:i've tried both:
#include "imageViewer.h" void camData::funcB() { .. imageViewer::funcA(); }
I get this error: error C2352: 'ImageViewer::showPicture' : illegal call of non-static member function -AND-#include "imageViewer.h" void camData::funcB() { .. funcA(); }
I get this error: error C3861: 'showPicture': identifier not found could someone please tell me my idiotic mistake..... thanks, KittyKitty5
-
okey dokey. I have 2 classes: class imageViewer{...}; class camData{...}; imageViewer has a function called funcA(); camData has a function called funcB(); I wanted to call funcA; in funcB(); i.e.:i've tried both:
#include "imageViewer.h" void camData::funcB() { .. imageViewer::funcA(); }
I get this error: error C2352: 'ImageViewer::showPicture' : illegal call of non-static member function -AND-#include "imageViewer.h" void camData::funcB() { .. funcA(); }
I get this error: error C3861: 'showPicture': identifier not found could someone please tell me my idiotic mistake..... thanks, KittyKitty5
Well, in order to call a function (non-static) from a class, you first need to have an instance of your class. So, doing something like that (suppose MyClass is a class that defines funcA):
MyClass A; A.funcA();
You cannot simply doMyClass::funcA();
Cédric Moonen Software developer
Charting control [v1.1] -
Well, in order to call a function (non-static) from a class, you first need to have an instance of your class. So, doing something like that (suppose MyClass is a class that defines funcA):
MyClass A; A.funcA();
You cannot simply doMyClass::funcA();
Cédric Moonen Software developer
Charting control [v1.1] -
okey dokey. I have 2 classes: class imageViewer{...}; class camData{...}; imageViewer has a function called funcA(); camData has a function called funcB(); I wanted to call funcA; in funcB(); i.e.:i've tried both:
#include "imageViewer.h" void camData::funcB() { .. imageViewer::funcA(); }
I get this error: error C2352: 'ImageViewer::showPicture' : illegal call of non-static member function -AND-#include "imageViewer.h" void camData::funcB() { .. funcA(); }
I get this error: error C3861: 'showPicture': identifier not found could someone please tell me my idiotic mistake..... thanks, KittyKitty5
kitty5 wrote:
.. imageViewer::funcA();
To make such call possible.
finA()
must be static function of classimageViewer
.Prasad Notifier using ATL | Operator new[],delete[][^]