944,183 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 1586
  • C++ RSS
May 30th, 2007
0

Assertion failure in loading

Expand Post »
can anyone explain about assertion failure. i cant seem ti fix my problem with this error. it comes out when i try to load a file.

here part of the code

c++ Syntax (Toggle Plain Text)
  1. BDLL fileHandle::load()
  2. {
  3. char fileN[MAX_PATH]="";
  4.  
  5. OPENFILENAME ofn;
  6. ZeroMemory(&ofn, sizeof(ofn));
  7. ofn.lStructSize = sizeof(ofn);
  8.  
  9. ofn.lpstrFilter = "Bitmap Files (*.bmp)\0*.bmp";
  10. ofn.lpstrFile = fileN;
  11. ofn.nMaxFile = MAX_PATH;
  12. ofn.Flags =OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
  13. ofn.lpstrDefExt = "bmp";
  14.  
  15. if(GetOpenFileName(&ofn))
  16. {
  17. FILE* fr=0;
  18. fopen(fileN, "rb");
  19. if(fr==NULL)
  20. {
  21. fclose(fr);
  22. }
  23. else
  24. {
  25.  
  26. fread(&bfih.bmfh, sizeof(BITMAPFILEHEADER), 1, fr);
  27. fread(&bfih.bmih, sizeof(BITMAPINFOHEADER), 1, fr);
  28. bfih.pix= new PIX[bfih.bmih.biSizeImage/3];
  29. fread(bfih.pix, bfih.bmih.biSizeImage, 1, fr );
  30. fclose(fr);
  31. }
  32.  
  33.  
  34. }
  35.  
  36.  
  37.  
  38.  
  39.  
  40. return bfih;
  41. };
Last edited by Covinus; May 30th, 2007 at 4:17 am.
Similar Threads
Reputation Points: 31
Solved Threads: 0
Junior Poster
Covinus is offline Offline
112 posts
since Mar 2006
May 30th, 2007
0

Re: Assertion failure in loading

my bad.. hehehe

i forgot to

fr=fopen;
Reputation Points: 31
Solved Threads: 0
Junior Poster
Covinus is offline Offline
112 posts
since Mar 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: C++ Double - 8th point decimals
Next Thread in C++ Forum Timeline: string to int conversion





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC