[Mingw-users] AddVectoredExceptionHandler was not declared in this scope

81 views
Skip to first unread message

Mike Jones!

unread,
Mar 12, 2012, 11:43:27 AM3/12/12
to mingw...@lists.sourceforge.net
Hello,

I'm trying to use VEH with g++ on Windows XP (x86). MinGW is properly
installed, and other programs compile fine, however I cannot use the
AddVectoredExceptionHandler API.

Here is a simple sample from Windows XP VM: http://pastebin.com/m8X8ySsW

The MSDN documentation says only windows.h is needed for inclusion.
What am I missing to be able to use the AddVectoredExceptionHandler
API?

Thanks

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
MinGW-users mailing list
MinGW...@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-use...@lists.sourceforge.net?subject=unsubscribe

Keith Marshall

unread,
Mar 12, 2012, 12:22:05 PM3/12/12
to MinGW Users List
On 12 March 2012 15:43, Mike Jones! wrote:
> What am I missing to be able to use the AddVectoredExceptionHandler
> API?

An appropriate definition of _WIN32_WINNT perhaps?

--
Regards,
Keith.

Mike Jones!

unread,
Mar 12, 2012, 12:28:05 PM3/12/12
to mingw...@lists.sourceforge.net
That was it. Needed to be before the include:

#define _WIN32_WINNT 0x502
#include <windows.h>

I also found a post on stackoverflow about re-declaring an API, so I
did it like this:

#ifdef __cplusplus
extern "C" {
#endif
WINBASEAPI PVOID WINAPI
AddVectoredExceptionHandler(ULONG,PVECTORED_EXCEPTION_HANDLER);
#ifdef __cplusplus
}
#endif

Though the only modification needed to get the code to compile was the
proper value for _WIN32_WINNT.

Greg Chicares

unread,
Mar 12, 2012, 12:33:38 PM3/12/12
to mingw...@lists.sourceforge.net
On 2012-03-12 15:43Z, Mike Jones! wrote:
>
> I'm trying to use VEH with g++ on Windows XP (x86). MinGW is properly
> installed, and other programs compile fine, however I cannot use the
> AddVectoredExceptionHandler API.

AFAIK, MinGW doesn't support ms-specific exception handling,
though I've heard that the people at
http://mingw-w64.sourceforge.net/
are working on it.

LRN

unread,
Mar 12, 2012, 12:55:14 PM3/12/12
to mingw...@lists.sourceforge.net
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12.03.2012 20:33, Greg Chicares wrote:
> On 2012-03-12 15:43Z, Mike Jones! wrote:
>>
>> I'm trying to use VEH with g++ on Windows XP (x86). MinGW is
>> properly installed, and other programs compile fine, however I
>> cannot use the AddVectoredExceptionHandler API.
>
> AFAIK, MinGW doesn't support ms-specific exception handling, though
> I've heard that the people at http://mingw-w64.sourceforge.net/ are
> working on it.
>

AddVectoredExceptionHandler() works for me (TM), with MinGW.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPXipvAAoJEOs4Jb6SI2Cw+fMH/AkFeqFUkh8FW7AGJzCsRbLx
94IRBAa/O/S+RkK2wb94aBtI/wp4wdU+Lph+wUhI1Lu4OlWpJfVf0GKxnWbEotzk
Q62/Jp5rJ+dibSrll1Ko3PkL/iTqlnKI7+lCFbIU0Cy+j6ig2jXLqk4VOPTSbAAg
k3mXxtKngGJOP60bcEoJ9bWYau0pogZpgSG5WP0YJzy+jklcSz+uiheCU+c+9ZOH
+1fNIsrzhBwBAuP5habeHobyVXV9jjw0FksHWsmJYCSk9GLmGtUQCjzU3AGbdGkr
roThqDKDmPbk9FdB7MeKHbghAXy0Q6wUiDVZbFeLPIYooXJvuUJXxV+ZvXMoowU=
=3USv
-----END PGP SIGNATURE-----

Reply all
Reply to author
Forward
0 new messages