#include <iostream>
#include <string>
#include "stdlib.h"
#include "direct.h"
#include "io.h"
#include "stdio.h"
#include "wchar.h"
#include <Windows.h>
#include <atlstr.h>
#include <fstream>
#pragma warning(disable:4996)
using namespace std;
int main() {
long length = 0;
TCHAR* buffer = NULL;
CString s_path = _T("D:\\VerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpath\\VerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongpathVerylongp t.txt");
//LPWSTR lpwszFileName = (wchar_t*)s_path.c_str();
// First obtain the size needed by passing NULL and 0.
length = GetShortPathName(s_path, NULL, 0);
if (length == 0)
cout << "ERROR! GetShortPathName: " << length << endl;
buffer =