Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using VS2008, Windows7 64bit, and MFC dialog base app.
C++
void _stdcall FuncA(int & a)
{
  a += 3;  // get error: access violation
}
void CMfcAsmTestDlg::OnBnClickedButton1()
{
  int var = 8;
   __asm
   {
    push var
    call FuncA
   }
}

Help please?
Posted

1 solution

Like this,

CSS
int var = 8;
__asm
{
    lea eax, [var]
    push eax
    call FuncA
}


[Edited]
You can write a small code by calling FuncA normally and start debugger and go to dissambler, there you can see the assembly code.
 
Share this answer
 
v2

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