Click here to Skip to main content
14,973,838 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionplease help me with this problem Pin
Member 1254719729-Jul-16 6:16
MemberMember 1254719729-Jul-16 6:16 
AnswerRe: please help me with this problem Pin
leon de boer29-Jul-16 17:32
Memberleon de boer29-Jul-16 17:32 
QuestionRecursive directory search Pin
Anthony Appleyard29-Jul-16 4:44
MemberAnthony Appleyard29-Jul-16 4:44 
QuestionRe: Recursive directory search Pin
Richard MacCutchan29-Jul-16 5:02
mveRichard MacCutchan29-Jul-16 5:02 
AnswerRe: Recursive directory search Pin
Anthony Appleyard29-Jul-16 10:57
MemberAnthony Appleyard29-Jul-16 10:57 
GeneralRe: Recursive directory search Pin
Richard MacCutchan29-Jul-16 22:23
mveRichard MacCutchan29-Jul-16 22:23 
AnswerRe: Recursive directory search Pin
David Crow1-Aug-16 5:01
MemberDavid Crow1-Aug-16 5:01 
Questionvariadic templates problem Pin
FriendOfAsherah28-Jul-16 23:49
MemberFriendOfAsherah28-Jul-16 23:49 
Im using this for the first time for mapping a function "f" with variable count of parameters

declarition:
template <class...A> void AllItemsO(void (*f)(A...), A... args)
 {
    // for (auto _F : *this)
    //    if ((_F)) ((_F)->*f)(args);
 }


call in cpp:
AllItemsO<IapVisibilityInfo*, IPickCookie*, MakeSubObjSpecial, AVHC(Object)&>(&IcompDWO3D::SetObjMat, visInfo, pci, doit, obj);


function to call is:
IcompDWO3D::SetObjMat
parameters:
visInfo, pci, doit, obj

compiler always shows up an error C2784

Fehler 1 error C2784: "void CapDWOICollection::AllItemsO(void (__cdecl *)(A...),A...)": template-Argument für "void (__cdecl *)(IapVisibilityInfo *,IPickCookie *,aprivis::MakeSubObjSpecial,aprivis::avhObjectWrapper &,A...)" konnte nicht von "void (__thiscall component::IcompDWO3D::* )(IapVisibilityInfo *,IPickCookie *,aprivis::MakeSubObjSpecial,aprivis::avhObjectWrapper &)" hergeleitet werden.

looking at what I have shown bold, it seems that it cannot spread the functionparameters form the A... variadic to single paarameters?
A non variadic verison with 2 Parameters looks like this and works:
template <class T1, class T2> void AllItemsO2(void (*f)(T1, T2), T1 p1, T2 p2) 
{ for (auto _F : *this) if (_F) ((_F)->*f)(p1, p2); }


any help for my syntax?
QuestionTrying to understand my mistake... with pointers Pin
Blubbo28-Jul-16 8:04
MemberBlubbo28-Jul-16 8:04 
AnswerRe: Trying to understand my mistake... with pointers Pin
jeron128-Jul-16 9:30
Memberjeron128-Jul-16 9:30 
AnswerRe: Trying to understand my mistake... with pointers Pin
leon de boer29-Jul-16 17:53
Memberleon de boer29-Jul-16 17:53 
Questionhow to create a file input button in microsoft visual c ++ ? Pin
jhonganteng28-Jul-16 3:46
Memberjhonganteng28-Jul-16 3:46 
AnswerRe: how to create a file input button in microsoft visual c ++ ? Pin
Richard MacCutchan28-Jul-16 4:30
mveRichard MacCutchan28-Jul-16 4:30 
QuestionHelp With Exception Pin
ForNow26-Jul-16 12:47
MemberForNow26-Jul-16 12:47 
AnswerRe: Help With Exception Pin
leon de boer26-Jul-16 17:22
Memberleon de boer26-Jul-16 17:22 
GeneralRe: Help With Exception Pin
ForNow26-Jul-16 20:01
MemberForNow26-Jul-16 20:01 
GeneralRe: Help With Exception Pin
leon de boer26-Jul-16 22:33
Memberleon de boer26-Jul-16 22:33 
AnswerRe: Help With Exception Pin
Jochen Arndt26-Jul-16 21:47
professionalJochen Arndt26-Jul-16 21:47 
GeneralRe: Help With Exception Pin
ForNow27-Jul-16 2:14
MemberForNow27-Jul-16 2:14 
GeneralRe: Help With Exception Pin
Jochen Arndt27-Jul-16 2:18
professionalJochen Arndt27-Jul-16 2:18 
GeneralRe: Help With Exception you where right !!!!!!!! Pin
ForNow27-Jul-16 15:15
MemberForNow27-Jul-16 15:15 
QuestionChoosing between strings Pin
Anthony Appleyard26-Jul-16 9:47
MemberAnthony Appleyard26-Jul-16 9:47 
AnswerRe: Choosing between strings Pin
Richard MacCutchan26-Jul-16 21:11
mveRichard MacCutchan26-Jul-16 21:11 
QuestionNewbee Exception handling Guidance Pin
ForNow25-Jul-16 4:35
MemberForNow25-Jul-16 4:35 
AnswerRe: Newbee Exception handling Guidance Pin
Jochen Arndt25-Jul-16 4:57
professionalJochen Arndt25-Jul-16 4:57 

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.