[bme-develop] Major update + some errors
Status: Planning
Brought to you by:
sirmik
From: Sir M. <obe...@ho...> - 2004-09-18 14:34:15
|
Hey guys, I'm doing a major update of the contact related code. We now have a Contact class that represents contacts of course... a User class that represents the user(and reimplements some of the contact methods to deliver user specific behaviour, like for the userpic functions)...I also made a Status class to represent msnstatusses(stati?)...and a ContactItem class that draws the contacts in the ContactListView. I've almost got this code working...but there seems to be smth wrong with the Status archiving code...maybe some of you can help, this is the BArchivable related code: Status::Status(BMessage* archive) { archive->FindString("Status::statusName",&statusName); archive->FindString("Status::statusAbbreviation",&statusAbbreviation); BMessage msg; if (archive->FindMessage("Status::statusIcon",&msg) == B_OK) { BArchivable* obj = instantiate_object(&msg); statusIcon = dynamic_cast<BBitmap*>(obj); } } BArchivable* Status::Instantiate(BMessage *archive) { if (validate_instantiation(archive, "Status")) return new Status(archive); return NULL; } status_t Status::Archive(BMessage *archive, bool deep) const { archive->AddString("class","Status"); archive->AddString("Status::statusName",statusName); archive->AddString("Status::statusAbbreviation",statusAbbreviation); if(deep) { BMessage child; statusIcon->Archive(&child); archive->AddMessage("Status::statusIcon",&child); } return B_OK; } the program crashes on startup...it seems there's something going wrong in the validate_instantiation method...it crashes saying that there was a segment fault in strcmp in that function...any idea what I'm doing wrong? Btw Daniel do we need to have the MsnObject in the Contact class(like we had it in the MsnBuddy code)? What does this MsnObject code do anyway? Oh and I'm also talking with Remi of BeosFrance to help us with designing some emoticons...he sent me some already, and they look very promising. regards, Tim _________________________________________________________________ Talk with your online friends with MSN Messenger http://messenger.msn.nl/ |