Click here to Skip to main content
15,890,579 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Resizing a WPF Window that is a child to a CView Pin
nadine123456-Oct-11 21:34
nadine123456-Oct-11 21:34 
GeneralRe: Resizing a WPF Window that is a child to a CView Pin
TheGreatAndPowerfulOz7-Oct-11 4:47
TheGreatAndPowerfulOz7-Oct-11 4:47 
GeneralRe: Resizing a WPF Window that is a child to a CView Pin
nadine123458-Oct-11 9:09
nadine123458-Oct-11 9:09 
AnswerRe: Resizing a WPF Window that is a child to a CView Pin
TheGreatAndPowerfulOz18-Oct-11 7:33
TheGreatAndPowerfulOz18-Oct-11 7:33 
QuestionHow do you const your references? Pin
User 5838525-Oct-11 18:35
User 5838525-Oct-11 18:35 
AnswerRe: How do you const your references? Pin
Stefan_Lang6-Oct-11 0:53
Stefan_Lang6-Oct-11 0:53 
GeneralRe: How do you const your references? Pin
TheGreatAndPowerfulOz6-Oct-11 5:55
TheGreatAndPowerfulOz6-Oct-11 5:55 
GeneralRe: How do you const your references? Pin
Stefan_Lang6-Oct-11 6:09
Stefan_Lang6-Oct-11 6:09 
In the first function you passed a pointer, not a reference, and you passed that pointer by value. Passing a parameter of type X by value is the same as passing the same parameter as type const X - at least from the point of view of the caller - therefore the declaration of your second function is syntactically the same as the first (again, from the point of view of the caller). The compiler cannot disambiguate any calls to this function into one of the two versions, therefore it does not allow you to overload like that. Follow the link to GOTW I've posted above, IIRC that this was also covered there. In short, if you pass a parameter by value, you cannot overload it only by adding const to that type.

If you meant to pass your pointer by reference, do it this way (using underscore to highlight the change):
C++
void GetBlah2(Blah const *& blah) { } // #1 method taking pointer to const Blah
void GetBlah2(Blah const * const blah) { } // #2 method taking const pointer to const Blah

This should work.
GeneralRe: How do you const your references? Pin
TheGreatAndPowerfulOz6-Oct-11 6:37
TheGreatAndPowerfulOz6-Oct-11 6:37 
GeneralRe: How do you const your references? Pin
Stefan_Lang6-Oct-11 6:48
Stefan_Lang6-Oct-11 6:48 
GeneralRe: How do you const your references? Pin
TheGreatAndPowerfulOz6-Oct-11 7:07
TheGreatAndPowerfulOz6-Oct-11 7:07 
GeneralRe: How do you const your references? Pin
Stefan_Lang6-Oct-11 22:07
Stefan_Lang6-Oct-11 22:07 
AnswerRe: How do you const your references? Pin
«_Superman_»6-Oct-11 6:05
professional«_Superman_»6-Oct-11 6:05 
QuestionPostMessage with WPARAM does not work Pin
Vaclav_5-Oct-11 17:43
Vaclav_5-Oct-11 17:43 
AnswerRe: PostMessage with WPARAM does not work Pin
Richard MacCutchan5-Oct-11 21:39
mveRichard MacCutchan5-Oct-11 21:39 
AnswerRe: You can't simulate keyboard input with PostMessage Pin
Software_Developer5-Oct-11 21:50
Software_Developer5-Oct-11 21:50 
AnswerRe: PostMessage with WPARAM does not work Pin
Vaclav_5-Oct-11 23:21
Vaclav_5-Oct-11 23:21 
GeneralRe: PostMessage with WPARAM does not work Pin
enhzflep6-Oct-11 1:10
enhzflep6-Oct-11 1:10 
QuestionHi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
symeramon5-Oct-11 5:21
symeramon5-Oct-11 5:21 
AnswerRe: Hi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
David Crow5-Oct-11 8:10
David Crow5-Oct-11 8:10 
GeneralRe: Hi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
symeramon6-Oct-11 0:47
symeramon6-Oct-11 0:47 
GeneralRe: Hi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
David Crow6-Oct-11 2:55
David Crow6-Oct-11 2:55 
GeneralRe: Hi there all again! This time with an improvement! (and more clear question about C++ ADO) :) Pin
symeramon7-Oct-11 5:33
symeramon7-Oct-11 5:33 
QuestionMFC usage Pin
mysmax5-Oct-11 2:01
mysmax5-Oct-11 2:01 
AnswerRe: MFC usage Pin
Albert Holguin5-Oct-11 2:53
professionalAlbert Holguin5-Oct-11 2:53 

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.