Assertion failure in loading

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Mar 2006
Posts: 112
Reputation: Covinus is an unknown quantity at this point 
Solved Threads: 0
Covinus's Avatar
Covinus Covinus is offline Offline
Junior Poster

Assertion failure in loading

 
0
  #1
May 30th, 2007
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

  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.
if you cant hit 2 birds with one stone try hitting just one or you will end up with nothing at all
Reply With Quote Quick reply to this message  
Join Date: Mar 2006
Posts: 112
Reputation: Covinus is an unknown quantity at this point 
Solved Threads: 0
Covinus's Avatar
Covinus Covinus is offline Offline
Junior Poster

Re: Assertion failure in loading

 
0
  #2
May 30th, 2007
my bad.. hehehe

i forgot to

fr=fopen;
if you cant hit 2 birds with one stone try hitting just one or you will end up with nothing at all
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC