Click here to Skip to main content
15,917,639 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionAccessing a Variable from another function. Pin
T.RATHA KRISHNAN22-Sep-08 0:19
T.RATHA KRISHNAN22-Sep-08 0:19 
AnswerRe: Accessing a Variable from another function. Pin
CPallini22-Sep-08 0:26
mveCPallini22-Sep-08 0:26 
QuestionRe: Accessing a Variable from another function. Pin
T.RATHA KRISHNAN22-Sep-08 0:46
T.RATHA KRISHNAN22-Sep-08 0:46 
AnswerRe: Accessing a Variable from another function. Pin
CPallini22-Sep-08 1:41
mveCPallini22-Sep-08 1:41 
AnswerRe: Accessing a Variable from another function. Pin
_AnsHUMAN_ 22-Sep-08 0:27
_AnsHUMAN_ 22-Sep-08 0:27 
QuestionDifference b/w strlen(NULL) and strlen("") Pin
SRKSHOME22-Sep-08 0:18
SRKSHOME22-Sep-08 0:18 
AnswerRe: Difference b/w strlen(NULL) and strlen("") Pin
CPallini22-Sep-08 0:23
mveCPallini22-Sep-08 0:23 
AnswerRe: Difference b/w strlen(NULL) and strlen("") Pin
toxcct22-Sep-08 21:30
toxcct22-Sep-08 21:30 
Questionoption button in tree control Pin
VCProgrammer21-Sep-08 23:37
VCProgrammer21-Sep-08 23:37 
Questionhow to create and run a webserver in VC++(MFC) Pin
tns_ranjith21-Sep-08 23:32
tns_ranjith21-Sep-08 23:32 
RantRe: how to create and run a webserver in VC++(MFC) Pin
Rajesh R Subramanian22-Sep-08 0:10
professionalRajesh R Subramanian22-Sep-08 0:10 
AnswerRe: how to create and run a webserver in VC++(MFC) Pin
enhzflep22-Sep-08 0:36
enhzflep22-Sep-08 0:36 
AnswerRe: how to create and run a webserver in VC++(MFC) Pin
Mark Salsbery22-Sep-08 5:53
Mark Salsbery22-Sep-08 5:53 
QuestionSetWindowPos don't accept values Pin
baerten21-Sep-08 23:31
baerten21-Sep-08 23:31 
AnswerRe: SetWindowPos don't accept values Pin
SandipG 21-Sep-08 23:58
SandipG 21-Sep-08 23:58 
GeneralRe: SetWindowPos don't accept values Pin
baerten22-Sep-08 4:23
baerten22-Sep-08 4:23 
QuestionRe: SetWindowPos don't accept values Pin
Mark Salsbery22-Sep-08 5:37
Mark Salsbery22-Sep-08 5:37 
QuestionCopy Byte information to structure Pin
nitin321-Sep-08 23:29
nitin321-Sep-08 23:29 
AnswerRe: Copy Byte information to structure Pin
SandipG 21-Sep-08 23:50
SandipG 21-Sep-08 23:50 
AnswerRe: Copy Byte information to structure Pin
CPallini21-Sep-08 23:53
mveCPallini21-Sep-08 23:53 
AnswerRe: Copy Byte information to structure Pin
Alan Balkany22-Sep-08 3:55
Alan Balkany22-Sep-08 3:55 
AnswerRe: Copy Byte information to structure [modified] Pin
cmk22-Sep-08 12:29
cmk22-Sep-08 12:29 
QuestionWindows Mail plugin : IStoreFolder/IStoreNamespace Fails on Vista Pin
dolly21-Sep-08 23:27
dolly21-Sep-08 23:27 
Questionvirtual function call issue [modified] Pin
George_George21-Sep-08 22:25
George_George21-Sep-08 22:25 
Hello everyone,


The different assembly code when we call through z and z1 in below sample is,

- we know the type of z, so no need to access vtable to make function call;
- we do not know the exact type for a pointer, so need to access vtable to make function call.

My question is whether my two items' understanding is correct. Thanks.

	z.func();
000A1575  lea         ecx,[z] 
000A1578  call        Zoo::func (0A11A4h) 

	z1->func();
000A157D  mov         eax,dword ptr [z1] 
000A1580  mov         edx,dword ptr [eax] 
000A1582  mov         esi,esp 
000A1584  mov         ecx,dword ptr [z1] 
000A1587  mov         eax,dword ptr [edx] 
000A1589  call        eax  
000A158B  cmp         esi,esp 
000A158D  call        @ILT+440(__RTC_CheckEsp) (0A11BDh) 


class Zoo
{
public:
	virtual void func() {cout << "Zoo" << endl; }
};

int main()
{
	Zoo z;

	Zoo* z1 = new Zoo();

	z.func();

	z1->func();

	delete z1;

	return 0;
}



thanks in advance,
George

modified on Monday, September 22, 2008 4:49 AM

QuestionHow to uniquely identify or distinguish windows that have no window name, same class name and resource id is zero [modified] Pin
georgekjolly21-Sep-08 22:16
georgekjolly21-Sep-08 22:16 

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.