Skip to main content
gamedev.net
🔒 Locked

Weird Problem

Started by gpr1me 1 reply 3.3k views
Original Post
gpr1me
gpr1me
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?
Colin Jeanne
Colin Jeanne
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.
gpr1me
gpr1me
Wow, such a headache for that. Thanks alot for your help!

i need to pass out now :S

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.