Sign in to follow this  

Weird Problem

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

This topic is 4280 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this