Click here to Skip to main content
15,867,756 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: error C2801: 'operator =' must be a member Pin
Ryan Binns26-Feb-06 17:16
Ryan Binns26-Feb-06 17:16 
GeneralRe: error C2801: 'operator =' must be a member Pin
Stephen Hewitt26-Feb-06 18:10
Stephen Hewitt26-Feb-06 18:10 
GeneralRe: error C2801: 'operator =' must be a member Pin
Ryan Binns26-Feb-06 19:41
Ryan Binns26-Feb-06 19:41 
GeneralRe: error C2801: 'operator =' must be a member Pin
Stephen Hewitt26-Feb-06 19:51
Stephen Hewitt26-Feb-06 19:51 
Jokesome games Pin
FARGORE26-Feb-06 3:04
FARGORE26-Feb-06 3:04 
QuestionHow does the using the address of operator work in Visual C++? Pin
Tom Moore26-Feb-06 2:08
Tom Moore26-Feb-06 2:08 
AnswerRe: How does the using the address of operator work in Visual C++? Pin
BadKarma26-Feb-06 3:15
BadKarma26-Feb-06 3:15 
GeneralRe: How does the using the address of operator work in Visual C++? Pin
Tom Moore26-Feb-06 3:31
Tom Moore26-Feb-06 3:31 
Thanks I think I understand!

The reason why is? When windows was created using GDI things were written in good old C!
Unlike C++, C didnt use pass references, so you had to use pass by address.

Also since pass by Value such as :

<br />
CClientDC dc(this);<br />
<br />
CPen penBlue = new CPen();<br />
penBlue.Create(PS_SOLID,1,RGB(0,0,255));<br />
<br />
dc.SelectObject(penBlue) // pass by value, makes a copy - uses up a lot of memory (BAD)<br />
<br />
//instead use<br />
<br />
dc.SelectObject(&penBlue) // pass by address - fast and effecient, using original object (GOOD)<br />
<br />
also you could use<br />
<br />
CPen& rPenBlue = &penBlue;<br />
dc.SelectObject(rPenBlue) // not sure if this is right but pass by reference<br />
<br />


Thanks Tom
GeneralRe: How does the using the address of operator work in Visual C++? Pin
PJ Arends26-Feb-06 11:13
professionalPJ Arends26-Feb-06 11:13 
AnswerRe: How does the using the address of operator work in Visual C++? Pin
Tom Moore26-Feb-06 3:17
Tom Moore26-Feb-06 3:17 
GeneralRe: How does the using the address of operator work in Visual C++? Pin
Gary R. Wheeler26-Feb-06 5:22
Gary R. Wheeler26-Feb-06 5:22 
AnswerRe: How does the using the address of operator work in Visual C++? Pin
includeh1026-Feb-06 3:19
includeh1026-Feb-06 3:19 
GeneralRe: How does the using the address of operator work in Visual C++? Pin
Tom Moore26-Feb-06 3:34
Tom Moore26-Feb-06 3:34 
AnswerRe: How does the using the address of operator work in Visual C++? Pin
Hamid_RT26-Feb-06 3:48
Hamid_RT26-Feb-06 3:48 
AnswerRe: How does the using the address of operator work in Visual C++? Pin
Tom Moore26-Feb-06 6:10
Tom Moore26-Feb-06 6:10 
AnswerRe: How does the using the address of operator work in Visual C++? Pin
PJ Arends26-Feb-06 11:08
professionalPJ Arends26-Feb-06 11:08 
AnswerRe: How does the using the address of operator work in Visual C++? Pin
David Crow27-Feb-06 3:37
David Crow27-Feb-06 3:37 
QuestionMessage Box being hidden Pin
braveheartkenya26-Feb-06 2:04
braveheartkenya26-Feb-06 2:04 
AnswerRe: Message Box being hidden Pin
includeh1026-Feb-06 3:21
includeh1026-Feb-06 3:21 
GeneralRe: Message Box being hidden Pin
braveheartkenya26-Feb-06 4:52
braveheartkenya26-Feb-06 4:52 
AnswerRe: Message Box being hidden Pin
FarPointer26-Feb-06 3:37
FarPointer26-Feb-06 3:37 
GeneralRe: Message Box being hidden Pin
braveheartkenya26-Feb-06 4:56
braveheartkenya26-Feb-06 4:56 
GeneralRe: Message Box being hidden Pin
FarPointer26-Feb-06 5:11
FarPointer26-Feb-06 5:11 
GeneralRe: Message Box being hidden Pin
Gary R. Wheeler26-Feb-06 5:31
Gary R. Wheeler26-Feb-06 5:31 
GeneralRe: Message Box being hidden Pin
braveheartkenya26-Feb-06 6:05
braveheartkenya26-Feb-06 6:05 

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.