What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » ReadInterfacePtr + WriteInterfacePtr (DataBloc)

ReadInterfacePtr + WriteInterfacePtr (DataBloc)
Author: Message:
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. ReadInterfacePtr + WriteInterfacePtr (DataBloc)
What can these be used for? (anything more specific than "writing or reading an interface pointer" :P)

This post was edited on 03-12-2007 at 04:41 PM by deAd.
03-12-2007 04:31 PM
Profile PM Find Quote Report
matty
Scripting Guru
*****


Posts: 8336
Reputation: 109
39 / Male / Flag
Joined: Dec 2002
Status: Away
RE: ReadInterfacePtr + WriteInterfacePtr (DataBloc)
There was a thread in the beta testing forum but there wasn't a definite answer.

quote:
Originally posted by Patchou
Well this is used to keep a pointer to any kind of ActiveX object and get it back as such as the interface returns an IDispatch pointer. This means that you can create; for example, a MediaPlayer object in a function, call AddRef() in it, write the pointer to a databloc and read it again in another function. JScript bqsic variables dont have IDispatch interfaces so you cant use that function with them.

Is really all we got out of Patchy Watchy.
03-12-2007 05:04 PM
Profile E-Mail PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. RE: ReadInterfacePtr + WriteInterfacePtr (DataBloc)
...nothing else :P?

I've called CoCreateInstance and gotten an interface pointer, and I can get another databloc from that which seems to have all the addresses to the functions in the object's virtual table, but I have no idea how to call them..

From what Patchou said in that quote this seems to be the wrong approach, as I have to use ReadDWORD because ReadInterfacePtr crashes it :P
03-12-2007 05:08 PM
Profile PM Find Quote Report
TheSteve
Full Member
***

Avatar
The Man from Japan

Posts: 179
Reputation: 23
40 / Male / Flag
Joined: Aug 2005
RE: RE: ReadInterfacePtr + WriteInterfacePtr (DataBloc)
quote:
Originally posted by deAd
I've called CoCreateInstance and gotten an interface pointer, and I can get another databloc from that which seems to have all the addresses to the functions in the object's virtual table, but I have no idea how to call them..

I would assume that ReadInterfacePtr is essentially a simple cast to a COM object as opposed to a DWORD.

In order to call the functions in the object's virtual table, you would need to know the parameters of the function you're trying to get, and then you'd have to manage to get JScript to let you call that function with those parameters.
03-14-2007 02:59 PM
Profile PM Web Find Quote Report
Patchou
Messenger Plus! Creator
*****

Avatar

Posts: 8607
Reputation: 201
43 / Male / Flag
Joined: Apr 2002
RE: ReadInterfacePtr + WriteInterfacePtr (DataBloc)
WriteInterfacePtr simply writes the address of the IDispatch interface associated with the object, nothing more. It is your responsability to do thigns like AddRef and Release to make sure the object is not destroyed before the interface pointer is read back.

If you have a particular example of something you want to do, please post :)
[Image: signature2.gif]
03-15-2007 08:36 PM
Profile PM Web Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: ReadInterfacePtr + WriteInterfacePtr (DataBloc)
quote:
Originally posted by Patchou
WriteInterfacePtr simply writes the address of the IDispatch interface associated with the object, nothing more. It is your responsability to do thigns like AddRef and Release to make sure the object is not destroyed before the interface pointer is read back.

If you have a particular example of something you want to do, please post :)

Is it possible to actually create a new IDispatch object (exposing IMessenger purely as an example) using JScript only (no dll) and then get a object for it so it's possible to do something like:
IMessenger.Signout();
I know you expose all the important stuff from IMessenger in the Messenger object but purely for example's sake...

Or is it just a case of not being able to create objects this way, and ReadInterfacePtr can only be used on objects which have been written to a DataBlock previously using WriteInterfacePtr.

Thanks for replying anyway though, even if you are still being rather vague, leaving me in my confused state... :P
03-15-2007 08:55 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
O.P. RE: RE: ReadInterfacePtr + WriteInterfacePtr (DataBloc)
quote:
Originally posted by EljayIs it possible to actually create a new IDispatch object (exposing IMessenger purely as an example) using JScript only (no dll) and then get a object for it so it's possible to do something like:
IMessenger.Signout();
That was exactly my question :P
03-15-2007 09:03 PM
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