Click here to Skip to main content
15,899,754 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Windows Explorer Pin
harsh91115-Nov-03 19:24
harsh91115-Nov-03 19:24 
GeneralRe: Windows Explorer Pin
Prakash Nadar15-Nov-03 19:51
Prakash Nadar15-Nov-03 19:51 
GeneralHTML default document icon Pin
alex.barylski15-Nov-03 8:40
alex.barylski15-Nov-03 8:40 
GeneralRe: HTML default document icon Pin
Peter Molnar15-Nov-03 14:28
Peter Molnar15-Nov-03 14:28 
GeneralRe: HTML default document icon Pin
alex.barylski15-Nov-03 14:38
alex.barylski15-Nov-03 14:38 
QuestionHow to duplicate an object? Pin
Atlence15-Nov-03 7:46
Atlence15-Nov-03 7:46 
AnswerRe: How to duplicate an object? Pin
Jeryth15-Nov-03 8:15
Jeryth15-Nov-03 8:15 
AnswerRe: How to duplicate an object? Pin
Tim Smith15-Nov-03 8:18
Tim Smith15-Nov-03 8:18 
In theory what you did "could" work but in practice it is breaking so many rules that you should never do it.

In your case, "*pMyVar2 = *pMyVar1" should work, however, that assumes that if a default assignment operator isn't defined, that the default one (of just copying the elements blindly) would work. Many times it will not for an assortment of reasons. In those cases, you have to define your own assignment operator to handle the operation properly.

IMHO, the default assignment operator is more trouble than it is worth. Many people will thwart the default assignment operator if you shouldn't be performing that operation on the class. If your class can be used with an assignment operator, go to the trouble of defining one.

Tim Smith

I'm going to patent thought. I have yet to see any prior art.
GeneralRe: How to duplicate an object? Pin
Jeryth15-Nov-03 8:27
Jeryth15-Nov-03 8:27 
GeneralRe: How to duplicate an object? Pin
Anonymous15-Nov-03 9:17
Anonymous15-Nov-03 9:17 
GeneralMFC serialization fails from COM Pin
DimkaSPB15-Nov-03 7:44
DimkaSPB15-Nov-03 7:44 
GeneralChat Server&Client Protocol + how2tx/rx question?! Pin
[ Jûroehn ]15-Nov-03 7:35
[ Jûroehn ]15-Nov-03 7:35 
GeneralRe: Chat Server&Client Protocol + how2tx/rx question?! Pin
Peter Molnar15-Nov-03 14:07
Peter Molnar15-Nov-03 14:07 
GeneralDirectShow (DirectX) on CD Pin
TFB15-Nov-03 7:32
TFB15-Nov-03 7:32 
GeneralRe: DirectShow (DirectX) on CD Pin
Jeryth15-Nov-03 8:23
Jeryth15-Nov-03 8:23 
GeneralRe: DirectShow (DirectX) on CD Pin
TFB15-Nov-03 10:41
TFB15-Nov-03 10:41 
GeneralProblems with PI Pin
Jeryth15-Nov-03 7:08
Jeryth15-Nov-03 7:08 
GeneralRe: Problems with PI Pin
Kevin McFarlane15-Nov-03 10:13
Kevin McFarlane15-Nov-03 10:13 
GeneralRe: Problems with PI Pin
Antti Keskinen15-Nov-03 15:02
Antti Keskinen15-Nov-03 15:02 
GeneralJust bought a PocketPC, however, I need help here. Pin
Link260015-Nov-03 3:21
Link260015-Nov-03 3:21 
GeneralRe: Just bought a PocketPC, however, I need help here. Pin
Mike Dimmick15-Nov-03 3:32
Mike Dimmick15-Nov-03 3:32 
GeneralMultithreaded TCP server, client thread termination Pin
Kuniva15-Nov-03 2:14
Kuniva15-Nov-03 2:14 
GeneralRe: Multithreaded TCP server, client thread termination Pin
Rickard Andersson2015-Nov-03 2:41
Rickard Andersson2015-Nov-03 2:41 
GeneralRe: Multithreaded TCP server, client thread termination Pin
Kuniva15-Nov-03 3:31
Kuniva15-Nov-03 3:31 
GeneralRe: Multithreaded TCP server, client thread termination Pin
Rickard Andersson2018-Nov-03 5:31
Rickard Andersson2018-Nov-03 5:31 

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.