Shoutbox

IDispatch* ? (C++) - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: IDispatch* ? (C++) (/showthread.php?tid=28218)

IDispatch* ? (C++) by piderman on 07-06-2004 at 07:42 AM

I would like to make some plugin for Plus! using the Messenger API, but I can't figure out how to do this. It seems I should use the iMessengerObj object in the Initialize function, but I don't know how to access/Invoke it :S, and the API documentation gives no clue.
Can someone tell me how I can activate and use it? (preferably with some code I can copy&paste :D)
Better yet, does someone have an open-source plugin using this (in C++) that I can examine?


RE: IDispatch* ? (C++) by Mnjul on 07-06-2004 at 10:53 AM

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. :)
RE: IDispatch* ? (C++) by RaceProUK on 07-06-2004 at 02:44 PM

The dirty method works just as well, having used it myself.
If you want more help with the Messenger API piderman, feel free to PM me. The API isn't actually that hard to understand, just a pain to use sometimes.