What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [solved] CreateThread/GetCallbackPtr issues

[solved] CreateThread/GetCallbackPtr issues
Author: Message:
Danny22
New Member
*


Posts: 11
Joined: Dec 2008
O.P. [solved] CreateThread/GetCallbackPtr issues
Hello,

I'm having issues when trying to use the CreateThread WinAPI, and I hope someone here can assist me.
Seems like the callback function is never called for some reason, as the message box never shows, but CreateThread doesn't seem to fail.

Example code:
code:
var thread_id = Interop.Allocate(4);
var func = Interop.GetCallbackPtr("ExampleCallback");
var thread = Interop.Call("kernel32.dll", "CreateThread", null, 0, func, null, 0, thread_id);
if (!thread)
{
    Debug.Trace("Could not create thread.");
    return;
}

Callback function:
code:
function ExampleCallback(Param)
{
    Interop.Call("user32.dll", "MessageBoxW", 0, "It works!", "", 0);
    return 1;
}

Any ideas?

This post was edited on 12-25-2008 at 10:36 AM by Danny22.
12-24-2008 07:18 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[solved] CreateThread/GetCallbackPtr issues - by Danny22 on 12-24-2008 at 07:18 PM
RE: CreateThread issues - by matty on 12-24-2008 at 07:29 PM
RE: CreateThread issues - by Danny22 on 12-24-2008 at 07:32 PM
RE: CreateThread issues - by Eljay on 12-24-2008 at 07:41 PM
RE: [solved] CreateThread issues - by matty on 12-24-2008 at 07:46 PM
RE: [solved] CreateThread issues - by Danny22 on 12-24-2008 at 07:48 PM
RE: [solved] CreateThread issues - by Eljay on 12-24-2008 at 08:12 PM
RE: RE: [solved] CreateThread issues - by Danny22 on 12-24-2008 at 08:29 PM
RE: [solved] CreateThread issues - by Mnjul on 12-24-2008 at 08:39 PM
RE: [solved] CreateThread issues - by Danny22 on 12-25-2008 at 12:19 AM
RE: [solved] CreateThread issues - by Matti on 12-25-2008 at 09:32 AM
RE: [solved] CreateThread/GetCallbackPtr issues - by Pinecone on 12-26-2008 at 10:15 AM


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