View Single Post
Old 31st January 2005, 16:19   #200
Crestronite
Junior Member
 
Join Date: Jan 2005
Posts: 6
Quote:
Originally posted by shaneh
I dont feel like installing VB6 on my machine, but AFAIK its not much different from vbscript at least in syntax.

To do that in vbscript, you would do something like:

mi = loaditem "C:\test.mp3"
mi.enqueue
oldpos = playlist.position
playlist.position = playlist.count
play
playlist.position = oldpos
playlist.deleteindex playlist.count

In VB6 I have a global declaration
Dim WithEvents aWinAMP as ActiveWinamp.Application

In my Form Load() I have
Set aWinAMP=CreateObject("WINAMPCOM.APPLICATION")

Most things seem to work ok including the event callback

In a different subroutine I have
Dim mi as MediaItem
mi=aWinAMP.LoadItem("C:\temp.mp3")
mi.enqueue

... etc

but the loaditem assignment errors with invalid use of property - - although it looks as though the right hand side indicates it returns a MediaItem , I think it actually returns a string. I guess I'm being really stupid here ?

mi= aWinAMP.Loaditem "C:\temp.mp3" is not a valid syntax

msgbox aWinAMP.LoadItem("C:\temp.mp3") gives a "C:\temp.mp3" message and the filename is not checked in anyway as existing as it works for anything.

Chris

EDIT: AHHH - and the light went on... ;-)

Set mi=aWinAMP.LoadItem("C:\temp.mp3")

DUH ! Chris
Crestronite is offline   Reply With Quote