I am currently working on a source port for a game, and for some damn reason, PeekMessage is causing an exception when debugging. I have looked high and low across StackOverflow and here on GameDev.net and haven't found anything useful for my scenario.
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) && !quitFlag)
{
switch(msg.message)
{
case WM_QUIT:
quitFlag = 1;
break;
}
if (!TranslateAccelerator(hwndApp,hAccelApp,&msg))
{
TranslateMessage(&msg); // Does some very necessary stuff
DispatchMessage(&msg); // Does some very necessary stuff
}
}
But the odd thing is, if I hit “continue” twice in Visual Studio, the program continues on as if nothing happened, and works fine.
The exception details:
Exception thrown at 0x759D98B2 in tfury.exe: Microsoft C++ exception: wil::ResultException at memory location 0x01FCDDFC.
The stack is as follows:
[External Code]
msvcrt.dll!__CxxThrowException@8() Unknown
msctf.dll!wil::details::ThrowResultExceptionInternal(struct wil::FailureInfo const &) Unknown
msctf.dll!wil::ThrowResultException(struct wil::FailureInfo const &) Unknown
msctf.dll!wil::details::ReportFailure_NoReturn<0>(void *,unsigned int,char const *,char const *,char const *,void *,struct wil::details::ResultStatus const &,unsigned short const *,enum wil::details::ReportFailureOptions) Unknown
msctf.dll!wil::details::ReportFailure_Base<0,0>(void *,unsigned int,char const *,char const *,char const *,void *,struct wil::details::ResultStatus const &,unsigned short const *,enum wil::details::ReportFailureOptions) Unknown
msctf.dll!wil::details::ReportFailure_Hr<0>(void *,unsigned int,char const *,char const *,char const *,void *,long) Unknown
msctf.dll!wil::details::in1diag3::_Throw_Hr(void *,unsigned int,char const *,long) Unknown
msctf.dll!wil::GetActivationFactory<struct Windows::Internal::ApplicationTargetedFeatureDatabase::IApplicationTargetedFeatureConfigStatics>(unsigned short const *) Unknown
msctf.dll!ShellHandwriting::HandwritingClient::Initialize(long) Unknown
msctf.dll!SYSTHREAD::OnShellHandwriting(unsigned int,long) Unknown
msctf.dll!_GetMsgHook(struct SYSTHREAD *,unsigned int,long) Unknown
msctf.dll!_TF_Notify@12() Unknown
user32.dll!CtfHookProcWorker(int,unsigned int,long,unsigned long) Unknown
user32.dll!CallHookWithSEH() Unknown
user32.dll!__fnHkINLPMSG() Unknown
ntdll.dll!_KiUserCallbackDispatcher@12() Unknown
user32.dll!_PeekMessageA@20() Unknown
> tfury.exe!messageCheck(...) Line 237 C
tfury.exe!idleCheck(...) Line 289 C
tfury.exe!toggle(...) Line 876 C
tfury.exe!fadeInScreen(char * name, char * palfile, int time) Line 1521 C
tfury.exe!showTRILogo(...) Line 1247 C
tfury.exe!intro(...) Line 922 C
tfury.exe!mainProgram(...) Line 417 C
tfury.exe!WinMain(HINSTANCE__ * hInst, HINSTANCE__ * hPrev, char * szCmdLine, int sw) Line 822 C
[External Code]