954,487 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Assertion failure in loading

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

BDLL fileHandle::load()
{	
	char fileN[MAX_PATH]="";
	
		OPENFILENAME ofn;
		ZeroMemory(&ofn, sizeof(ofn));
		ofn.lStructSize = sizeof(ofn); 
		
	   	ofn.lpstrFilter = "Bitmap Files (*.bmp)\0*.bmp";
		ofn.lpstrFile = fileN;
		ofn.nMaxFile = MAX_PATH;
		ofn.Flags =OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
		ofn.lpstrDefExt = "bmp";
		
		if(GetOpenFileName(&ofn))
		{
			FILE* fr=0;
			fopen(fileN, "rb");
			if(fr==NULL)
			{
					fclose(fr);
			}
			else
			{

				fread(&bfih.bmfh, sizeof(BITMAPFILEHEADER), 1, fr);
				fread(&bfih.bmih, sizeof(BITMAPINFOHEADER), 1, fr);
				bfih.pix= new PIX[bfih.bmih.biSizeImage/3];
				fread(bfih.pix, bfih.bmih.biSizeImage, 1, fr );
					fclose(fr);
			}
		
		
		}			
						
					
	
	

   return bfih;
};
Covinus
Junior Poster
112 posts since Mar 2006
Reputation Points: 31
Solved Threads: 0
 

my bad.. hehehe

i forgot to

fr=fopen;

Covinus
Junior Poster
112 posts since Mar 2006
Reputation Points: 31
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You