Hello,
Here is a quick example :
// Source code built with PellesC 11.00.2
#include <stdio.h>
#include <windows.h>
char t1[]="This is a test1.";
char t2[]="This is a test2.";
int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, WCHAR *pszCmdLine, int nCmdShow)
{
__asm{
push 0
push OFFSET t1
push OFFSET t1
push 0
call DWORD PTR [MessageBox]
}
MessageBox(0,t2,t2,0);
return 0;
}
The API function MessageBox in the inline asm block should be enclosed between square brackets otherwise wrong call to API will lead to application crash.