Click here to Skip to main content
15,946,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using the MsgQueue to communicate between C# and c++ application. Want to know, for long run will this MsgQueue will be killed/die/cleared. I mean any life time for this MsgQueue. If yes how to check MsgQueue is alive or not. Please help me on this, Thank you.

What I have tried:

I have imported
coredll.dll
with that read and write queue passing message between C# and c++ application running individually. Is this MesgQueue will die/killed after some time. Any life time is there for these MesgQueue. Any way to check that MesgQueue is alive or not. Please help on this.
Posted
Updated 14-Dec-17 2:27am

1 solution

I would expect that they exist until CloseMsgQueue() is called for all handles returned by CreateMsgQueue() using the same name.

Then there is no need to check if a queue is alive because it is under control of the application. The application can simply clear the handle variable after closing the queue to indicate that the queue does not exist anymore.

It is more important to close message queues when no longer used because they are system resources which are limited. That means: When not closed, they will exist until rebooting the system.
 
Share this answer
 
Comments
ssyuvaraja 9-Jan-18 3:21am    
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900