AndresBarbaRoja
17th March 2011, 16:18
Hi, I need to call a method from a non-member function. Is there a way to reach an object from the outside? (i'm sorry that i can't find the right way to express my question, but please bear with me...) I'm loking for something like
Appname->object.processMessage()
but I can't find a way to do it.
This is a stub of my class implementation.
I'm working with a subclass of QThread and HLP_Init comes from an external library. I tried to pass the method directly to the HLP Init, but that did not work because the compiler complained that the type of function was not right.
void HLPReceiveMessage(tyHLP_Message message, tyHLP_LinkID linkId)
{
//i need to call void HLP_LinkManager::processMessage() here
}
void HLPReceiveError(tyHLP_Error err, tyHLP_LinkID linkId)
{
}
void HLP_LinkManager::run()
{
int rc;
//HLP server initialization
rc=HLP_Init(HLP_LINK_SERVER,HLPReceiveMessage,HLPR eceiveError);
}
void HLP_LinkManager::processMessage()
{
//do stuff here
}
And thanks in advance!
Appname->object.processMessage()
but I can't find a way to do it.
This is a stub of my class implementation.
I'm working with a subclass of QThread and HLP_Init comes from an external library. I tried to pass the method directly to the HLP Init, but that did not work because the compiler complained that the type of function was not right.
void HLPReceiveMessage(tyHLP_Message message, tyHLP_LinkID linkId)
{
//i need to call void HLP_LinkManager::processMessage() here
}
void HLPReceiveError(tyHLP_Error err, tyHLP_LinkID linkId)
{
}
void HLP_LinkManager::run()
{
int rc;
//HLP server initialization
rc=HLP_Init(HLP_LINK_SERVER,HLPReceiveMessage,HLPR eceiveError);
}
void HLP_LinkManager::processMessage()
{
//do stuff here
}
And thanks in advance!