Article View: borland.public.cppbuilder.nativeapi
Article #862Cannot retrieve file date
From: Jos�
Date: Wed, 02 Jan 2008 19:51
Date: Wed, 02 Jan 2008 19:51
36 lines
1875 bytes
1875 bytes
What went wrong?
_FILETIME f1;
FILE*han1=fopen("J:\\Projects\\test1.h","r");
res=GetFileTime(han1, &f1,NULL,NULL);
The file exists, han1 is not zero and the file can be read. But
GetFileTime returns an error.
I tried to find what went wrong. The help file tells me to:
LPVOID lpMsgBuf;
But that causes a compilation error, ("cannot convert void * to const
char *) so I declared:
char* lpMsgBuf;
and it goes on:
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf, 0, NULL);
MessageBox( NULL, lpMsgBuf, "GetLastError", MB_OK|MB_ICONINFORMATION);
LocalFree( lpMsgBuf );
The error message is "De ingang is ongeldig". If I set the language to
English, no message is returned. Translated into English, it would be
"The entry is invalid".
Well, that's good to know: the entry is invalid! But what is the
entry? And why is it invalid?
--
Jos�
Technical Details
Message-ID:
<hfonn3l8o175ht0j11i9d4q5msanpr6apt@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,4011bf1b28cc5925,start X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII From: Jos� <jose@127.0.0.1> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Cannot retrieve file date Date: Wed, 02 Jan 2008 20:51:25 +0100 Message-ID: <hfonn3l8o175ht0j11i9d4q5msanpr6apt@4ax.com> X-Newsreader: Forte Agent 4.2/32.1117 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 82.75.73.146 X-Trace: newsgroups.borland.com 1199303558 82.75.73.146 (2 Jan 2008 11:52:38 -0700) Lines: 36 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail