I am working on Visual C++. Can you please help in this syntax .
class CVisionSystem
{
public:
CVisionSystem();
~CVisionSystem(void);
int Init();
private:
PvDevice device;
// PvStream object
PvStream stream;
// Buffer
CustomPipeline *pipeline;
// GEV Parameters
PvGenParameterArray *deviceParams;
PvGenInteger *parTLLocked;
};
int CVisionSystem::Init()
{
deviceParams = device.GetGenParameters();
parTLLocked = dynamic_cast<PvGenInteger *>( deviceParams->Get( "TLParamsLocked" ) );
}
deviceParms gets valid value, however parTLlocked gets NULL value that leads to an error : “error expression cannot be evaluated, _vfptr CX0030 and mthis CX0076.
What can be the problem of ParTLLocked ?
I am guessing that
deviceParams->Get( "TLParamsLocked" )returns a type that can not be dynamic casted toPvGenInteger *. The return type should be a pointer to either a subclass or a parent class ofPvGenInteger(or possibly the same class) for this dynamic_cast to return non-null value.