Click here to Skip to main content
14,692,225 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Radio Buttons, Lots of them Pin
David Crow8-Sep-15 10:13
MemberDavid Crow8-Sep-15 10:13 
GeneralRe: Radio Buttons, Lots of them Pin
golfbird8-Sep-15 10:33
Membergolfbird8-Sep-15 10:33 
QuestionCreate CBitmap from another CBitmap Pin
_Flaviu3-Sep-15 2:49
Member_Flaviu3-Sep-15 2:49 
AnswerRe: Create CBitmap from another CBitmap Pin
Jochen Arndt3-Sep-15 3:23
professionalJochen Arndt3-Sep-15 3:23 
GeneralRe: Create CBitmap from another CBitmap Pin
_Flaviu3-Sep-15 23:29
Member_Flaviu3-Sep-15 23:29 
QuestionWriting a Generic Function Pin
Donguy19762-Sep-15 13:17
MemberDonguy19762-Sep-15 13:17 
AnswerRe: Writing a Generic Function Pin
Richard MacCutchan2-Sep-15 22:06
mveRichard MacCutchan2-Sep-15 22:06 
Questionproblems with std::bind in VS2015 Pin
Member 85340352-Sep-15 6:11
MemberMember 85340352-Sep-15 6:11 
Hi all,

I have a weird problem with stl !

I need to work with callback functions between different classes. With VS2010 I have done this already different times without any problem.

With VS2015 I cannot compile such code!

Example:

in Header in Class Declaration:
    #include <functional>
...
	bool ProvideItemData(int nItem, int nSubItem);

in .cpp:

	{
		//using namespace std::placeholders; // for `_1`
		m_ListCtrl.SetOwnerData(std::bind(&CBlockEditView::ProvideItemData, this, std::placeholders::_1));
	}

declaration in called class:

bool SetOwnerData(std::function <bool(int nItem,int nSubItem)> callback);


When compiling in VS2010, I get weird error messages:

c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1501): error C2440: 'return': cannot convert from 'std::_Unforced' to 'bool'
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\type_traits(1501): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(210): note: see reference to function template instantiation '_Rx std::_Invoke_ret<_Rx,_Callable&,_Ty,_Ty>(std::_Forced<_Rx,false>,_Callable &,_Ty &&,_Ty &&)' being compiled
1>          with
1>          [
1>              _Rx=bool,
1>              _Callable=_Decayed,
1>              _Ty=int
1>          ]
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(208): note: while compiling class template member function 'bool std::_Func_impl<_Decayed,_Alloc,_Ret,int,int>::_Do_call(int &&,int &&)'
1>          with
1>          [
1>              _Alloc=std::allocator<int>,
1>              _Ret=bool
1>          ]
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(136): note: see reference to class template instantiation 'std::_Func_impl<_Decayed,_Alloc,_Ret,int,int>' being compiled
1>          with
1>          [
1>              _Alloc=std::allocator<int>,
1>              _Ret=bool
1>          ]
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(339): note: see reference to class template instantiation 'std::_Is_large<_Myimpl>' being compiled
1>  c:\program files (x86)\microsoft visual studio 14.0\vc\include\functional(318): note: see reference to function template instantiation 'void std::_Func_class<_Ret,int,int>::_Reset_alloc<_Ty,std::allocator<int>>(_Fx &&,const _Alloc &)' being compiled
1>          with


I do not find any solution. So at the moment I do not have any idea, how to solve this issue!
Please help!
QuestionCFileDialog strange GetFileName Pin
_Flaviu2-Sep-15 0:18
Member_Flaviu2-Sep-15 0:18 
AnswerRe: CFileDialog strange GetFileName Pin
Jochen Arndt2-Sep-15 1:10
professionalJochen Arndt2-Sep-15 1:10 
GeneralRe: CFileDialog strange GetFileName Pin
_Flaviu2-Sep-15 1:58
Member_Flaviu2-Sep-15 1:58 
QuestionSet focus automatically to the last focus item after clossinga modal dialog Pin
aks.1-Sep-15 23:02
Memberaks.1-Sep-15 23:02 
QuestionRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan2-Sep-15 3:55
mveRichard MacCutchan2-Sep-15 3:55 
AnswerRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.3-Sep-15 3:36
Memberaks.3-Sep-15 3:36 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan3-Sep-15 4:42
mveRichard MacCutchan3-Sep-15 4:42 
QuestionRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
David Crow3-Sep-15 5:54
MemberDavid Crow3-Sep-15 5:54 
AnswerRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.7-Sep-15 5:07
Memberaks.7-Sep-15 5:07 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan7-Sep-15 7:50
mveRichard MacCutchan7-Sep-15 7:50 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.8-Sep-15 23:23
Memberaks.8-Sep-15 23:23 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan8-Sep-15 23:27
mveRichard MacCutchan8-Sep-15 23:27 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.9-Sep-15 8:16
Memberaks.9-Sep-15 8:16 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
Richard MacCutchan9-Sep-15 8:49
mveRichard MacCutchan9-Sep-15 8:49 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
David Crow9-Sep-15 10:33
MemberDavid Crow9-Sep-15 10:33 
GeneralRe: Set focus automatically to the last focus item after clossinga modal dialog Pin
aks.9-Sep-15 20:37
Memberaks.9-Sep-15 20:37 
Questioni need ocr code in c++ Pin
Member 119511281-Sep-15 7:20
MemberMember 119511281-Sep-15 7:20 

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.