Click here to Skip to main content
15,891,033 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC enlisting local drives Pin
missnazar25-Oct-04 0:38
missnazar25-Oct-04 0:38 
GeneralRe: MFC enlisting local drives Pin
ThatsAlok25-Oct-04 19:37
ThatsAlok25-Oct-04 19:37 
Generalrealizing virtual functions with *this parameter Pin
impeham22-Oct-04 13:02
impeham22-Oct-04 13:02 
GeneralRe: realizing virtual functions with *this parameter Pin
Gary R. Wheeler22-Oct-04 14:27
Gary R. Wheeler22-Oct-04 14:27 
GeneralRe: realizing virtual functions with *this parameter Pin
impeham22-Oct-04 15:22
impeham22-Oct-04 15:22 
GeneralRe: realizing virtual functions with *this parameter Pin
Andrew Walker22-Oct-04 16:57
Andrew Walker22-Oct-04 16:57 
GeneralRe: realizing virtual functions with *this parameter Pin
impeham23-Oct-04 1:38
impeham23-Oct-04 1:38 
GeneralRe: realizing virtual functions with *this parameter Pin
Andrew Walker23-Oct-04 4:59
Andrew Walker23-Oct-04 4:59 
From your original question - why doesn't this work, it is because *this is a reference to an object, not an actual type.

virtual void operator=(*this object) = 0;

What are you really trying to achieve? If you want to be able to polymorphically assign objects you should look into the virtual constructor idiom and Co-variant return types. C++ FAQ Lite 20.6 - What is a "virtual constructor"?

AFAIK there is no standard portable way to extract the name of a class from an object without using templates or relying upon facilities built into specific compilers - all of which are far less standard than templates (which are now common and robust in C++). I believe that at one stage GCC had an experimental typeof operator. Some alternative implementations of typeof operators do exist however they all rely heavily upon templates, but even then I'm not sure it would help.

Just as an aside, templates are now implemented in all major C++ compilers, basic template techniques (like the one I demonstrated) will compile under every compilers I know (gcc, vc6, vc7, vc7.1, vc8, comeau, borland, intel, ... the list goes on) - I don't think you can get more platform independant than that.




If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.

Rudyard Kipling

GeneralWinhelp vs. HTML help context Pin
digwizfox22-Oct-04 12:52
digwizfox22-Oct-04 12:52 
GeneralRe: Winhelp vs. HTML help context Pin
Gary R. Wheeler22-Oct-04 14:46
Gary R. Wheeler22-Oct-04 14:46 
GeneralRe: Winhelp vs. HTML help context Pin
digwizfox25-Oct-04 8:12
digwizfox25-Oct-04 8:12 
GeneralRe: Winhelp vs. HTML help context Pin
digwizfox25-Oct-04 13:36
digwizfox25-Oct-04 13:36 
GeneralRe: Winhelp vs. HTML help context Pin
YoSilver22-Oct-04 21:07
YoSilver22-Oct-04 21:07 
Generalplease! help me about antialiasing!!! Pin
Shiwan Sung22-Oct-04 12:37
Shiwan Sung22-Oct-04 12:37 
GeneralRe: please! help me about antialiasing!!! Pin
YoSilver22-Oct-04 21:14
YoSilver22-Oct-04 21:14 
GeneralRe: please! help me about antialiasing!!! Pin
Shiwan Sung22-Oct-04 22:14
Shiwan Sung22-Oct-04 22:14 
GeneralOCX on IE File-> New -> Window Problem Pin
shinay22-Oct-04 9:57
shinay22-Oct-04 9:57 
GeneralStatic Linking Pin
hyling22-Oct-04 8:59
hyling22-Oct-04 8:59 
GeneralRe: Static Linking Pin
Alexander M.,22-Oct-04 10:10
Alexander M.,22-Oct-04 10:10 
GeneralRe: Static Linking Pin
Michael Dunn22-Oct-04 13:52
sitebuilderMichael Dunn22-Oct-04 13:52 
GeneralRe: Static Linking Pin
hyling23-Oct-04 7:34
hyling23-Oct-04 7:34 
GeneralRe: Static Linking Pin
Uwe Keim23-Oct-04 4:56
sitebuilderUwe Keim23-Oct-04 4:56 
GeneralRe: Static Linking Pin
hyling23-Oct-04 7:33
hyling23-Oct-04 7:33 
GeneralRemote Office Automation Pin
Malcolm Smart22-Oct-04 8:50
Malcolm Smart22-Oct-04 8:50 
GeneralRe: Remote Office Automation Pin
Michael P Butler23-Oct-04 9:00
Michael P Butler23-Oct-04 9:00 

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.