[?] MediaMonkey scripting ActiveXObject... |
Author: |
Message: |
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. [?] MediaMonkey scripting ActiveXObject...
I've recently switched from iTunes to MediaMonkey, after iTunes kept crashing and refusing to close and stuff. Seems MediaMonkey also has a scripting system, so I thought I'd experiment with it a bit.
Unfortunately, I can't get any further than this:
js code: var SDB = new ActiveXObject("SongsDB.SDBApplication");
...which causes Messenger to hang for about 30 seconds, before showing an error.
code: Error: Automation server can't create object (code: -2146827859)
I have MediaMonkey installed as a portable app (at C:\Portable Apps\MediaMonkey with the config files in the same directory). Is it possible that is the problem?
|
|
06-27-2011 06:50 PM |
|
|
CookieRevised
Elite Member
Posts: 15517 Reputation: 173
– / /
Joined: Jul 2003
Status: Away
|
RE: [?] MediaMonkey scripting ActiveXObject...
quote: Originally posted by whiz
I have MediaMonkey installed as a portable app (at C:\Portable Apps\MediaMonkey with the config files in the same directory). Is it possible that is the problem?
quite...
In order for an ActiveX object to work you need to register the DLL (or OCX, or EXE) files (with regsvr32.exe). And those registry settings need to be in the computer's own real registry (not in a file only used by the portable app as the computer's registry replacement to make it 'portable') so that any application can access it if needed.
This post was edited on 06-28-2011 at 08:02 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
|
|
06-28-2011 08:01 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [?] MediaMonkey scripting ActiveXObject...
quote: Originally posted by CookieRevised
In order for an ActiveX object to work you need to register the DLL (or OCX, or EXE) files (with regsvr32.exe). And those registry settings need to be in the computer's own real registry (not in a file only used by the portable app as the computer's registry replacement to make it 'portable') so that any application can access it if needed.
Thing is, though... to make MediaMonkey portable, you just move the config file from the user's AppData folder to the application folder - it always writes to a file, regardless of being portable or not. And I ran it once first before making it portable, so surely the DLL should already be registered (I am running it from the PC, not off a memory stick or anything)?
Perhaps also something to do with using an x64 version of Windows?
|
|
06-29-2011 06:57 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [?] MediaMonkey scripting ActiveXObject...
quote: Originally posted by whiz
Perhaps also something to do with using an x64 version of Windows?
Try using %windir%\SysWOW64\regsvr32.exe to register the DLL
|
|
06-29-2011 07:02 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [?] MediaMonkey scripting ActiveXObject...
quote: Originally posted by matty
Try using %windir%\SysWOW64\regsvr32.exe to register the DLL
Yeah, just did a few searches and found something telling me to do that... Seems to be working now, thanks.
|
|
06-29-2011 07:09 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [?] MediaMonkey scripting ActiveXObject...
quote: Originally posted by whiz
quote: Originally posted by matty
Try using %windir%\SysWOW64\regsvr32.exe to register the DLL
Yeah, just did a few searches and found something telling me to do that... Seems to be working now, thanks.
This was also the culprit for SendTo not properly working on x64. Unfortunately a new version hasn't been released yet that resolves the issue.
|
|
06-29-2011 07:44 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [?] MediaMonkey scripting ActiveXObject...
Turns out those instructions only fixed it temporarily... the problem appears to be back after about a week or so of it working. I'll have to experiment with it and see what I can find.
|
|
07-03-2011 01:02 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [?] MediaMonkey scripting ActiveXObject...
I have managed to make a workaround, although not a very good one. By running the command line stuff as a batch file on system startup, it makes sure the next startup will have the libraries available... for some reason, they don't seem to stay after a restart.
|
|
07-26-2011 12:21 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: [?] MediaMonkey scripting ActiveXObject...
What if you registered the DLL through your code? Calling DLLRegisterServer (I think it is) from the DLL.
js code: function RegisterDLL(DLLPATH) {
var iLib = Interop.Call('kernel32', 'LoadLibraryW', DLLPATH);
if (iLib) {
var iProcAddr = Interop.Call('kernel32', 'GetProcAddress', iLib, 'DllRegisterServer');
if (iProcAddr) {
if (Interop.Call('user32', 'CallWindowProcW', iProcAddr, 0, 0, 0, 0) === 0 /* ERROR_SUCCESS */) {
// DLL has been registered
}
else {
// DLL failed to register...
var buffer = Interop.Allocate(1024);
Interop.Call('kernel32', 'FormatMessageW', 0x1000, 0, Interop.GetLastError(), 0, buffer, 1024, 0);
Debug.Trace(buffer.ReadString(0));
buffer.Size = 0;
}
}
else
Debug.Trace('Could not find ProcAddress for DllRegisterServer');
}
else
Debug.Trace('Could not load the DLL');
Interop.Call('kernel32', 'FreeLibrary', iLib);
}
This post was edited on 07-26-2011 at 05:08 PM by matty.
|
|
07-26-2011 12:34 PM |
|
|
whiz
Senior Member
Posts: 568 Reputation: 8
– / – /
Joined: Nov 2008
|
O.P. RE: [?] MediaMonkey scripting ActiveXObject...
I'll give it a go, but I don't think it'll work (in the sense that by doing it, the ActiveXObject will work), since I seem to need to restart before I can use the ActiveX...
Edit: always prints "Could not find ProcAddress for DLLRegisterServer". Tried with DLL names and full paths.
This post was edited on 07-26-2011 at 01:42 PM by whiz.
|
|
07-26-2011 01:41 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|