What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Get Variable pointer

Get Variable pointer
Author: Message:
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. Get Variable pointer
How can I get the pointer to a variable? The variable is a string. :S
07-14-2006 04:50 PM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
35 / Male / Flag
Joined: Mar 2004
RE: Get Variable pointer
code:

var str = "moo goes the cow";
var strPtr = Interop.Allocate( (str.length *2) +2);
strPrt.WriteString(0,str);

Debug.Trace("The pointer is ..." + strPtr.DataPtr );

[Image: dt2.0v2.png]      Happy Birthday, WDZ
07-14-2006 05:33 PM
Profile PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Get Variable pointer
quote:
Originally posted by -dt-
code:

var str = "moo goes the cow";
var strPtr = Interop.Allocate( (str.length *2) +2);
strPrt.WriteString(0,str);

Debug.Trace("The pointer is ..." + strPtr.DataPtr );


for deAd: note that this does not give the pointer to the 'str' variable, but rather gives a pointer to another copy of that string.
.-= A 'frrrrrrrituurrr' for Wacky =-.
07-14-2006 08:26 PM
Profile PM Find Quote Report
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
RE: Get Variable pointer
Maybe a weird question, but how could this be done for a function?
A function is not a string...

I was thinking of subclassing with JScript (Y) (Ultimate power8o|:P)
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
08-30-2006 12:05 AM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. RE: Get Variable pointer
How would you receive the events for subclassing?

And do you mean the function's memory address? nope, you have to be able to write what you want the pointer to in the DataBloc :/
08-30-2006 12:33 AM
Profile PM Find Quote Report
Shondoit
Full Member
***

Avatar
Hmm, Just Me...

Posts: 227
Reputation: 15
35 / Male / Flag
Joined: Jul 2006
RE: Get Variable pointer
You can Hook the events with SetWindowLong, I'm not sure about the name...
I don't have the time to find the documentation now...

Any other way of getting a pointer?
My scripts:                            [Image: shondoit.gif]
+ Timezone
+ Camelo
+ Multisearch
08-30-2006 12:47 AM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. RE: Get Variable pointer
But when you hook the events, you won't be able to receive the events afaik without an external dll, and in that case you could just subclass in the dll.
08-30-2006 01:12 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Get Variable pointer
quote:
Originally posted by deAd
But when you hook the events, you won't be able to receive the events afaik without an external dll
What that external DLL does or is used for is to execute a function at a given address (callback), nothing more. Hence why Shondoit asks if it is possible to get a pointer to a function in JScript.
So instead of giving an address for a function in that DLL, you give the address of a function in JScript....

This post was edited on 08-30-2006 at 01:26 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-30-2006 01:24 AM
Profile PM Find Quote Report
« 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