One of the module in our application is crashing. When debugged the application, it was found that the WinAfxApp is returning NULL and this pointer is used causing the Access violation and crash.
The Application allows the user to acquires some images (screen shot) and also print the acquired images.
The user has acquired and image and then gave print command. if he does this several times very fast, the application crashed. On debugging this scenario, it was found that the AfxWinApp is returning NULL and is causing the problem.
Some findings from my debugging:
The crashes happens when the application is being acquired.
The print command creates one exe for each print that is passed to the printer. So when it crashes, there are many .exe's pending for printing (visible in process tab of task manager).
The crash happens consistently, but not consistent on the number of times it gets Acquired and printed. It crashes at the n-th time of the acquire print scenario.
I need help in understanding this AfxWinApp function and when it returns NULL.
Why did this return NULL all of a sudden when it worked fine for so many acquire print.
Please help me. its Urgent.
Thanks in Advance