Click here to Skip to main content
15,918,889 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ERROR_INVALID_HANDLE returned From WaitForSingleObject after CreateMutex Pin
leon de boer10-Nov-16 8:38
leon de boer10-Nov-16 8:38 
GeneralRe: ERROR_INVALID_HANDLE returned From WaitForSingleObject after CreateMutex Pin
ForNow10-Nov-16 8:53
ForNow10-Nov-16 8:53 
QuestionDebug Assertion Failed error by WaitForMultipleObjectsEx in 64 bit application Pin
Member 123356959-Nov-16 20:27
Member 123356959-Nov-16 20:27 
AnswerRe: Debug Assertion Failed error by WaitForMultipleObjectsEx in 64 bit application Pin
Richard MacCutchan9-Nov-16 22:54
mveRichard MacCutchan9-Nov-16 22:54 
AnswerRe: Debug Assertion Failed error by WaitForMultipleObjectsEx in 64 bit application Pin
Randor 10-Nov-16 2:00
professional Randor 10-Nov-16 2:00 
GeneralRe: Debug Assertion Failed error by WaitForMultipleObjectsEx in 64 bit application Pin
Member 1233569510-Nov-16 22:44
Member 1233569510-Nov-16 22:44 
GeneralRe: Debug Assertion Failed error by WaitForMultipleObjectsEx in 64 bit application Pin
Member 1233569510-Nov-16 22:51
Member 1233569510-Nov-16 22:51 
AnswerRe: Debug Assertion Failed error by WaitForMultipleObjectsEx in 64 bit application Pin
Randor 11-Nov-16 4:06
professional Randor 11-Nov-16 4:06 
AnswerRe: Debug Assertion Failed error by WaitForMultipleObjectsEx in 64 bit application Pin
Albert Holguin10-Nov-16 7:36
professionalAlbert Holguin10-Nov-16 7:36 
QuestionHow to design pure C style APIs for a framework which include a core exe and plugin dlls Pin
bestbear9-Nov-16 19:59
bestbear9-Nov-16 19:59 
AnswerRe: How to design pure C style APIs for a framework which include a core exe and plugin dlls Pin
Richard MacCutchan9-Nov-16 22:52
mveRichard MacCutchan9-Nov-16 22:52 
AnswerRe: How to design pure C style APIs for a framework which include a core exe and plugin dlls Pin
leon de boer10-Nov-16 9:06
leon de boer10-Nov-16 9:06 
GeneralRe: How to design pure C style APIs for a framework which include a core exe and plugin dlls Pin
bestbear10-Nov-16 18:11
bestbear10-Nov-16 18:11 
QuestionC programming Determine Students grade Pin
Member 128422149-Nov-16 12:37
Member 128422149-Nov-16 12:37 
AnswerRe: C programming Determine Students grade Pin
leon de boer9-Nov-16 14:27
leon de boer9-Nov-16 14:27 
QuestionHow explicit , volatile and mutable keywords works INTERNALLY in C++ ? Pin
Amrit Agr6-Nov-16 22:06
Amrit Agr6-Nov-16 22:06 
AnswerRe: How explicit , volatile and mutable keywords works INTERNALLY in C++ ? Pin
Richard MacCutchan7-Nov-16 0:18
mveRichard MacCutchan7-Nov-16 0:18 
AnswerRe: How explicit , volatile and mutable keywords works INTERNALLY in C++ ? Pin
leon de boer7-Nov-16 8:15
leon de boer7-Nov-16 8:15 
GeneralPlease help Pin
Ahmed Adel5-Nov-16 3:20
Ahmed Adel5-Nov-16 3:20 
GeneralRe: Please help Pin
Richard MacCutchan5-Nov-16 21:01
mveRichard MacCutchan5-Nov-16 21:01 
GeneralRe: Please help Pin
leon de boer6-Nov-16 4:49
leon de boer6-Nov-16 4:49 
PraiseRe: Please help Pin
Ahmed Adel6-Nov-16 5:10
Ahmed Adel6-Nov-16 5:10 
QuestionPattern review C++: using structs with pure virtual methods in place of interfaces Pin
Member 128328324-Nov-16 5:58
Member 128328324-Nov-16 5:58 
AnswerRe: Pattern review C++: using structs with pure virtual methods in place of interfaces Pin
Chris Losinger4-Nov-16 8:23
professionalChris Losinger4-Nov-16 8:23 
AnswerRe: Pattern review C++: using structs with pure virtual methods in place of interfaces Pin
leon de boer4-Nov-16 8:48
leon de boer4-Nov-16 8:48 
I tend to do exactly the same mainly because if I need I can transfer my C++ code easily to pure C, C# and into VHDL if working with FPGA's. Some will find our coding quirky because they have not come from that interface background but at the end of the day your code is tight and usually more portable to other languages when you need. Personally I think it's a good trait but those who only write in C++ will argue we aren't using the language to it's full ability.

Do you go the whole hog Smile | :)

I import multiple interfaces into things I never do C++ multiple inheritance at all. I also run my own form of delegates, mine is closer to C# that the standard C++ setup.

The final thing I do is probably very quirky to my embedded background, in that all my interfaces have an abstract event drive message function call set on them. Generally it will be unimplemented but the number of times it has saved my butt when I need complicated exchanges across the interfaces to synchronize them or often I use it for live debugging. Saves hours of time if you can connect to a locked program and actually look at the interface states. To do that you simply setup the event drive message pump in it's own thread and so you can actually push messages to get the interface states even though the program thread may be deadlocked.

The only downside is in team developments some will struggle to understand your code because it isn't the purest standard C++ form. On the couple of times I ever had that happen I just hide the interfaces inside a wrapper class, sort of where your sample is going. I normally don't hide the interfaces they just sit as exposed public on a class because they are an designed as a proper interface after all.

So like Chris said I am a PIMPL guy as well Smile | :)
In vino veritas


modified 4-Nov-16 14:57pm.

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.