INTERACT FORUM
Windows => Plug-in Development => Topic started by: Robert S on July 13, 2004, 05:15:22 am
-
I'm making a screensaver which should be a out-of-proc application and it's supposed to display the current song with big letters, and I therefore must use GetOject and not createObject.
The following code generates error 429 even though Media Center is started and I've got the reference set in vb:
Set MediaCenterApplication = GetObject(, "MediaJukebox Application")
But if I do like this:
Set MediaCenterApplication = GetObject("", "MediaJukebox Application")
then it works when I run the application.
But after stopping it after this, I have to remove the "" to get it to run again. After this It runs great until I've restarted Media Center, then I have to do it all over again.
I've done all obvious checks like that the tlb is not corrupt and I've only got one tlb on my system and I've also run it on VBRegTLB6.exe to make sure that it's properly registered. I've also now tested my app on media center 10 with the same result...
Apart from this, the screensaver works great.... ?
Why is this? What could it be caused by?
/Robert
-
I've almost cleaned out everything in the code now to find any errors and now the code looks like this (it still generates the error 429)
Option Explicit
Private MediaCenterApplication As MediaJukebox.MJAutomation
Private playNow As MediaJukebox.MJCurPlaylistAutomation
Private Sub Form_Load()
On Error Resume Next
Set MediaCenterApplication = GetObject(, "MediaJukebox Application")
If Err.Number = 429 Then
Me.Caption = "Error 429"
Else
Set playNow = MediaCenterApplication.GetCurPlaylist
Me.Caption = playNow.GetFile(playNow.Position).Artist
End If
End Sub
Can someone please guide me to what could be wrong?
Has anyone else done a out-of-proc application that works?
/Robert
-
Hi
I am new here, but know why you are getting the error.
If the application isn't running, it cannot get a reference to something that does't exist.
Basically, use this:
Set MediaCenterApplication = GetObject(, "MediaJukebox Application")
If Err.Number = 429 Then
'Then, create a new object
Set MediaCenterApplication = CreateObject("MediaJukebox Application")
End If
-
But I get this error even though Media Center IS Running. I understand that I get it when MC is NOT running, then I would have to use Create, but I want to get information about the currently playing song in the media center process that was already running when I started my program.
/Robert