Jump to content
  • Advertisement
Sign in to follow this  
gpr1me

Weird Problem

This topic is 4471 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

I have used textures before and now i am using the same code from a previous project i worked on but this time the code is not working. I am trying to load a .bmp file with this function:
AUX_RGBImageRec* Map::LoadBMP(char *Filename)			
{
	FILE *File=NULL;		

	if (!Filename)				
		return NULL;	

	File=fopen(Filename,"r");	

	if(File)				
	{
		fclose(File);		
		return auxDIBImageLoad(Filename);
	}
	return NULL;				
}
Now in my previous project i have no problems. But now i copied this code over to my new project i get this error:
error C2664: 'auxDIBImageLoadW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
So when i cast the char* to a LPCWSTR i get linking errors. Im using visual studio .net 8. I have included glaux.h file and i can't seem to figure out what the difference is that makes it work in a one project and not in another project. If anyone had the same problem do you know what a solution might be?

Share this post


Link to post
Share on other sites
Advertisement
You're project is using Unicode. VS 8 defaults to Unicode by default but you can turn it off in Project->Properties->General and then change from Unicode to None in the character encoding. Alternatively, you could continue to use Unicode and use a function to like MultibyteToWideChar to change your char * into a Unicode string.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!