I copied to code from you into my example app, same behavior.
It crashes before the dialog is shown.
Access Violation when open a dialog /
Re: Access Violation when open a dialog /
What's the value of taskDialogIndirect at the time of the crash?
Can you set a breakpoint before if( HasNativeTaskDialog() ) and trace into that function? This will lead to wxMSWMessageDialog::GetTaskDialogIndirectFunc() which retrieves a function pointer (the value of taskDialogIndirect) from comctl32.dll. This should be a 64bit pointer, but i suspect that it's a 32bit pointer or it gets cut off to a 32bit pointer. Which would indicate some kind of 32 / 64 bit mismatch, although i have no idea how that could happen.
Can you set a breakpoint before if( HasNativeTaskDialog() ) and trace into that function? This will lead to wxMSWMessageDialog::GetTaskDialogIndirectFunc() which retrieves a function pointer (the value of taskDialogIndirect) from comctl32.dll. This should be a 64bit pointer, but i suspect that it's a 32bit pointer or it gets cut off to a 32bit pointer. Which would indicate some kind of 32 / 64 bit mismatch, although i have no idea how that could happen.
Use the source, Luke!
Re: Access Violation when open a dialog /
I stepped through and foudn nothing unexpected. Attach is a screen.
Re: Access Violation when open a dialog /
Ok.
This leaves only the content of "tdc" as a potential cause for the crash. Step a little further into the code until "tdc" is initialized, then check its fields, especially for pointers that look wrong. And it should be 160 bytes long.
https://msdn.microsoft.com/de-de/librar ... 85%29.aspx
This leaves only the content of "tdc" as a potential cause for the crash. Step a little further into the code until "tdc" is initialized, then check its fields, especially for pointers that look wrong. And it should be 160 bytes long.
https://msdn.microsoft.com/de-de/librar ... 85%29.aspx
Use the source, Luke!
Re: Access Violation when open a dialog /
The length of the structure is fine, No problem there.
I am not really familiar with native WinAPI because normally I use libraries like wxWidgets, but for me the tdc looks ok. I added a screenshot.
I did not find any address in the structure which is near to the access violation.
I thing the problem is somewhere else and is "only" showing in this function. But atm I really have no idea what's the problem.
I am not really familiar with native WinAPI because normally I use libraries like wxWidgets, but for me the tdc looks ok. I added a screenshot.
I did not find any address in the structure which is near to the access violation.
I thing the problem is somewhere else and is "only" showing in this function. But atm I really have no idea what's the problem.
Re: Access Violation when open a dialog /
Yes, everything looks fine indeed. But i have no idea where else to look or how to proceed from here.
Use the source, Luke!
Re: Access Violation when open a dialog /
A colleague of mine also compiled the test project with the Community Edition and tehre it works.
Now, I also figured out that when I start my application outside of VS from the Windows explorer the program doesn't crash.
Perhaps it is really a VS bug. I posted it in the VS community.
Thank you very much for your help, doublemax!
Now, I also figured out that when I start my application outside of VS from the Windows explorer the program doesn't crash.
Perhaps it is really a VS bug. I posted it in the VS community.
Thank you very much for your help, doublemax!