Re: crash the application at calling API function as GetCursorInfo...
From: msnews.microsoft.com (john_kerry3_at_hotmail.com)
Date: 02/20/04
- Next message: Feng Yuan [MSFT]: "Re: printing transparent bitmaps"
- Previous message: Louis Solomon [SteelBytes]: "Re: crash the application at calling API function as GetCursorInfo..."
- In reply to: Louis Solomon [SteelBytes]: "Re: crash the application at calling API function as GetCursorInfo..."
- Next in thread: Christian Kaiser: "Re: crash the application at calling API function as GetCursorInfo..."
- Reply: Christian Kaiser: "Re: crash the application at calling API function as GetCursorInfo..."
- Reply: Louis Solomon [SteelBytes]: "Re: crash the application at calling API function as GetCursorInfo..."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 20 Feb 2004 09:06:39 +0100
I am not usage typedefing the CURSORINFO struct only illustration.
I am my project usage this define:
#define _WIN32_WINNT 0x500
#define WINVER 0x0500
But whether usage alignment. (eg#pragma pack(1)), this not solves this
problem.
"Louis Solomon [SteelBytes]" <louis@steelbytes.spam-is-bad.com> píše v
diskusním příspěvku news:eKYRD109DHA.1816@TK2MSFTNGP12.phx.gbl...
> why are you typedefing the CURSORINFO struct yourself ?
> alos, if you insist on doing this, you should force the byte alignment.
(eg
> #pragma pack(1)
> --
> Louis Solomon
> www.steelbytes.com
>
> "msnews.microsoft.com" <john_kerry3@hotmail.com> wrote in message
> news:%23wTMZWy9DHA.2404@TK2MSFTNGP12.phx.gbl...
> > Hi,
> > my application load API function GetCursorInfo on Windows NT 4.0 SP6 and
> > calling next this function.
> > At calling function GetCursorInfo in release mode aplication crash
without
> > only thing message.
> > At calling function GetCursorInfo in debug mode this error:
> >
> > Debug Error!
> > Program: E:\bin\KeyMouseControldebug.exe
> > Module:
> > File: i386\chkesp.c
> > Line: 42
> > The value of ESP was not properly saved across a function call. This is
> > usually a result of calling a function declared with one calling
> > convention
> > with a function pointer declared with a different calling convention.
> >
> > At calling function GetCursorInfo other Windows NT 5.0 or Windows 98 not
> > problem.
> > In what the problem, my code or Windows NT 4.0 SP6?
> > It is possible this somehow treatment?
> >
> > Thank you for answer.
> > john_kerry3@hotmail.com
> >
> > // The simple code for load and calling API function GetCursorInfo
> > typedef struct _CURSORINFO
> > {
> > DWORD cbSize;
> > DWORD flags;
> > HCURSOR hCursor;
> > POINT ptScreenPos;
> > } CURSORINFO, *PCURSORINFO, *LPCURSORINFO;
> >
> > typedef BOOL (WINAPI *GET_CURSOR_INFO)(PCURSORINFO);
> >
> > m_GetCursorInfo = NULL;
> > m_hUser32 = LoadLibrary("User32.dll");
> > if (m_hUser32)
> > {
> > m_GetCursorInfo =
> > (GET_CURSOR_INFO)GetProcAddress(m_hUser32,"GetCursorInfo");
> > if(m_GetCursorInfo)
> > {
> > try
> > {
> > CURSORINFO cur;
> > cur.cbSize = sizeof(CURSORINFO);
> > m_GetCursorInfo(&cur);
> > }
> > catch(...)
> > {
> > /*
> > Debug Error!
> >
> > Program: E:\bin\KeyMouseControldebug.exe
> > Module:
> > File: i386\chkesp.c
> > Line: 42
> >
> > The value of ESP was not properly saved across a function call. This is
> > usually a result of calling a function declared with one calling
> > convention
> > with a function pointer declared with a different calling convention.
> >
> > (Press Retry to debug the application)
> >
> > */
> > m_GetCursorInfo = NULL;
> > }
> > }
> > }
> >
> >
> >
>
>
- Next message: Feng Yuan [MSFT]: "Re: printing transparent bitmaps"
- Previous message: Louis Solomon [SteelBytes]: "Re: crash the application at calling API function as GetCursorInfo..."
- In reply to: Louis Solomon [SteelBytes]: "Re: crash the application at calling API function as GetCursorInfo..."
- Next in thread: Christian Kaiser: "Re: crash the application at calling API function as GetCursorInfo..."
- Reply: Christian Kaiser: "Re: crash the application at calling API function as GetCursorInfo..."
- Reply: Louis Solomon [SteelBytes]: "Re: crash the application at calling API function as GetCursorInfo..."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|