Can anyone point me to a really good tutorial or example of using casablanca with MFC? I just have soo many questions on how to send a request using the pplx tasks. Sometimes it's best just to see a working example. The casablanca samples all appear to use the task_continuation_contex which would be lovely to use, but appears to only work for Windows store apps, or so the documentation suggests? I have read all the suggested readings, online blog ppl experts and lots of stackoverflow questions but nothing seems to give me a clear answer on how to really use MFC and Casablanca together.
1) is there any way to join the main thread when the response is recieved for an MFC gui.
2) There are some blogs that suggest that you can provide a std::function callback to the pplx task to call when it is complete but I can't see how this would work unless the task is continued on the main thread?
3) There is some talk about marshalling data to the main thread, so I could provide the json response to the main thread for consumption this way but again an example of this would be very helpful.
4) If I do need to marshall data to the main thread and have the main thread periodically check for new data, has anyone used Boost interprocess for this? I am using it for other areas of the code and I thought perhaps this would make my life simplier if I can just reuse the same libraries for shared memory. Other suggestions would be welcome?!
In the end what I want to do is have some MFC GUIs remain responsive when a request is sent. The requests may take a little time for the response so blocking the main thread until a response is returned is not acceptable. Preferably when the response returns I would like to rejoin the main thread and call a callback to process the response (I don't use the word process here lightly as it may be a much more complex algorithm then simply post a string in a text box in the gui). With that said I will do whatever works with MFC and is the simpliest code to maintain and debug.
I am by no means a REST expert, I am very new to casablanca so any help would be greatly appreciated,
Robyn
1) is there any way to join the main thread when the response is recieved for an MFC gui.
2) There are some blogs that suggest that you can provide a std::function callback to the pplx task to call when it is complete but I can't see how this would work unless the task is continued on the main thread?
3) There is some talk about marshalling data to the main thread, so I could provide the json response to the main thread for consumption this way but again an example of this would be very helpful.
4) If I do need to marshall data to the main thread and have the main thread periodically check for new data, has anyone used Boost interprocess for this? I am using it for other areas of the code and I thought perhaps this would make my life simplier if I can just reuse the same libraries for shared memory. Other suggestions would be welcome?!
In the end what I want to do is have some MFC GUIs remain responsive when a request is sent. The requests may take a little time for the response so blocking the main thread until a response is returned is not acceptable. Preferably when the response returns I would like to rejoin the main thread and call a callback to process the response (I don't use the word process here lightly as it may be a much more complex algorithm then simply post a string in a text box in the gui). With that said I will do whatever works with MFC and is the simpliest code to maintain and debug.
I am by no means a REST expert, I am very new to casablanca so any help would be greatly appreciated,
Robyn