• Advertisement
Sign in to follow this  

auxDIBImageLoad Problem

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

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
Advertisement
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
Sign in to follow this  

  • Advertisement