windows 定义 LPCTSTR 的问题
/* 注释那一行 *//* LPCTSTR ___file__name="D:\\test.txt"; //直接赋值就行
LPCTSTR ___file__name;
___file__name="D:\\test.txt"; //分开赋值不行->为什么? */
#include <stdio.h>
#include <windows.h>
int main(void)
{
int result;
DWORD ___res,___d__1,___d__2,___d__3,___d__4;
HANDLE ___handle;
FILETIME ___filetime;
LPCTSTR ___file__name="D:\\test.txt"; //这一行
___res=GetCurrentProcessId();
printf("%d\n",___res);
___res=GetCurrentThreadId();
printf("%d\n",___res);
___d__1=GENERIC_ALL;
___d__2=0;
___d__3=OPEN_EXISTING;
___d__4=FILE_ATTRIBUTE_NORMAL;
___handle=CreateFile(___file__name,___d__1,___d__2,NULL,___d__3,___d__4,NULL);
printf("%d\n",___handle);
GetFileTime(___handle,&___filetime,NULL,NULL);
printf("%d\n",___filetime.dwHighDateTime);
printf("%s\n","以上是highdatetime");
printf("%d\n",___filetime.dwLowDateTime);
printf("%s\n","以上是lowdatetime");
getchar();
return 0;
}
[ 本帖最后由 wabc1314 于 2009-8-9 18:32 编辑 ]