Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
68 user(s) are online (52 user(s) are browsing Forums)

Members: 0
Guests: 68

more...

Support us!

Headlines

 
  Register To Post  

Possible to send Commodity command messages?? (without using Exchange)
Home away from home
Home away from home


See User information
Does anyone know if it is possible for a program (other than Exchange) to send command messages (CXM_COMMAND) to a running commodity?

I can't see any specific functions in commodity.library to do this, but in theory I could send one directly to the commodity's own message port... except that I can't see any way to find out it's port (since it is typically private).

The lack of any Shell equivalent to Exchange (on Aminet/etc) seems to suggest this is not possible... but then how did someone manage to write a MUI replacement for Exchange on OS3? (Did they have to hack private OS structures?)


It seems stupid that I cannot control Commodities from the Shell. (Especially if they are ones that I wrote!)

Author of the PortablE programming language.
Go to top
Re: Possible to send Commodity command messages?? (without using Exchange)
Home away from home
Home away from home


See User information
I've just finished reading some Commodity docs, and can't see any indication that it is possible to do what I want
http://wiki.amigaos.net/index.php/Commodities_Exchange_Library

Author of the PortablE programming language.
Go to top
Re: Possible to send Commodity command messages?? (without using Exchange)
Home away from home
Home away from home


See User information
It seems that the OS documentation is rather out-of-date: It looks like (in about 2005 ?) there were some functions added to OS4's Commodities library that allow any other program to do what the Exchange program does.

CLIExchange has an example of this, but it is one of the most cryptic C programs I've read (seemingly in an attempt to reduce the file size by a few bytes).

The new functions (well methods) are these:
Quote:
LONG CopyBrokerList(struct List * blist);
VOID FreeBrokerList(struct List * list);
LONG BrokerCommand(STRPTR name, LONG id);


But in fact the only one I needed is BrokerCommand(), to which you supply the commodity's name, and one of the following command (IDs) : CXCMD_DISABLE, CXCMD_ENABLE, CXCMD_APPEAR, CXCMD_DISAPPEAR, CXCMD_KILL, CXCMD_UNIQUE . BTW, it actually returns 0 for success, and -1 for failure, depending on whether or not the named commodity exists.

Pretty easy. And those 3 functions are now added to the next beta release of PortablE...

Author of the PortablE programming language.
Go to top
Re: Possible to send Commodity command messages?? (without using Exchange)
Quite a regular
Quite a regular


See User information
I've had to do something similar in one of my project (Wacom USB driver). In fact I used the functions you are referring to. This is not really mandatory if you only want to show the gui and you know the commodity id (just try to register the same commodity name and the previous commodity should show up). Else (you need to send more than just show, or you don't know the commodity id) you have no other choice than going that route and use these 3 functions.

Note that application.library can answer your need on that point. If you are not really writing a commodity (i.e. not tweaking with the user input) I would recommand switching to application.library.

Back to a quiet home... At last
Go to top
Re: Possible to send Commodity command messages?? (without using Exchange)
Amigans Defender
Amigans Defender


See User information
@ChrisH

To add to what abalaban has said: the much-needed Application Library documentation is slowly taking shape. At least the messaging section - which is of relevance for you - is almost finished:

here is the link

The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project