Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Atm97fin

Profiling error

This topic is 5330 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I try to profile my program I get Invalid handle error from windows ReadFile function. Creating the file succeeds. I try to open the file from my bitmap handling object. Excluding the object won't help. Here's the code:
        int red = 0;
        HANLDE file = NULL;
	file = CreateFile(filename,FILE_ALL_ACCESS,0,NULL,OPEN_EXISTING,
		FILE_ATTRIBUTE_NORMAL,		NULL);

	if (file == NULL)
	{
		ErrorBox(NULL,"cant create file");
		return FAILURE;
	}
	
	ReadFile(file,&bmfh,sizeof(BITMAPFILEHEADER),&red,NULL);
	if (bmfh.bfType != 19778)	// not a bitmap

	{	
                ShowError();
		ErrorBox(NULL,"not a bitmap");
		CloseHandle(file);
		return FAILURE;
	}
Should I change the CreateFile parameters or what? [edited by - Atm97fin on December 14, 2003 10:30:51 AM] [edited by - Atm97fin on December 14, 2003 10:31:58 AM]

Share this post


Link to post
Share on other sites
Advertisement
It seems that the CreateFile function doesn''t accept my filenames. Ex: "directory\\file.bmp"

What could be the reason for this. They work fine when i''m not profiling.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Possibly the profiler causes it to run from a different path? ie if you''ve got relative paths to your resources they might not be valid

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!