Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
mabort
Novice


Joined: 08 Mar 2001
Posts: 44

PostPosted: Tue Oct 18, 2016 7:58 pm   

Support for COM events
 
Working on a sort-of plugin for CMUD. Basically a COM object that creates it own window and does parsing and stuff. However, shy of doing a polling implementation for commands to do in CMUD and/or send to the MUD, is there a way to hookup a custom CMUD event/function to a COM event?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 3672
Location: Pensacola, FL, USA

PostPosted: Wed Oct 19, 2016 3:08 am   
 
You can define your own #EVENT for CMUD to do something when it gets #RAISE-d.
Its just a matter of detection.
_________________
Windows 10 Home Premium 64-bit
AMD Phenom II x6 1055T 2.8GHz 16GB
CMUD Pro v3.34
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Oct 19, 2016 3:26 am   
 
I have not seen anything in the interfaces that makes a plugin aware of events. I believe that plugins never received much attention nor support during the zMud days. As a result, Zugg did not expand any support in CMud. This document https://www.zuggsoft.com/zmud/complug.htm seems most comprehensive on the subject.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
Tarn
GURU


Joined: 10 Oct 2000
Posts: 853
Location: USA

PostPosted: Wed Oct 19, 2016 6:40 am   
 
It sounds like you've got a COM exe, not just a DLL with blocking calls.

CMud does have its own COM API, so you could run it from the other end... get a handle and force a command or alias to run.

I've more commonly set up a timer that fires frequently to poll the DLL as to progress.
Reply with quote
mabort
Novice


Joined: 08 Mar 2001
Posts: 44

PostPosted: Wed Oct 19, 2016 10:51 pm   
 
I've built a COM dll (C# class library that is COM visible). Right now I'm using %comcreate("plugin") to create an instance of the object in proc and calling methods/properties on it. Since the CMUD COM objects aren't documented and I don't have a typelib I don't know how to use them properly. Do you have any pointers Tarn?
Reply with quote
mabort
Novice


Joined: 08 Mar 2001
Posts: 44

PostPosted: Wed Oct 19, 2016 11:22 pm   
 
Actually I think I've figured it out - can use %comcreate("cMUD.Application") to get a reference to the current instance of CMUD (this must be done within CMUD otherwise you just create a new instance of CMUD). Then I reference cmud.exe in the C# project and it creates an interop library from all of the COM type info embedded in the executable. I can then pass the CMUD COM object as a parameter to the plugin init method and voila - I have access to cMUD.Application.

After that is RE to figure out how to call the methods appropriately.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Oct 20, 2016 8:59 pm   
 
The COM objects have not changed since zMud with some minor exceptions. The documentation is here http://www.zuggsoft.com/page.php?file=zmud/comserve.htm

The exceptions are that portions of zMapper got rolled into the CMud, I think only in the pro version. zMapper's COM interface is documented in its help file.

From within CMud you can get at the COM objects using the Predefined Variables %cmud, %session, and %map.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
mabort
Novice


Joined: 08 Mar 2001
Posts: 44

PostPosted: Thu Oct 20, 2016 10:07 pm   
 
Thanks Vijilante!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net