Click here to Skip to main content
15,904,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CStatic Control Pin
namaskaaram24-Nov-04 20:42
namaskaaram24-Nov-04 20:42 
GeneralCStatic Control Pin
shijuck24-Nov-04 2:59
shijuck24-Nov-04 2:59 
GeneralMedia Player 10 ActiveX Problem Pin
X204024-Nov-04 2:51
X204024-Nov-04 2:51 
GeneralC++ Help Pin
BRIMID24-Nov-04 1:37
BRIMID24-Nov-04 1:37 
GeneralRe: C++ Help Pin
Mike Danberg24-Nov-04 11:18
Mike Danberg24-Nov-04 11:18 
GeneralRe: C++ Help Pin
RYU^^24-Nov-04 13:48
RYU^^24-Nov-04 13:48 
Generalsmall doubt Pin
Tripura.K24-Nov-04 1:36
Tripura.K24-Nov-04 1:36 
GeneralRe: small doubt Pin
John R. Shaw24-Nov-04 3:56
John R. Shaw24-Nov-04 3:56 
GeneralWM_SHUTDOWN Notification to a dll Pin
AssemblySoft24-Nov-04 0:42
AssemblySoft24-Nov-04 0:42 
GeneralRe: WM_SHUTDOWN Notification to a dll Pin
ThatsAlok24-Nov-04 0:54
ThatsAlok24-Nov-04 0:54 
GeneralRe: WM_SHUTDOWN Notification to a dll Pin
AssemblySoft24-Nov-04 1:34
AssemblySoft24-Nov-04 1:34 
GeneralRe: WM_SHUTDOWN Notification to a dll Pin
Antony M Kancidrowski24-Nov-04 3:55
Antony M Kancidrowski24-Nov-04 3:55 
GeneralRe: WM_SHUTDOWN Notification to a dll Pin
AssemblySoft24-Nov-04 5:52
AssemblySoft24-Nov-04 5:52 
GeneralRe: WM_SHUTDOWN Notification to a dll Pin
Antony M Kancidrowski24-Nov-04 6:03
Antony M Kancidrowski24-Nov-04 6:03 
GeneralRe: WM_SHUTDOWN Notification to a dll Pin
AssemblySoft24-Nov-04 23:08
AssemblySoft24-Nov-04 23:08 
GeneralRe: WM_SHUTDOWN Notification to a dll Pin
ThatsAlok24-Nov-04 17:18
ThatsAlok24-Nov-04 17:18 
GeneralRe: WM_SHUTDOWN Notification to a dll Pin
AssemblySoft24-Nov-04 23:06
AssemblySoft24-Nov-04 23:06 
GeneralChanging font in treeview control Pin
Alpha Siera24-Nov-04 0:29
Alpha Siera24-Nov-04 0:29 
GeneralRe: Changing font in treeview control Pin
Jack Puppy24-Nov-04 0:54
Jack Puppy24-Nov-04 0:54 
GeneralMultiple row selection MSFlexGrid Pin
balajeedurai23-Nov-04 23:37
balajeedurai23-Nov-04 23:37 
Generalhelp....... Pin
namaskaaram23-Nov-04 23:13
namaskaaram23-Nov-04 23:13 
GeneralRe: help....... Pin
Jack Puppy24-Nov-04 0:45
Jack Puppy24-Nov-04 0:45 
GeneralRe: help....... Pin
namaskaaram24-Nov-04 16:57
namaskaaram24-Nov-04 16:57 
General#defining correct constant Pin
GDavy23-Nov-04 23:07
GDavy23-Nov-04 23:07 
I`ve got kind off a complex situation here.
I have a class hierarchy that looks like

class A
class aB:public A
class aC:public A
class cD:public C
with further derived classes, but for illustrating this`ll do.
in class A I define some constants like

#define CONST_A_1 1
#define CONST_A_2 2
...

if class aB needs to I should be able to define a series of constants there that continues where the series of #defines in class A stopped.
e.g. if last const in class A was #define CONST_A_X x (where x is a number)
then CONST_aB_1 should get value x+1.
Ok this is easy I could just define in class A #define CONST_A_LAST CONST_A_X
and set the definitions in class aB like

#define CONST_aB_1 (CONST_A_LAST+1)
#define CONST_aB_2 (CONST_aB_1+1)
...

Now imagine that the constants defined in A are good enough for aC(no extra needed), but I need some more for cD...
I could define them in cD as i did in aB like #define CONST_cD_1 (CONST_A_LAST+1) and so on, but what if due to specifications I don^t have yet I will need to define a constant in aC later on? Then I will need to change the defines in class cD too (at least the first one,because I don^t want a constant with the same value in base-class)....
From the start I could define in aC something like #define CONST_C_LAST CONST_A_LAST
and use that CONST_C_LAST as a starting point in cD.

However I don^t like the above approach( although it might be the only one??)
The thing is each time I would derive a new class from one of these classes I would need to remember to define a new "CONST_..._LAST" constant (in case that I derive a class from that class and need to specify a new const).Which might lead to a lot of unused defined constants (doesn^t hurt, but I don^t li

Does anybody know how I could solve this issue here in such a way that I can remove/add new constants to a class without needing to worry about derived classes of that class. Or derive classes without having to remember adding a CONST_..._LAST if I don^t need it for that class, but still be able to derive a new class from that one and start with a correct constant without bothering base class, and in case base class suddenly needs a constant adding it there without bothering derived class.

I know sounds like a lot to ask for. But someone might know a solution....
Thanks for any insight you might provide.
Greets,
Davy
QuestionCString to a int? Pin
Larsson23-Nov-04 22:55
Larsson23-Nov-04 22:55 

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.