Click here to Skip to main content
16,021,810 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: convert delphi to c++ builder Pin
raj15767-May-09 1:56
raj15767-May-09 1:56 
QuestionC++ Template question Pin
rrrado6-May-09 22:48
rrrado6-May-09 22:48 
QuestionRe: C++ Template question Pin
CPallini6-May-09 22:55
mveCPallini6-May-09 22:55 
AnswerRe: C++ Template question Pin
rrrado6-May-09 23:13
rrrado6-May-09 23:13 
QuestionRe: C++ Template question Pin
CPallini6-May-09 23:19
mveCPallini6-May-09 23:19 
AnswerRe: C++ Template question Pin
rrrado6-May-09 23:37
rrrado6-May-09 23:37 
QuestionRe: C++ Template question Pin
CPallini6-May-09 23:49
mveCPallini6-May-09 23:49 
AnswerRe: C++ Template question Pin
Stuart Dootson6-May-09 23:49
professionalStuart Dootson6-May-09 23:49 
How about just presuming the existence of accessor functions in the parent - I've defined a macro to help reduce the amount of typing:

template <class T> class DRecord
{
    void DoReset() {  static_cast<T*>(this)->SetID(0); }  // accessing the ID
};

#define DEFINE_ID_FIELD(ID_NAME) \
   int NAME;
   void SetID(int value) { NAME = value; }
   int GetID(int value) const { return NAME; }

class A : public DRecord<A>
{
   DEFINE_ID_FIELD(A_XXX)
};


As an aside - are you aware of the OLE DB consumer templates[^] - they're templated database wrappers...

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

GeneralRe: C++ Template question Pin
rrrado7-May-09 0:42
rrrado7-May-09 0:42 
GeneralRe: C++ Template question Pin
Stuart Dootson7-May-09 0:46
professionalStuart Dootson7-May-09 0:46 
QuestionPlease help me!! it's urgent!! Pin
erenakman6-May-09 21:29
erenakman6-May-09 21:29 
AnswerRe: Please help me!! it's urgent!! Pin
Chandrasekharan P6-May-09 21:35
Chandrasekharan P6-May-09 21:35 
AnswerRe: Please help me!! it's urgent!! Pin
CPallini6-May-09 21:36
mveCPallini6-May-09 21:36 
AnswerRe: Please help me!! it's urgent!! Pin
_AnsHUMAN_ 6-May-09 21:44
_AnsHUMAN_ 6-May-09 21:44 
QuestionDirectX: "render to surface" or "render to device" (unmanaged) Pin
Pixinger776-May-09 21:01
Pixinger776-May-09 21:01 
AnswerRe: DirectX: "render to surface" or "render to device" (unmanaged) Pin
CPallini6-May-09 21:29
mveCPallini6-May-09 21:29 
AnswerRe: DirectX: "render to surface" or "render to device" (unmanaged) Pin
Stuart Dootson6-May-09 23:41
professionalStuart Dootson6-May-09 23:41 
Questionexception about 0x000006BA: RPC can not used (服务器不可用) Pin
fresh8888886-May-09 20:52
fresh8888886-May-09 20:52 
QuestionHow to realize the two aggressive color scale Pin
songhunhun6-May-09 20:47
songhunhun6-May-09 20:47 
AnswerRe: How to realize the two aggressive color scale Pin
KarstenK6-May-09 21:17
mveKarstenK6-May-09 21:17 
GeneralRe: How to realize the two aggressive color scale Pin
songhunhun6-May-09 22:18
songhunhun6-May-09 22:18 
QuestionRe: How to realize the two aggressive color scale Pin
CPallini6-May-09 21:27
mveCPallini6-May-09 21:27 
AnswerRe: How to realize the two aggressive color scale Pin
songhunhun6-May-09 22:15
songhunhun6-May-09 22:15 
AnswerRe: How to realize the two aggressive color scale Pin
Alan Balkany7-May-09 4:05
Alan Balkany7-May-09 4:05 
QuestionReg:scrolling views. Pin
coding_ram6-May-09 20:44
coding_ram6-May-09 20:44 

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.