Windows Structured Exception Handling: simple test program will not compile.
- by Jon
#include <windows.h>
int main()
{
int* i = (int*)malloc(sizeof(int));
*i = 5;
__try
{
free(i);
free(i);
}
__except
{
return -1;
}
return 0;
}
I am trying to learn more about windows SEH. My first test program is giving me some real trouble. I have looked at the msdn documentation and I am still not really sure what I have wrong. I am getting the following errors when I try to compile this program:
error C2059: syntax error : '{'
error C2143: syntax error : missing ';' before '{'
both on line 15.
Thanks.