Click here to Skip to main content
15,887,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Change Tabs in Ribbon Control dynamically - C++ Pin
Gopi Nath18-Jun-18 1:42
Gopi Nath18-Jun-18 1:42 
GeneralRe: Change Tabs in Ribbon Control dynamically - C++ Pin
Richard Andrew x6420-Jun-18 14:23
professionalRichard Andrew x6420-Jun-18 14:23 
AnswerRe: Change Tabs in Ribbon Control dynamically - C++ Pin
User 742933820-Jun-18 19:40
professionalUser 742933820-Jun-18 19:40 
GeneralRe: Change Tabs in Ribbon Control dynamically - C++ Pin
Gopi Nath20-Jun-18 20:22
Gopi Nath20-Jun-18 20:22 
GeneralRe: Change Tabs in Ribbon Control dynamically - C++ Pin
Gopi Nath20-Jun-18 20:19
Gopi Nath20-Jun-18 20:19 
Questioncreate_task with asynchronous unwrapping PPL Pin
Daniel Ramnath12-Jun-18 8:58
Daniel Ramnath12-Jun-18 8:58 
GeneralRe: create_task with asynchronous unwrapping PPL Pin
Richard MacCutchan12-Jun-18 9:03
mveRichard MacCutchan12-Jun-18 9:03 
Questioncreate_task function in PPL Pin
Daniel Ramnath11-Jun-18 7:29
Daniel Ramnath11-Jun-18 7:29 
why is the code giving error while compiling?

task<wstring> my_task()
{
    auto s = make_shared<wstring>(L"First value");
    return create_task([s] {
        wcout << *s << endl;
        *s = L"Second value";
        return *s; // It fails because of this.
    }).then([s] {
        wcout << *s << endl;
        *s = L"Third value";
        return *s;
    });
}


UPDATED
The error is as follows,
Quote:
1>c:\program files (x86)\microsoft visual studio 14.0\vc\include\ppltasks.h(372): error C2338: incorrect parameter type for the callable object in 'then'; consider _ExpectedParameterType or task<_ExpectedParameterType> (see below)
1> c:\program files (x86)\microsoft visual studio 14.0\vc\include\ppltasks.h(402): note: see reference to class template instantiation 'Concurrency::details::_FunctionTypeTraits<_Function,_ReturnType>' being compiled
1> with
1> [
1> _Function=my_task::<lambda_fe524192daf67b16ea75ab49971b7103>,
1> _ReturnType=std::wstring
1> ]
1> c:\vc++\concurrency_program\createtask\source.cpp(41): note: see reference to class template instantiation 'Concurrency::details::_ContinuationTypeTraits<my_task::<lambda_fe524192daf67b16ea75ab49971b7103>,_ReturnType>' being compiled
1> with
1> [
1> _ReturnType=std::wstring
1> ]
1>c:\vc++\concurrency_program\createtask\source.cpp(41): error C2440: 'return': cannot convert from 'Concurrency::task<concurrency::details::_badcontinuationparamtype>' to 'Concurrency::task<std::wstring>'
1> c:\vc++\concurrency_program\createtask\source.cpp(41): note: Constructor for class 'Concurrency::task<std::wstring>' is declared 'explicit'


I am just trying to understand ppl programing structure. Where as the following code compiles.

task<wstring> t1 = create_task([]() {
    wprintf(L"create_task\n");
    return wstring(L"create_task"); // It doesn't throw any error
});

Jesus saves


modified 12-Jun-18 2:50am.

QuestionRe: create_task function in PPL Pin
David Crow11-Jun-18 9:54
David Crow11-Jun-18 9:54 
AnswerRe: create_task function in PPL Pin
Daniel Ramnath11-Jun-18 20:36
Daniel Ramnath11-Jun-18 20:36 
AnswerRe: create_task function in PPL Pin
Daniel Ramnath11-Jun-18 20:30
Daniel Ramnath11-Jun-18 20:30 
QuestionDynamic programming fill 3D array Pin
pro grimi10-Jun-18 23:12
pro grimi10-Jun-18 23:12 
QuestionInitInstance() implimentation. Pin
Member 1271142610-Jun-18 20:17
Member 1271142610-Jun-18 20:17 
AnswerRe: InitInstance() implimentation. Pin
Jochen Arndt10-Jun-18 21:24
professionalJochen Arndt10-Jun-18 21:24 
QuestionAdvice on designing a simple task scheduler in embedded C, that can handle asynchronuous tasks? Pin
arnold_w9-Jun-18 10:37
arnold_w9-Jun-18 10:37 
AnswerRe: Advice on designing a simple task scheduler in embedded C, that can handle asynchronuous tasks? Pin
leon de boer10-Jun-18 17:27
leon de boer10-Jun-18 17:27 
GeneralRe: Advice on designing a simple task scheduler in embedded C, that can handle asynchronuous tasks? Pin
arnold_w10-Jun-18 20:16
arnold_w10-Jun-18 20:16 
GeneralRe: Advice on designing a simple task scheduler in embedded C, that can handle asynchronuous tasks? Pin
leon de boer11-Jun-18 2:52
leon de boer11-Jun-18 2:52 
GeneralRe: Advice on designing a simple task scheduler in embedded C, that can handle asynchronuous tasks? Pin
arnold_w11-Jun-18 3:13
arnold_w11-Jun-18 3:13 
GeneralRe: Advice on designing a simple task scheduler in embedded C, that can handle asynchronuous tasks? Pin
leon de boer11-Jun-18 4:04
leon de boer11-Jun-18 4:04 
GeneralRe: Advice on designing a simple task scheduler in embedded C, that can handle asynchronuous tasks? Pin
arnold_w11-Jun-18 9:38
arnold_w11-Jun-18 9:38 
AnswerRe: Advice on designing a simple task scheduler in embedded C, that can handle asynchronuous tasks? Pin
supercat920-Jun-18 12:22
supercat920-Jun-18 12:22 
QuestionC# combo box text color change Pin
czaar9998-Jun-18 7:18
czaar9998-Jun-18 7:18 
AnswerRe: C# combo box text color change Pin
Richard Andrew x648-Jun-18 10:54
professionalRichard Andrew x648-Jun-18 10:54 
Questionusing dynamic_cast with template classes. Pin
Tarun Jha5-Jun-18 1:48
Tarun Jha5-Jun-18 1:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.