I guess your problem is character encoding.
You convert a pointer to an ASCII string to a wstr:
WritePrivateProfileString((LPCWSTR)"Section", (LPCWSTR)"Key", "1", (LPCWSTR)"C:\Test.ini");
int result=GetPrivateProfileInt((LPCWSTR)"Section", (LPCWSTR)"Key", 0, (LPCWSTR)"C:\Test.ini");
So it won't understand where you want the file to be created because the bytes from "C:\Test.ini" interpreted as a wide char string are just garbage. For sure not an existing directory's name xD. In your case, you should have preceded all literals with L, like (L"Section", L"Key", L"1", L"C:\Test.ini"), then the casting wouldn't even be necessary.
But is better to always provide string literals enclosed in the _T() macro (which adds the L"" when compiling unicode). Include "<tchar.h>" to use this.
Also, never use LPCWSTR, LPCSTR, CHAR (= char), WCHAR explicitly when dealing whit text, but implicitly through LPCTSTR and TCHAR.
And since this is probably for le, switch your Character Set (project options) to Multi-Byte (= ASCII). This will make windows.h to define WritePrivateProfileString as WritePrivateProfileStringA instead of WritePrivateProfileStringW as it is now.
Your code should then look like this:
WritePrivateProfileString(_T("Section"), _T("Key"), "1", _T("C:\Test.ini"));
int result=GetPrivateProfileInt(_T("Section"), _T("Key"), 0, _T("C:\Test.ini"));
PS: Simply casting pointer types is usually a bad idea most of times when the compiler complains about wrong argument types.
This is a good read about character encoding with C/C++ and win api: http://msdn.microsoft.com/en-us/library/06b9yaeb.aspx