What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Invoking main thread in plugin to call DisplayToast

Invoking main thread in plugin to call DisplayToast
Author: Message:
ketchup_blade
New Member
*


Posts: 8
Joined: Jul 2005
O.P. Invoking main thread in plugin to call DisplayToast
I'm a C# programmer, not really a VB.net programmer, and I am unable yet to get back to the main thread of my plugin (that I'm coding in VB.net).

Desc: I have my plugin thread in VB.net that is calling some library I wrote in C# which generate an event that my plugin receives on callback.  However, since the event is not generated on the main thread, when I call DisplayToast, nothing shows up (which is normal as stated by this line in the function definition of DisplayToast by Patchou) : "Technical Note: the message must be sent from the same thread Initialize() was called, else, Messenger Plus! will reject the call for security reasons."

Question: how can I use delegates in VB.net to get back to my main thread? Normally using C#, I would do something like this to get to my main thread:

public delegate void CompletedMyFunctionDelegate( bool callSuccess );
private void CompletedMyFunction(bool callSuccess)
{
  if( this.InvokeRequired )
  {
    this.Invoke(new CompletedMyFunctionDelegate(CompletedMyFunction), new object[] { callSuccess });
       return;
  }

  // other code here running on main thread
}

any help from VB.net programmers would be appreciated.

thanks.
07-07-2005 01:26 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Invoking main thread in plugin to call DisplayToast - by ketchup_blade on 07-07-2005 at 01:26 PM
RE: Invoking main thread in plugin to call DisplayToast - by RaceProUK on 07-07-2005 at 08:29 PM


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