Hi, my messages are defined something like this:
struct MY_MSG{
int ID;
char description[256];
float value;
}
I'm trying to pass a variable of type MY_MSG as the message. I've been studing the C++ API and the sample codes and I haven't found yet a way to pass a struct as the message.
How can I do that?
I think another way to realize that is to subclass the ImqItem, but I have no idea how to do that. If so, could we send me an example?
Joined: 22 May 2001 Posts: 1072 Location: Fort Worth, TX, USA
It would look like you use the write() method of the ImbMessage object passing in the pointer to the start of the storage for the structure in memory plus its size in bytes. This will create a message containing a copy of the structure which can then be put to the queue.
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