I use some functions like getByteLength() in my handleMessage(cMessage *msg) function, so I decided to cast msg to cPacket to be able to use these functions. For this I wrote the following code:
cPacket *tempPtr = check_and_cast<cPacket *>(msg);
and then I use tempPtr at places, where the cPacket functions are called.
When I compile all, there is no errors, but when I want to run TKenv there is
the following error:
Error in module(.....):
check_and_cast():cannot cast (cMessage*).......[0].per_second_timer to type
"P7cPacket".
per_second_timer is declared as cMessage:
per_second_timer = new cMessage("per_second_timer");
scheduleAt(simTime(), per_second_timer);
Can you help me?
regards,
Vitali
____________________________________________________________________
Psssst! Schon vom neuen WEB.DE MultiMessenger gehört?
Der kann`s mit allen: http://www.produkte.web.de/messenger/?did=3123
_______________________________________________
Omnetpp-l mailing list
Omne...@omnetpp.org
http://lists.omnetpp.org/mailman/listinfo/omnetpp-l