Error Again!
-
Here is my source code : BOOL APIENTRY SavingDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { ...... ...... } \\ here is the error . The complier shows the below error: C:\msdn cd1\SAMPLES\MSDN\TECHART\asfasasfas\dialogs.cpp(293) : warning C4715: 'SavingDlgProc' : not all control paths return a value. So what can be done to solve it?
-
Here is my source code : BOOL APIENTRY SavingDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { ...... ...... } \\ here is the error . The complier shows the below error: C:\msdn cd1\SAMPLES\MSDN\TECHART\asfasasfas\dialogs.cpp(293) : warning C4715: 'SavingDlgProc' : not all control paths return a value. So what can be done to solve it?
Your explaination seems a little vaige but here are some ideas. First of all the warning C4715 indicates that you are not returning a value for at least one control path. This means you are not setting the return value in some logical case. More than likley something like: BOOL APIENTRY SavingDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { BOOL bRet; if(something) { bRet = true; return bRet; } else { //not setting bRet here as a return value } } \\ here is the error . Since this is only a warning from the compiler I doubt its causing an error. I will however for arguments sake assume that when you state "here is the error". That you mean you are getting an error during debugging on the last line of this function. This line of code is were the function goes out of scope and cleans up anything allocated by this function. So I would guess that somewhere in this function you are overwritting something on the stack, that is currupting the computers memory stack. Check any NEW allocations!! If you want more help with this please supply more info thanks!!