PDA

View Full Version : pointer



mickey
27th July 2006, 00:44
him I've a prob.
I have;


QProgressDIalog* ppp //this in class Object
ppp = 0; //in costructor of Object
void object::setProgr(QProgressDialog* p){
ppp=p;
}
//mainForm.cpp
QProgressDIalog* prog = new QProgressDIalog();
this->setProgr (prog);

It compile but on give me runtime error...why?Ho can I do?
are there other way to pass pointer? it seems that ppp remain null...
thanks

wysota
27th July 2006, 14:09
Maybe somewhere in your code you try to dereference the pointer which has not been initialised? What does a debugger say?

Kumosan
1st August 2006, 09:13
It compile but on give me runtime error...why?Ho can I do?
are there other way to pass pointer? it seems that ppp remain null...
thanks

With your shortended code example it is really hard to say. We know what you want to do, but the how is somewhat incomplete. At least the interesting scope information got lost.

sumsin
1st August 2006, 10:34
try


ppp = new QProgressDialog(p);

instead of


ppp=p;

croland
1st September 2006, 00:42
I am just going from the example, but in setProgr you're using QProgressDialog, but you're passing QProgressDIalog. Would this affect anything?