Click here to Skip to main content
11,642,402 members (64,037 online)

C / C++ / MFC

 
GeneralRe: Win32 ListView control doesn't display any icons Pin
Richard MacCutchan17-Jul-13 7:50
mvpRichard MacCutchan17-Jul-13 7:50 
QuestionHow can make smooth horizontal scroll on ListControl?? Pin
sun mi Kang14-Jul-13 21:21
membersun mi Kang14-Jul-13 21:21 
AnswerRe: How can make smooth horizontal scroll on ListControl?? Pin
Richard MacCutchan14-Jul-13 22:24
mvpRichard MacCutchan14-Jul-13 22:24 
QuestionHow to use listview_insertgroup with custom draw? Pin
JoneLe8614-Jul-13 18:39
memberJoneLe8614-Jul-13 18:39 
QuestionRe: How to use listview_insertgroup with custom draw? Pin
Richard MacCutchan14-Jul-13 21:19
mvpRichard MacCutchan14-Jul-13 21:19 
AnswerRe: How to use listview_insertgroup with custom draw? Pin
JoneLe8619-Jul-13 8:42
memberJoneLe8619-Jul-13 8:42 
Questionbeginner question... recursive function Pin
Member 1008957914-Jul-13 5:40
memberMember 1008957914-Jul-13 5:40 
AnswerRe: beginner question... recursive function Pin
Santhosh G_14-Jul-13 7:46
memberSanthosh G_14-Jul-13 7:46 
In release mode it will create compilation error. It creates compilation error in VS2008. I got compilation error "error C4716: 'fatt' : must return a value".

But in debug mode it works as follows.
In both case contents of EAX register is used as the output of fatt() function. In both case EAX holds the output value, therefore the two versions works correctly in debug mode.

The result of imul is available in eax register and that is the expected result from the fatt function.

Following are the disassembly of two versions of fatt() function. First one with return value and next is without return value.

        return fattoriale=n*fatt(n-1);
01182ED2  mov         eax,dword ptr [n] 
01182ED5  sub         eax,1 
01182ED8  push        eax  
01182ED9  call        fatt (1181889h) 
01182EDE  add         esp,4 
01182EE1  imul        eax,dword ptr [n] 
01182EE5  mov         dword ptr [fattoriale],eax 
01182EE8  mov         eax,dword ptr [fattoriale] 

        fattoriale=n*fatt(n-1);
01182F92  mov         eax,dword ptr [n] 
01182F95  sub         eax,1 
01182F98  push        eax  
01182F99  call        fatt (11815FAh) 
01182F9E  add         esp,4 
01182FA1  imul        eax,dword ptr [n] 
01182FA5  mov         dword ptr [fattoriale],eax 
The multiplication in n*fatt(n-1) is done with imul operation. And its output is available in EAX register.

In first version( with return statement), last two instructions perform the following things. Contents of eax is moved to fattoriale and after that the contents of fattoriale is moved to eax( EAX holds the return value, or result of operation).

In second version( without return statement) the last mov is not found. But the output of iMul is in EAX register and therefore the output will be available to caller function through EAX register.
GeneralRe: beginner question... recursive function Pin
Amitosh S.M.14-Jul-13 17:40
memberAmitosh S.M.14-Jul-13 17:40 
GeneralRe: beginner question... recursive function Pin
Joe Woodbury15-Jul-13 10:43
memberJoe Woodbury15-Jul-13 10:43 
GeneralRe: beginner question... recursive function Pin
Member 1008957916-Jul-13 6:33
memberMember 1008957916-Jul-13 6:33 
AnswerRe: beginner question... recursive function Pin
Erudite_Eric15-Jul-13 2:35
memberErudite_Eric15-Jul-13 2:35 
AnswerRe: beginner question... recursive function Pin
Stefan_Lang15-Jul-13 22:24
memberStefan_Lang15-Jul-13 22:24 
QuestionRelocated HDD sectors Pin
RomTibi13-Jul-13 8:20
memberRomTibi13-Jul-13 8:20 
AnswerRe: Relocated HDD sectors Pin
Amitosh S.M.13-Jul-13 20:34
memberAmitosh S.M.13-Jul-13 20:34 
GeneralRe: Relocated HDD sectors Pin
RomTibi14-Jul-13 6:37
memberRomTibi14-Jul-13 6:37 
Questionwhy void CView::PostNcDestroy() is called? Pin
yu-jian12-Jul-13 22:04
groupyu-jian12-Jul-13 22:04 
AnswerRe: why void CView::PostNcDestroy() is called? Pin
pasztorpisti13-Jul-13 5:27
memberpasztorpisti13-Jul-13 5:27 
AnswerRe: why void CView::PostNcDestroy() is called? Pin
Erudite_Eric15-Jul-13 3:08
memberErudite_Eric15-Jul-13 3:08 
Question[SOLVED]Exec under windows Pin
Amitosh S.M.12-Jul-13 21:01
memberAmitosh S.M.12-Jul-13 21:01 
AnswerRe: Exec under windows Pin
Richard MacCutchan12-Jul-13 22:09
mvpRichard MacCutchan12-Jul-13 22:09 
GeneralRe: Exec under windows Pin
Amitosh S.M.12-Jul-13 23:08
memberAmitosh S.M.12-Jul-13 23:08 
GeneralRe: Exec under windows Pin
Richard MacCutchan12-Jul-13 23:18
mvpRichard MacCutchan12-Jul-13 23:18 
GeneralRe: Exec under windows Pin
Amitosh S.M.12-Jul-13 23:22
memberAmitosh S.M.12-Jul-13 23:22 
GeneralRe: Exec under windows Pin
Richard MacCutchan12-Jul-13 23:31
mvpRichard MacCutchan12-Jul-13 23:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.150731.1 | Last Updated 2 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid