Err...to be precise, I think TB's code should be like this...
(This should be a global variable so that other functions such as ParseCommand can use it)
code:
IMessenger* pResult=NULL;
And in Initialize...
code:
iMessengerObj->QueryInterface(IID_IMessenger,(void**)&pResult);
When you finish using the code just use pResult->Release(). Indeed, as Patchou says in the .h file, don't use Release on iMessengerObj.
You may need same skills if you need to retrieve a conversation window in ParseCommand/Tag/ReceiveNotify
Of course, remember to include Messenger API (not Plus! Plugin API) headers before using these codes. Details can be found in Messenger API documentation.