You have to debug this program to see where and why it crashes.
Besides, you didn't provide enough info about this projec tlike:
  • is it MFC?
  • is it MDI or SDI?
  • is the Doc/View architecture used?
  • what IDE are you using?
  • ...