May 23, 2015 at 6:56 PM
I've published a very introductory article about using C++ REST SDK in an MFC application.
Please feel free to comment, criticize and advise in order to find out what must be done in further articles with the same theme.
May 26, 2015 at 4:46 PM
Hi ovidiucucu,

Thanks for putting together an example using MFC and the C++ REST SDK. Here are a couple of comments that came to mind as I was reading through:
  1. I'd prefer if you didn't advertise or encourage users to use the version of the C++ REST SDK that comes with Visual Studio 2013. It is a old version that we are not updating anymore. The ideal way we want developers consuming the library is either through the NuGet package or building from source from CodePlex.
  2. In OnClickButtonVerifyJson at lines 8 and 9 you do a task.wait() followed immediately by a task.get(). There is no need to call task.wait() since you was the result of the task. You can just delete line 8. Also I assume you are aware that calling task.wait()/task.get() is blocking waiting on the network I/O to be completed. This could be OK depending on your application and requirements.
  3. In VerifyJsonTask there is no need for you to create an extra PPL task with pplx::create_task. The http_client::request function is asynchronous, creating this extra task is just incurring additional unnecessary overhead.
Let me know if you have any questions and thanks again for the post!
Jun 2, 2015 at 10:48 AM
Edited Jun 2, 2015 at 10:55 AM
Hi stevetgates,

Thank you for the valuable feedback!
I will do, as soon as possible, an update according to your remarks. That will include a note about better using of latest versions.

Best regards,