Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Warning 1 warning C4239: nonstandard extension used : 'default argument' : conversion from 'CSize' to 'CSize &'

I have four of these errors. Using Visual Studio 2010

This is the code....

void="" dword="" csize="" szicon="CSize(0," lpcrect="" lprectbounds="NULL," dwidtool="0);"

[edit]fixed the tags, but I believe the first part doesn't actually belong here, or got mangled when pasted into this post? - Stefan_Lang[/edit]
Posted
Updated 21-Jul-11 1:20am
v2
Comments
Chuck O'Toole 20-Jul-11 22:23pm    
The code paste didn't work, edit your question to include the relevant source

1 solution

Apparently you declared the variable szicon to be of type CSize&. Reference types are supposed to be const though, and that is what the warning expresses. Change the type to const CSize& instead, like this:
const CSize& szicon = CSize(...);

That said, the above wouldn't even work, because the right hand side creates a temporary object of type CSize which gets immediately destroyed because it isn't assigned to an actual variable! Why don't you just declare a variable like this:
CSize szicon(...);
?
This should work just as well.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900