AutoHotkey Community

It is currently May 25th, 2012, 1:59 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: August 4th, 2007, 5:16 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
I am wanting to have two scripts talk without using Messages, just for fun.....

I am perfectly capable of creating the message handlers and everything else, i don't need someone's script to do that. No offense to Maj. Or you.

I have a debugger I made about 6 months ago or so, but have refused to release it, because it uses messages and *could* interfere with someones scripts.... I though RegisterCallback would get around that, but it doesn't....

Also this (http://www.autohotkey.com/forum/viewtopic.php?t=20428) would be better without using messages, too.

There is lots that could be done with this functionality.

I was really wanting an answer from The Man (Chris).....So I'll post it as a bug and get some feedback there.....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2007, 10:06 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
From the sourcecode it seems that the address returned from registercallback is to an internal ahk structure which, in turn, holds the adress of the registered function (script2.cpp, line ~14000):
Code:
struct RCCallbackFunc // Used by BIF_RegisterCallback() and related.
{
   ULONG data1;   //E8 00 00 00
   ULONG data2;   //00 8D 44 24
   ULONG data3;   //08 50 FF 15
   UINT (__stdcall **callfuncptr)(UINT*,char*);
   ULONG data4;   //59 84 C4 nn
   USHORT data5;   //FF E1
   //code ends
   UCHAR actual_param_count; // This is the actual (not formal) number of parameters passed from the caller to the callback. Kept adjacent to the USHORT above to conserve memory due to 4-byte struct alignment.
   bool create_new_thread; // Kept adjacent to above to conserve memory due to 4-byte struct alignment.
   DWORD event_info; // A_EventInfo
   Func *func; // The UDF to be called whenever the callback's caller calls callfuncptr.
};

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2007, 10:11 pm 
Offline

Joined: July 23rd, 2007, 3:43 am
Posts: 47
ahklerner wrote:
I am perfectly capable of creating the message handlers and everything else, i don't need someone's script to do that.
Yeah.. I wasn't doubting you already had a workaround in place; I just wanted to point it out. I also wanted to make sure this topic had a link to that alternative since I'm sure there will be more people that may try experimenting w/ the same Registercallback technique. After 1.0.47 was released- that was my first experiment with it. (..like to think its not just us..).

Quote:
I have a debugger I made about 6 months ago or so, but have refused to release it, because it uses messages and *could* interfere with someones scripts.... I though RegisterCallback would get around that, but it doesn't....
I'm sure you have probably already looked into this.. but couldn't you stack the messages (like for WM_COPYDATA in Maj's example?). I know his tutorial is esentially for custom gui controls- but the technique could provide you some encapsulation for your debugger. :roll:

Quote:
I was really wanting an answer from The Man (Chris).....So I'll post it as a bug and get some feedback there.....
I was curious to hear his words on this too: it does seem that registercallback should be able to be used for this purpose (it doesn't say it can't be :wink: )


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 4th, 2007, 10:14 pm 
Offline

Joined: July 23rd, 2007, 3:43 am
Posts: 47
tonne wrote:
From the sourcecode it seems that the address returned from registercallback is to an internal ahk structure which, in turn, holds the adress of the registered function
Interesting..


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2007, 1:44 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
I'm eagerly waiting for someone else to attempt RegisterCallback as a communication means across different machines. :lol:

Helpy already answered on this. If you hadn't understood it, what you should have done was to try reading anything on the memory management of Windows, especially NT family, not to bother Chris or the forum further. The current attempt is not of much difference with the above, IMO.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2007, 4:28 am 
Offline

Joined: July 23rd, 2007, 3:43 am
Posts: 47
Sean wrote:
I'm eagerly waiting for someone else to attempt RegisterCallback as a communication means across different machines. :lol:
Well- the intent wasn't across different machines.. but different processes on the same machine.

Quote:
Helpy already answered on this. If you hadn't understood it, what you should have done was to try reading anything on the memory management of Windows, especially NT family, not to bother Chris or the forum further.
Sorry to bother you- but after all.. the topic is Register callback...I need help or better understanding & we were exploring our possibilities. We have learned our lesson :roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2007, 6:06 am 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
Sean wrote:
Helpy already answered on this.

Ok.....From now on I'll believe everything that an unregistered user posts....Not

Sean wrote:
If you hadn't understood it,....try reading....not to bother Chris or the forum further.

Sorry, pal....this is not the AutoIt forum....If it is a bother to you, don't read my posts....It's not like I spam the forum with Stupid questions....I help people out when I can....Which is one of the best things about this community...People helping others...Without being a bunch of a$$holes....

Don't get me wrong, you have made great contributions to the community here...Someone or something pissed you off...whatever...it was not me....get the chip off of your shoulder....

Sean wrote:
If you hadn't understood it

You should try reading a book about the English language.

Sean wrote:
The current attempt is not of much difference with the above, IMO.

Wow...you're a quick one....It is exactly the same....In fact, I used copy & paste.

Thanks, Sean for your useful post.

daniel2 wrote:
We have learned our lesson

lol


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: CodeKiller, gemisigo, just me, Prankie, rbrtryn, Yahoo [Bot] and 16 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group