Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Mushclient and COM objects..
|
Mushclient and COM objects..
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
| Posted by
| Buckleyp
(3 posts) Bio
|
| Date
| Mon 12 Apr 2004 09:49 PM (UTC) |
| Message
| Is there any way of creating an COM object in Mush. I am trying to get it to link to WinAMP and just report back on the current song playing.
Many thanks for anyones time.
Buckleyp | | Top |
|
| Posted by
| Nick Gammon
Australia (23,173 posts) Bio
Forum Administrator |
| Date
| Reply #1 on Tue 13 Apr 2004 01:15 AM (UTC) |
| Message
| | Search this forum for "createobject" - there are quite a few examples of doing that. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | | Top |
|
| Posted by
| Shadowfyr
USA (1,792 posts) Bio
|
| Date
| Reply #2 on Tue 13 Apr 2004 02:46 AM (UTC) |
| Message
| I assume you are using this:
http://www.adcock8.freeserve.co.uk/winamp.htm
As far as I know, even though WinAmp supports COM, it provides no *direct* method of commanding WinAmp or requesting information.
Basically, as Nick said, you can use createobject to create an instance of the above plugin like:
Dim oWinCom as object
set oWinCom = CreateObject("WinampCOM.Application")
oWinCom.Play
All the features supported through the plugin are accessable that way. To get the song name for instance:
Song = oWinCom.CurrentSongTitle
Now.. An important thing to note:
There is a SongChange 'event'. The problem is that, except for Python, which has its own rules, most scripts, including ActivePerl cannot use events from anything not either:
a) provided by the program using it - like the world.<command> functions in Mushclient.
b) specialized 'web based' COM objects that impliment some sort of additional linking method. I have no idea how this works or even if it will actually let you use createobject call with them.
As a result.. If you want to capture an event, you have to design the object itself and use Mushclient commands like CallPlugin, or the trick someone came up with that uses aliases and World.Execute to 'fake' calling an event. Existing COM objects can't have their events trapped, this unfortunately includes the WinAmp one.
The 'trick' you can use is to have an alias like:
<alias>
Match="Event::* *"
Sendto="12"
enabled="y"
<send>call %1 %2<send>
</alias>
So your own COM object would include a call to fake the event with something like:
world.execute "Event::SongChange " & oWinCom.CurrentSongName
However, this would require creating a new version of gen_com.dll that can use the Mushclient function. But it is at least possible using this trick.
| | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
12,771 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top