Click here to Skip to main content
15,913,283 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: "little" "small" ComboBox ? Pin
Cynicannibal1-Nov-03 0:02
Cynicannibal1-Nov-03 0:02 
GeneralRe: "little" "small" ComboBox ? Pin
Shog91-Nov-03 3:33
sitebuilderShog91-Nov-03 3:33 
GeneralRe: "little" "small" ComboBox ? Pin
Cynicannibal4-Nov-03 2:40
Cynicannibal4-Nov-03 2:40 
GeneralFunction.... Pin
ponshio30-Oct-03 4:04
ponshio30-Oct-03 4:04 
GeneralRe: Function.... Pin
Brian Shifrin30-Oct-03 4:11
Brian Shifrin30-Oct-03 4:11 
GeneralRe: Function.... Pin
Ian Darling30-Oct-03 4:12
Ian Darling30-Oct-03 4:12 
GeneralRe: Function.... Pin
JWood30-Oct-03 5:12
JWood30-Oct-03 5:12 
GeneralRe: Function.... Pin
jhwurmbach30-Oct-03 5:54
jhwurmbach30-Oct-03 5:54 
As the others pointed out, you are returning an int - probably without knowing it.;P
You definitely need to return a CString, not CString& or *CString. You cannot return anything local to your function, as it needs to exist after your function has terminated.

Your first parameter should be a const CString&: As you are only ever reading it, so you can promise that to the compiler and let it optimize your code. It should be a reference, as there is no point in making a temporary copy of the CString just for this call (as the normal call-by-value does). Yes, I know about CString doing refernce counting, but this is beginner level.

Third, your variable names could be longer and more 'telling' about their use. But that is purely personal style.


Who is 'General Failure'? And why is he reading my harddisk?!?
GeneralLoadImage() memory leak. Pin
Neha30-Oct-03 2:34
Neha30-Oct-03 2:34 
GeneralRe: LoadImage() memory leak. Pin
David Crow30-Oct-03 2:37
David Crow30-Oct-03 2:37 
GeneralRe: LoadImage() memory leak. Pin
Neha30-Oct-03 2:44
Neha30-Oct-03 2:44 
GeneralRe: LoadImage() memory leak. Pin
Alexander M.,30-Oct-03 2:52
Alexander M.,30-Oct-03 2:52 
GeneralRe: LoadImage() memory leak. Pin
Neha30-Oct-03 2:56
Neha30-Oct-03 2:56 
GeneralRe: LoadImage() memory leak. Pin
David Crow30-Oct-03 3:04
David Crow30-Oct-03 3:04 
GeneralRe: LoadImage() memory leak. Pin
Neha30-Oct-03 3:07
Neha30-Oct-03 3:07 
GeneralRe: LoadImage() memory leak. Pin
Alexander M.,30-Oct-03 2:41
Alexander M.,30-Oct-03 2:41 
GeneralRe: LoadImage() memory leak. Pin
Neha30-Oct-03 2:51
Neha30-Oct-03 2:51 
GeneralRe: LoadImage() memory leak. Pin
David Crow30-Oct-03 3:06
David Crow30-Oct-03 3:06 
GeneralRe: LoadImage() memory leak. Pin
antlers30-Oct-03 7:58
antlers30-Oct-03 7:58 
GeneralRe: LoadImage() memory leak. Pin
Neha30-Oct-03 16:40
Neha30-Oct-03 16:40 
GeneralRe: LoadImage() memory leak. Pin
melwyn31-Oct-03 2:50
melwyn31-Oct-03 2:50 
GeneralDLL Pin
hph30-Oct-03 2:27
hph30-Oct-03 2:27 
GeneralRe: DLL Pin
Alexander M.,30-Oct-03 2:32
Alexander M.,30-Oct-03 2:32 
GeneralRe: DLL Pin
hph2-Nov-03 22:19
hph2-Nov-03 22:19 
GeneralRe: DLL Pin
JWood30-Oct-03 5:15
JWood30-Oct-03 5:15 

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.