Your code is the problem. Launch your program in your debugger and, when it crashes, look at the information available to work out where and why it crashes. If you still cannot work it out then start your own thread and actually provide some information about your program, where it is crashing, what you have tried to diagnose/fix it etc. We are not mind readers and need at least some information to go on.
Bookmarks