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

Automation Error
Author: Message:
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. Automation Error
I am using a dll in my script and it works fine for me, but others experience trouble when it calls a function... This is the code used to call the function from the dll

code:
    new ActiveXObject('felipe.sarabia').SetMusicInfo('', '', '', ReadRegistry("PSM_icon"), '', MsgPlus.RemoveFormatCodes(strMyNewPSM));


The error message says something about an Automation error, the object couldn't be created

Any ideas why it would do this on others PCs, but not on mine?
<Eljay> "Problems encountered: shit blew up" :zippy:
09-16-2006 06:05 PM
Profile PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: Automation Error
maybe the DLL isn't registered?
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
09-16-2006 06:06 PM
Profile PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. RE: Automation Error
I'm not sure I ever registered it on mine... Is it possible to register it via a script, as this may explain it (It's a dll from another script).

I'm a total noob with DLLs and things like this.

EDIT: Could I create a new Shell object and run regsrvr32 on the dll?

This post was edited on 09-16-2006 at 06:11 PM by Spunky.
<Eljay> "Problems encountered: shit blew up" :zippy:
09-16-2006 06:08 PM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: Automation Error
pfft  this does what you want without other dlls

code:
/*
Function by -dt- (Matt Labrum) (Converted from http://forums.fanatic.net.nz/index.php?showtopic=11311&st=0# )

Void setNowPlaying( boolean enabled, [String type [, String format [, String title [, String artist [, String album [, String contentID ]]]]]] );

if enabled is true the now playing will show, if its false then the personal message will show.
type is the type of image you want to display. Either Music, Office or Games.
format is the format of the song eg {0} by {1} which would show title by artist.
format can also be a message eg "moo goes the cow"

Examples:

setNowPlaying(true, "Music", "{0} - {1}", "dt", "dt's band", "dt's album");

or setting it to a Game icon and displaying a message

setNowPlaying(true, "Games", "yay playing warcraft");

or set it to the office icon
Playing(true, "Office", "yay using word :P");
setNow

and turning it off
setNowPlaying(false);

*/


function setNowPlaying(enabled, type, format, title, artist, album, contentID){
    if(typeof(type) == "undefined")type = "Music";
    if(typeof(format) == "undefined")format = "";
    if(typeof(title) == "undefined")title = "";
    if(typeof(artist) == "undefined")artist = "";
    if(typeof(album) == "undefined")album = "";
    if(typeof(contentID) == "undefined")contentID = "";
    enabled = Math.abs(enabled);
   
    var WM_COPYDATA = 0x4A;
   
    //reference
    var song = Interop.Allocate(512);
   
    //change the Music thing to Games or Office or
    song.WriteString(0, "\\0" + type + "\\0" + enabled + "\\0" + format +"\\0" + title +"\\0" + artist + "\\0" + album + "\\0" + contentID + "\\0");
   
   
    //write our copyDataStruct Structure
    var copyDataStruct = Interop.Allocate(12);
    copyDataStruct.WriteDWORD(0, 0x547); //dwData
    copyDataStruct.WriteDWORD(4, song.Size); //cbData
    copyDataStruct.WriteDWORD(8, song.DataPtr);  //lpData
   
   
    //Send it to all open messengers
    var hMSGRUI = 0;
    do{
        hMSGRUI = Interop.Call("User32", "FindWindowExW", 0, hMSGRUI, "MsnMsgrUIManager", 0);
        if(hMSGRUI > 0){
            Interop.Call("User32", "SendMessageW", hMSGRUI, WM_COPYDATA, 0, copyDataStruct);   
        }
    }while(hMSGRUI != 0);


}

[Image: dt2.0v2.png]      Happy Birthday, WDZ
09-16-2006 06:29 PM
Profile PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
36 / Male / Flag
Joined: Aug 2006
O.P. RE: Automation Error
Thanks -dt-. It work perfect. Saves me a lot of hassle I think :p
<Eljay> "Problems encountered: shit blew up" :zippy:
09-16-2006 07:27 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