I'm talking to myself but I think this might help somebody in the future.
I finally got it to do most of what I want it to do but still need to do some fine tuning. I can get the callback to fire properly now by inserting the calls to ProcessSystemEvents() as noted above. The other thing that was tripping me up was how CmtReadTSQData() works. It will only return when it gets the exact number of items you tell it to. The problem I was having is that I don't know how many items that will be each time I put something in the queue.
What I did to fix this is simple. In my call to CmtInstallTSQCallback(), I set the threshold at 1 item. When I write a string to the queue, the callback fires. Now it appeared that the callback hung up at that point until the queue was full. The problem was that CmtReadTSQData() was blocking until it got as many items as I had asked for (the full queue size).
Fortunately, I could force the queue to retrieve only what was actually in the queue by getting the number of items using CmtGetTSQAttribute() and passing that value to CmtReadTSQData()
Problem solved except for the fact that sometimes there is more than one string in the queue. That's an easy problem, I can simply put a termination character at the end of each and string and break the data up accordingly.
So I'll quit before I ramble on into the sunset. Time to go have my weekend.
Martin Fredrickson
Test Engineer
Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128