[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Mushclient and COM objects..

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Mushclient and COM objects..

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Buckleyp   (3 posts)  [Biography] bio
Date Mon 12 Apr 2004 09:49 PM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,800 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Tue 13 Apr 2004 01:15 AM (UTC)  quote  ]
Message
Search this forum for "createobject" - there are quite a few examples of doing that.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Shadowfyr   USA  (1,774 posts)  [Biography] bio
Date Reply #2 on Tue 13 Apr 2004 02:46 AM (UTC)  quote  ]
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.

main {
__if (Schrodinger_Cat is Alive or version >= "XP"){
____if version = "Vista" then Performance /= Number_of_Cores;
____call Functional_Code();}
__else
____call Crash_Windows();}
[Go to top] 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.


1,366 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]