What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Thread or Window

Pages: (3): « First « 1 [ 2 ] 3 » Last »
Thread or Window
Author: Message:
CMI
Junior Member
**


Posts: 17
Joined: Jul 2004
O.P. RE: Thread or Window
Well, SetTimer mostly works. If I'm not really careful it brings down Messenger Plus and concequently MSN Messenger. Of course, now I can't get actions to properly fire using the IMessenger interface. Man I hate Visual Basic.
07-10-2004 04:04 PM
Profile E-Mail PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: Thread or Window
You hate VB? Well, great, I code in C++:P

You have to use QueryInterface to get IMessenger and set it to a global variable (so that your call back function can use it) in Initialize function, like

IMessenger* MsgrInstance;

iMessengerObj->QueryInterface(IID_IMessenger,(void**)&MsgrInstance);
07-10-2004 04:10 PM
Profile PM Web Find Quote Report
CMI
Junior Member
**


Posts: 17
Joined: Jul 2004
O.P. RE: Thread or Window
Well, this plug-in is to support a fairly large behind schedule VC++ app. I'm using VB to get things done faster. Of course, I'm still having the problem where a video invite won't fire :) If anyone is curious, http://www.msnfanatic.com/forums/index.php?showtopic=9888&st=0&
07-10-2004 04:15 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Thread or Window
Mnjul, you don't have to QueryInterface, a mere typecast to IMessenger3* will do the trick (not pretty though I admit).

CMI, if you want to fire off a new thread in C++, just use the following function call:
code:
_beginthread(<funcname>, <stacksize>, <arglist>);
I've only used it with a function that takes a single argument, so I'm not sure how it would handle multiple arguments, but a quick search on MSDN should help. My guess is that you'd have to do a little bit of processing yourself: others on the forums may be able to help you more.
Also, remember to #include <process.h>, or it won't compile.
Don't worry about ending the thread: once the function returns, the thread is terminated by Windows.
[Image: spartaafk.png]
07-11-2004 02:54 PM
Profile PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Thread or Window
Just because its Win32, doesn't mean you have to use its API. I prefer writing non-platform specific code if I can.
[Image: spartaafk.png]
07-11-2004 05:04 PM
Profile PM Web Find Quote Report
CMI
Junior Member
**


Posts: 17
Joined: Jul 2004
O.P. RE: RE: Thread or Window
quote:
Originally posted by raceprouk
Just because its Win32, doesn't mean you have to use its API. I prefer writing non-platform specific code if I can.


I wrote the plug-in in VB, so there is no point trying to use platform independant APIs :) The SetTimer call is working just fine, but I'm still having that StartVideo problem no one seems to know anything about.
07-11-2004 07:07 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Thread or Window
CMI:
I didn't realise you were using VB, as you mentioned the IMessenger interface, which is C++. Reading back over the thread, I see that you are indeed using VB, so anything I gave you for C++ doesn't actually apply. O well, still could be useful.

TB:
I stand by my original comment. Anyway, which uses less resources: standard library function, or Win32 API?
[Image: spartaafk.png]
07-11-2004 08:05 PM
Profile PM Web Find Quote Report
CMI
Junior Member
**


Posts: 17
Joined: Jul 2004
O.P. RE: Thread or Window
How about we forget about all this and head over to me StartVideo thread :)
07-11-2004 08:06 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Thread or Window
Good idea.

offtopic: Admins, would a split be useful here?
[Image: spartaafk.png]
07-11-2004 08:11 PM
Profile PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: Thread or Window
Do you know for certain though? I know I don't. Why not run a little test, say create 1000 threads using each method and measuring the resource usage some way.
[Image: spartaafk.png]
07-11-2004 08:26 PM
Profile PM Web Find Quote Report
Pages: (3): « First « 1 [ 2 ] 3 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On