HI all, I have problem while compiling the following code which i copied from the below location. i downloaded the source code and opened in visual studio 2008 and compiled , it worked fine. but i tried creating my own project of Win32 console application type but i started getting the following error... Downloaded the code from the below link... http://www.codeproject.com/KB/system/Sund_WindowService.aspx I included following header files. Code: #pragma once #include <process.h> #include <iostream> #include <tchar.h> #include <stdio.h> #include <windows.h> #include <winbase.h> #include <winsvc.h> Code: error C2664: 'StartServiceW' : cannot convert parameter 3 from 'const char **' to 'LPCWSTR *' error C2664: 'OpenServiceW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR' error C2664: 'OpenServiceW' : cannot convert parameter 2 from 'char *' to 'LPCWSTR' error C2440: 'initializing' : cannot convert from 'CHAR [501]' to 'LPWSTR'
Re: errorC2664:'StartServiceW':cannot convert paramter from 'const char **' to 'LPCWS You're using a UNICODE build. You need wide strings (wchar_t) instead of multi-byte strings (or turn off UNICODE in your project).