WordPress database error: [INSERT, UPDATE command denied to user '51213-2'@'10.10.20.142' for table 'wp_options']INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('_transient_doing_cron', '1714445987.5260739326477050781250', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)
\ud83d\ude2e I am really writing a blog post on C++ ? Yest it seems so :). At this year MVP Summit I discovered how much fun I can have with C++ (and especially C++\/Cx in my case) thanks to Simon Ferquel<\/a> and Bruno Boucard<\/a>.<\/p>\n concurrency::task are available through the “ppltasks.h” header files and can be considered as the TPL tasks in C#.<\/strong> I often create components which needs initialization, and to do so I create tasks:<\/p>\n It’s not possible to expose a PPL concurrency::task as a WinRT IAsyncAction. To create and return an IAsyncAction, you have to use the concurrency::create_async function which internally create a task and wraps it.<\/strong> If the passed lambda returns a type, then the create_async will return a IAsyncOperation (isn’t it wonderful ?). Here is an example : But in my case, the task is already created. So the only solution I found to this issue is to create a lambda which returns my task and feed the create_async method with it.<\/strong> As the lambda returns a task, the create_async will create a IAsyncAction\/Operation which will wait for the completion of the init task too.<\/p>\n [cpp] Interesting links: <\/u><\/p>\n \ud83d\ude2e I am really writing a blog post on C++ ? Yest it seems so :). At this year MVP Summit I discovered how much fun I can have with C++ (and especially C++\/Cx in…<\/p>\n","protected":false},"author":3,"featured_media":1313,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[42,35],"tags":[43,14,15,25,24],"_links":{"self":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1302"}],"collection":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/comments?post=1302"}],"version-history":[{"count":16,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1302\/revisions"}],"predecessor-version":[{"id":1319,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/posts\/1302\/revisions\/1319"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/media\/1313"}],"wp:attachment":[{"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/media?parent=1302"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/categories?post=1302"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jonathanantoine.com\/wp-json\/wp\/v2\/tags?post=1302"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}
\nOne of the first thing I tried to do in a C++ component is to create a concurrency::task, use it and expose it as a IAsyncAction to the other C#\/JS component.
\n<\/p>\n\n
\n[cpp]
\nconcurrency::create_async([this](){ \/* my job to do in a task \/* });
\n[\/cpp]<\/p>\n
\nWindows::Foundation::IAsyncAction^ YoupiTralala::ForceInitAsync()
\n{
\n\tauto toReturn= concurrency::create_async([this](){ return this->initTask;});
\n\treturn toReturn;
\n}
\n[\/cpp]<\/p>\n\n
Do you know a better way to do this ?<\/h2>\n","protected":false},"excerpt":{"rendered":"