Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot convert parameter 1 from 'char' to 'LPCWSTR'

I keep getting this error: cannot convert parameter 1 from 'char' to 'LPCWSTR'

int main(int argc, char argv[])     {     // open port for I/O    HANDLE h = CreateFile(argv[1],GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);     if(h == INVALID_HANDLE_VALUE) {        PrintError("E012_Failed to open port"); 

can someone help?

like image 277
sebastian Avatar asked Oct 13 '10 14:10

sebastian


1 Answers

Go to the Properties for your Project and under Configuration Properties/General, change the Character Set to "Not Set". This way, the compiler will not assume that you want Unicode characters, which are selected by default:

alt text

like image 115
Michael Goldshteyn Avatar answered Sep 29 '22 23:09

Michael Goldshteyn