Sign in to follow this  
Sw00sh

auxDIBImageLoad Problem

Recommended Posts

Hi Guys, I'm out of my mind. I downloaded the NeHe Lesson 6 from Links. This works fine. Now i try to copy same functions into my c++ workspace (include the requested headers). Afer that i get an error: Could't convert from char* to LPCWSTR. I have no idea why i get this error. Here you can find the codesnippet:
	AUX_RGBImageRec *LoadBMP(char *Filename){				// Loads A Bitmap Image
		FILE *File=NULL;									// File Handle
		if (!Filename)										// Make Sure A Filename Was Given
			return NULL;									// If Not Return NULL

		File=fopen(Filename,"r");							// Check To See If The File Exists
		if (File){											// Does The File Exist?
			fclose(File);									// Close The Handle
			return auxDIBImageLoad(Filename);				// Load The Bitmap And Return A Pointer
		}
		return NULL;										// If Load Failed Return NULL
	}

The problem is on this line: return auxDIBImageLoad(Filename); Can anybody help me??

Share this post


Link to post
Share on other sites
I think thats because of the Unicode character set used in the VS. LPCWSTR is a pointer to a constant null-terminated string of 16-bit Unicode characters. You need to switch to Multibyte char set. You can do this in Configuration Properties tab in the Project Settings dialog (Configuration Properties->General->Character Set-> Use Multi byte char set)

Share this post


Link to post
Share on other sites

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