The Darkside

Shedding light on things and stuff

 
  Home :: Contact :: Syndication  :: Login
  75 Posts :: 0 Stories :: 49 Comments :: 2 Trackbacks

Ads

Archives

Post Categories

Open Source Projects

Other Blogs

If you find you’re getting compile errors something along the lines of

error C2664: 'CreateFileW' : cannot convert parameter 1 from 'char [261]' to 'LPCWSTR'

or

error C2664: 'CreateProcessW' : cannot convert parameter 2 from 'char *' to 'LPWSTR'

I got plenty of these when compiling code which I C&P’d, which was working perfectly in one project, to a new project I had just created; All the errors were related to converting char/char arrays to LPWSTR. There are plenty of programmatic ways of converting this data, and keep in mind you may still want to check these out, rather than my “simple” fix, which is change the “Character Set” property in the project configuration settings to “Multi-Byte”

 

image

posted on Monday, November 16, 2009 2:19 PM
Comments have been closed on this topic.