What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [WHAT??] Array pointers

[WHAT??] Array pointers
Author: Message:
SmokingCookie
Senior Member
****

Avatar

Posts: 815
Reputation: 15
30 / Male / Flag
Joined: Jul 2007
O.P. RE: [WHAT??] Array pointers
It appears to me that I've got a code quite similar to that, but a bit more flexible:

code:
        // Create the BUTTONS "array"
        var BUTTONS = Interop.Allocate(Math.min(arrButtonIds.length,arrButtonLabels.length) * 8);
   
        // Create the array for the buttons and the button labels
        var BUTTONS_ARRAY = new Array();
        var BUTTONTEXTS = new Array();
   
        // Write'em all into a DataBlock object
        for(var i = 0; i < Math.min(arrButtonIds.length,arrButtonLabels.length); i++) {
            // Write the current button's label into a DataBlock object
            BUTTONTEXTS[i] = Interop.Allocate((arrButtonLabels[i].length + 1) * 2);
            BUTTONTEXTS[i].writeSTRING(0,arrButtonLabels[i]);
   
            // Write the remaining required data into a DataBlock object
            BUTTONS_ARRAY[i] = Interop.Allocate(4 + Math.min(arrButtonIds.length,arrButtonLabels.length) * 8);
            with(BUTTONS_ARRAY[i]) {
                writeDWORD(0,arrButtonIds[i]);
                writeDWORD(4,BUTTONTEXTS[i].DataPtr);
            }
        }
    }


Just an additional note: I'm pretty tired ATM, so I may start to make big mistakes over time..

EDIT::

Matti,

I've implemented your code (thank you for giving me another half hour of work :P ), yet nothing happens, neither on my screen, nor in the debugger. I'm not going to sort this out today any more (like I said before, I'm tired).

EDIT::

I seem to get E_INVALIDARG errors, an indication of either a stupid typo, or a major error..

This post was edited on 08-21-2008 at 05:46 PM by SmokingCookie.
08-20-2008 08:05 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
[WHAT??] Array pointers - by SmokingCookie on 08-20-2008 at 04:28 PM
RE: [WHAT??] Array pointers - by Eljay on 08-20-2008 at 04:43 PM
RE: [WHAT??] Array pointers - by SmokingCookie on 08-20-2008 at 04:57 PM
RE: [WHAT??] Array pointers - by Matti on 08-20-2008 at 07:03 PM
RE: [WHAT??] Array pointers - by SmokingCookie on 08-20-2008 at 08:05 PM
RE: [WHAT??] Array pointers - by Matti on 08-22-2008 at 10:36 AM
RE: [WHAT??] Array pointers - by Eljay on 08-22-2008 at 11:40 AM
RE: [WHAT??] Array pointers - by Matti on 08-22-2008 at 11:57 AM
RE: [WHAT??] Array pointers - by andrewdodd13 on 08-22-2008 at 03:53 PM
RE: [WHAT??] Array pointers - by Matti on 08-22-2008 at 04:04 PM
RE: [WHAT??] Array pointers - by SmokingCookie on 08-22-2008 at 04:05 PM
RE: [WHAT??] Array pointers - by Matti on 08-22-2008 at 04:50 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