Click here to Skip to main content
16,003,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Function Pointer Pin
Cedric Moonen10-Oct-06 4:49
Cedric Moonen10-Oct-06 4:49 
GeneralRe: Function Pointer Pin
baerten10-Oct-06 5:05
baerten10-Oct-06 5:05 
GeneralRe: Function Pointer Pin
Mark Salsbery10-Oct-06 6:22
Mark Salsbery10-Oct-06 6:22 
AnswerRe: Function Pointer Pin
Anonymuos10-Oct-06 5:22
Anonymuos10-Oct-06 5:22 
QuestionChanging the drive name in a tree control Pin
kiranin10-Oct-06 3:45
kiranin10-Oct-06 3:45 
AnswerRe: Changing the drive name in a tree control Pin
David Crow10-Oct-06 3:56
David Crow10-Oct-06 3:56 
Questionderive class Pin
Max++10-Oct-06 3:28
Max++10-Oct-06 3:28 
QuestionRe: derive class Pin
David Crow10-Oct-06 3:31
David Crow10-Oct-06 3:31 
Max++ wrote:
I derive CStr from CString as...


Are you sure this is what you want, since CString has no virtual destructor?

Max++ wrote:
...but the second line complier show error.


Are we supposed to guess the error? It likely has to do with a missing "using" declaration.

Aside from the dtor issue, the only argument I can see in your case for going ahead with the derivation is that you want to give your class a new ctor. Because ctors aren't inherited, you must be prepared to write forwarding ctors for all the CString ctors you want to be available in your derived class. Also, if you care about the return types of assignment operators, you must writing forwarding assignment operators. Compared to writing a handful of non-member "free" functions, this begins to sound like a lot of pointless work.


"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

"Judge not by the eye but by the heart." - Native American Proverb


AnswerRe: derive class Pin
Stephen Hewitt10-Oct-06 13:42
Stephen Hewitt10-Oct-06 13:42 
Answer[Message Deleted] Pin
toxcct10-Oct-06 3:47
toxcct10-Oct-06 3:47 
GeneralRe: derive class Pin
David Crow10-Oct-06 3:54
David Crow10-Oct-06 3:54 
GeneralRe: derive class Pin
Stephen Hewitt10-Oct-06 13:46
Stephen Hewitt10-Oct-06 13:46 
GeneralRe: derive class Pin
led mike11-Oct-06 4:53
led mike11-Oct-06 4:53 
AnswerRe: derive class Pin
Zac Howland10-Oct-06 4:15
Zac Howland10-Oct-06 4:15 
Questionsizeof(float)/sizeof(float[0]) Pin
Alex Cutovoi10-Oct-06 3:05
Alex Cutovoi10-Oct-06 3:05 
AnswerRe: sizeof(float)/sizeof(float[0]) Pin
Chris Losinger10-Oct-06 3:10
professionalChris Losinger10-Oct-06 3:10 
GeneralRe: sizeof(float)/sizeof(float[0]) Pin
Alex Cutovoi10-Oct-06 3:30
Alex Cutovoi10-Oct-06 3:30 
GeneralRe: sizeof(float)/sizeof(float[0]) Pin
James R. Twine10-Oct-06 3:32
James R. Twine10-Oct-06 3:32 
GeneralRe: sizeof(float)/sizeof(float[0]) Pin
Galatei10-Oct-06 3:41
Galatei10-Oct-06 3:41 
GeneralRe: sizeof(float)/sizeof(float[0]) Pin
Alex Cutovoi10-Oct-06 3:57
Alex Cutovoi10-Oct-06 3:57 
GeneralRe: sizeof(float)/sizeof(float[0]) Pin
Alex Cutovoi10-Oct-06 4:01
Alex Cutovoi10-Oct-06 4:01 
AnswerRe: sizeof(float)/sizeof(float[0]) Pin
James R. Twine10-Oct-06 3:14
James R. Twine10-Oct-06 3:14 
GeneralRe: sizeof(float)/sizeof(float[0]) Pin
Alex Cutovoi10-Oct-06 3:35
Alex Cutovoi10-Oct-06 3:35 
GeneralRe: sizeof(float)/sizeof(float[0]) Pin
James R. Twine10-Oct-06 3:36
James R. Twine10-Oct-06 3:36 
GeneralRe: sizeof(float)/sizeof(float[0]) Pin
Alex Cutovoi10-Oct-06 3:59
Alex Cutovoi10-Oct-06 3:59 

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.