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

C / C++ / MFC

 
GeneralRe: Classes in C Pin
pix_programmer17-Aug-11 1:04
pix_programmer17-Aug-11 1:04 
GeneralRe: Classes in C Pin
Orjan Westin17-Aug-11 2:08
professionalOrjan Westin17-Aug-11 2:08 
GeneralRe: Classes in C Pin
Maximilien17-Aug-11 3:11
Maximilien17-Aug-11 3:11 
GeneralRe: Classes in C Pin
David Crow17-Aug-11 4:29
David Crow17-Aug-11 4:29 
GeneralRe: Classes in C Pin
CPallini17-Aug-11 7:01
mveCPallini17-Aug-11 7:01 
GeneralRe: Classes in C Pin
Rajesh R Subramanian17-Aug-11 7:51
professionalRajesh R Subramanian17-Aug-11 7:51 
GeneralRe: Classes in C Pin
«_Superman_»17-Aug-11 5:54
professional«_Superman_»17-Aug-11 5:54 
AnswerRe: Classes in C Pin
Alan Balkany17-Aug-11 4:32
Alan Balkany17-Aug-11 4:32 
You don't need an object-oriented language to do object-oriented programming. Going back to C once after many years of C++, I noticed I was using typedefs more effecively, as a substitute for "class". You can also use static members in C to simulate the private members of a C++ class.

The Decorator design pattern (http://en.wikipedia.org/wiki/Decorator_pattern ) can be used to add inheritance to languages that don't have it, like C.

The basic idea is that the "virtual" methods of each "class" (typedef'd struct) have a function pointer that can be set to a function in a parent class. If the pointer is non-NULL, it's called to simulate inheritance.
GeneralRe: Classes in C Pin
jschell17-Aug-11 8:54
jschell17-Aug-11 8:54 
GeneralRe: Classes in C Pin
Alan Balkany17-Aug-11 9:15
Alan Balkany17-Aug-11 9:15 
AnswerRe: Classes in C Pin
Stefan_Lang22-Aug-11 4:04
Stefan_Lang22-Aug-11 4:04 
Questionhow to implement a dll for connecting the browser through proxy server in vc++ Pin
vkgktm16-Aug-11 20:36
vkgktm16-Aug-11 20:36 
AnswerRe: how to implement a dll for connecting the browser through proxy server in vc++ Pin
Richard MacCutchan16-Aug-11 22:33
mveRichard MacCutchan16-Aug-11 22:33 
QuestionCatch SHIFT key in PreTranslateMessage Pin
_Flaviu16-Aug-11 1:54
_Flaviu16-Aug-11 1:54 
AnswerRe: Catch SHIFT key in PreTranslateMessage Pin
Code-o-mat16-Aug-11 2:00
Code-o-mat16-Aug-11 2:00 
GeneralRe: Catch SHIFT key in PreTranslateMessage Pin
_Flaviu16-Aug-11 22:54
_Flaviu16-Aug-11 22:54 
GeneralRe: Catch SHIFT key in PreTranslateMessage Pin
Code-o-mat16-Aug-11 22:56
Code-o-mat16-Aug-11 22:56 
Questionweb service interface return 4 and 12 [solved] Pin
yu-jian16-Aug-11 0:57
yu-jian16-Aug-11 0:57 
QuestionRe: web service interface return 4 and 12 Pin
Richard MacCutchan16-Aug-11 1:06
mveRichard MacCutchan16-Aug-11 1:06 
AnswerRe: web service interface return 4 and 12 Pin
yu-jian16-Aug-11 6:40
yu-jian16-Aug-11 6:40 
GeneralRe: web service interface return 4 and 12 Pin
Richard MacCutchan16-Aug-11 9:36
mveRichard MacCutchan16-Aug-11 9:36 
AnswerRe: web service interface return 4 and 12 Pin
David Crow16-Aug-11 6:46
David Crow16-Aug-11 6:46 
AnswerRe: web service interface return 4 and 12 Pin
Albert Holguin16-Aug-11 9:38
professionalAlbert Holguin16-Aug-11 9:38 
QuestionHow to set the text of a Picture Control Pin
Amrit Agr15-Aug-11 20:07
Amrit Agr15-Aug-11 20:07 
AnswerRe: How to set the text of a Picture Control Pin
Code-o-mat15-Aug-11 22:13
Code-o-mat15-Aug-11 22:13 

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.