Access Violation when open a dialog /

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Pellaeon
Experienced Solver
Experienced Solver
Posts: 56
Joined: Fri Mar 16, 2012 12:32 pm

Re: Access Violation when open a dialog /

Post by Pellaeon »

I copied to code from you into my example app, same behavior.

It crashes before the dialog is shown.
Attachments
error.jpg
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Access Violation when open a dialog /

Post by doublemax »

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.
Use the source, Luke!
Pellaeon
Experienced Solver
Experienced Solver
Posts: 56
Joined: Fri Mar 16, 2012 12:32 pm

Re: Access Violation when open a dialog /

Post by Pellaeon »

I stepped through and foudn nothing unexpected. Attach is a screen.
Attachments
screen.jpg
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Access Violation when open a dialog /

Post by doublemax »

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
Use the source, Luke!
Pellaeon
Experienced Solver
Experienced Solver
Posts: 56
Joined: Fri Mar 16, 2012 12:32 pm

Re: Access Violation when open a dialog /

Post by Pellaeon »

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.
Attachments
screen.jpg
User avatar
doublemax
Moderator
Moderator
Posts: 19116
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Access Violation when open a dialog /

Post by doublemax »

Yes, everything looks fine indeed. But i have no idea where else to look or how to proceed from here.
Use the source, Luke!
Pellaeon
Experienced Solver
Experienced Solver
Posts: 56
Joined: Fri Mar 16, 2012 12:32 pm

Re: Access Violation when open a dialog /

Post by Pellaeon »

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!
Post Reply