FileDateToFileTime() Broken??

{code}
#include <vcl.h>
#include <System.SysUtils.hpp>
#pragma hdrstop

#include "Unit2.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
	: TForm(Owner)
{
	TDateTime tdTEST;
	TSearchRec sr;

	FindFirst( Application->ExeName, 0xFFFF, sr );
	tdTEST = FileDateToDateTime( sr.Time );
}
{code}
---------------------------------------
The above is the WHOLE program...
When I run the above,
tdTEST is found to be '????'
I am using XE8 
---------------------------------------
TNX Claude
0
Wayne
8/18/2015 1:01:01 AM
embarcadero.cppbuilder.using 1848 articles. 1 followers. Follow

1 Replies
769 Views

Similar Articles

[PageSpeed] 52
Get it on Google Play
Get it on Apple App Store

Wayne wrote:

> FindFirst( Application->ExeName, 0xFFFF, sr );
> tdTEST = FileDateToDateTime( sr.Time );

You are not checking to make sure FindFirst() succeeds before calling FileDateToDateTime():

{code}
if (FindFirst( Application->ExeName, faAnyFile, sr ) == 0)
{
    tdTEST = FileDateToDateTime( sr.Time );
    FindClose(sr);
}
{code}

Besides, the TSearchRec.Time field is deprecated anyway, you should be using 
the TSearchRec::TimeStamp property instead:

{code}
tdTEST = sr.TimeStamp;
{code}

-- 
Remy Lebeau (TeamB)
0
Remy
8/18/2015 1:01:01 AM
Reply:

Similar Artilces:

Broken, Broken, Broken
Name: Randy Jones Email: rjonesatisfladotcom Product: Firefox Summary: Broken, Broken, Broken Comments: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 1)Cannot sort by name my bookmarks; 2) When trying to "fly down" to a bookmark, the menus reqularily close and I have to start over; 3) What happened to address history at the right end of the address bar. You have obviously made this browser "pretty" but it is broken, broken, broken. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9....

Using Using
I have just completed reading a chapter in my book on performance. The books says to speed up performance on your web site you should use the using statement when opening connections. My question is how do you catch errors if you are using this as apposed to a try catch block.thanksBryan  Why would you use it as an alternative to a try/catch statement. Couldn't you just do something like  public void UsingSomeMethod() { try { SomeMethod(); } catch(SomeException e) { /// do something useful }}public void SomeMethod() { using (Something) { ...

When to use ( and when to use ((?
I'm just not getting it. When do you use ( in a statement, when do you need to use ((, and is the space after either or both mandatory? For example, I coded this statement: if (( $_ eq $bad_guys_ip )) { more_stuff_here }; Why the two (( in an if? And why does it seem to not work when I miss the space after the ((? Thanx! Mark me as... /Corn-fused|Dense/ > I'm just not getting it. >=20 > When do you use ( in a statement, when do you need to use ((, and is > the space after either or both mandatory? >=20 > For example, I coded this sta...

How to use the arguments to use() in the package being used
Howdy,=20 The subject says it all believe it or not :) What I'm trying to figure out is how to pass an argument=20 (pragma I believe is the proper term) to use() and do=20 sonethign in the package based on it. I've looked at CGI.pm source but can't seem to track it down.=20 (Similar idea as to CGIs -oldstyle_urls -newstyel_urls) http://search.cpan.org/~lds/CGI.pm-3.04/CGI.pm#PRAGMAS What I'd like to do is something like this: # for old time's sake we'll just use our favorite module use Foo::Monkey qw(:Foo :Bar -doamazingthings); #then in Foo::Monkey...

superreview granted: [Bug 231303] Unable to use use IMAP on in.virgilio.it because of broken CRAM-MD5 on server : [Attachment 139316] proposed fix
Seth Spitzer <sspitzer@mozilla.org> has granted Seth Spitzer <sspitzer@mozilla.org>'s request for superreview: Bug 231303: Unable to use use IMAP on in.virgilio.it because of broken CRAM-MD5 on server http://bugzilla.mozilla.org/show_bug.cgi?id=231303 Attachment 139316: proposed fix http://bugzilla.mozilla.org/attachment.cgi?id=139316&action=edit ...

superreview cancelled: [Bug 231303] Unable to use use IMAP on in.virgilio.it because of broken CRAM-MD5 on server : [Attachment 139337] Alternative patch
David Bienvenu <bienvenu@nventure.com> has cancelled Lorenzo Colitti <lorenzo@colitti.com>'s request for superreview: Bug 231303: Unable to use use IMAP on in.virgilio.it because of broken CRAM-MD5 on server http://bugzilla.mozilla.org/show_bug.cgi?id=231303 Attachment 139337: Alternative patch http://bugzilla.mozilla.org/attachment.cgi?id=139337&action=edit ------- Additional Comments from David Bienvenu <bienvenu@nventure.com> clearing request ...

superreview requested: [Bug 231303] Unable to use use IMAP on in.virgilio.it because of broken CRAM-MD5 on server : [Attachment 139337] Alternative patch
Lorenzo Colitti <lorenzo@colitti.com> has asked Seth Spitzer <sspitzer@mozilla.org> for superreview: Bug 231303: Unable to use use IMAP on in.virgilio.it because of broken CRAM-MD5 on server http://bugzilla.mozilla.org/show_bug.cgi?id=231303 Attachment 139337: Alternative patch http://bugzilla.mozilla.org/attachment.cgi?id=139337&action=edit ------- Additional Comments from Lorenzo Colitti <lorenzo@colitti.com> Oh, sorry. I thought attachment 139316 (the first patch in this bug, which disables PLAIN and LOGIN) was already checked in (as per Seth's comme...

Broken image when displaying images from DB loaded using asp.net:FileUpload control
I have an asp.net web app that I want to use to save images into my database and then displaying them using a webhandler where needed. Everything works fine, no errors but I get a broken image sign on display.For testing purposes, I created a WinForms app that loads the same file into the database using as much of the same code as I have in my web app. My web app displays the images loaded from the winforms application properly. I'm pretty sure that the code to write to database and display the picture are not problematic but I will post parts of them at the end FYI. After lots of resea...

why to use 1)use CGI,2)use Strict ,3)use Carp in script
hi why we r using 1)use CGI, 2)use Strict, 3)use Carp in the begining of script sometimes. What is the use of it.Is the files CGI.pm,Strict.pm,Carp.pm default with PERL. Thnx __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com On Thu, 2004-11-04 at 09:31, supriya devburman wrote: > hi Hi > why we r using > 1)use CGI, We only use CGI when we want to use methods from that module (usually on web pages); see `perldoc CGI` for more information on what you...

Why using use strict;
Hi all, I know why I should use "use strict;" but what happen if I use "use strict;" then if the code is OK, I delete this line? Shouldn't it work the same without this line if the code has no problems? Thanks. Teddy, orasnita@home.ro why would you want to do that Octavian? "use strict" is a sanity safety net. What your saying is like "I know why I should use safety belt whilst driving my car but what if I took it off?" - of course you can do it but beware of the consequences. joel -----Original Message----- From: ...

Broken Links when using MasterPage
I am Using Master Page in my Project. I have 6 links in the masterpage to my link pages. In the Link Pages, its shows 'Broken Link' when I user Site Analyser for SEO purpose. When I am taking AboutUs.aspx Page, It shows Hyper Link for 'About Us' in the MasterPage  is a broken link as well as when I am taking Profile.aspx Page, It shows Hyper Link for 'Profile' in the MasterPage is a broken link. How Can  manage  it ?   Create serverside links, and start all the links with ~ , which means the root of the web application. Th...

this keyword- to use or not to use???
While reading some articles I came across this sample code which uses the "this" keyword. Is this best practice?         this.sqldsCustomerDetails.SelectParameters.Clear();        this.sqldsCustomerDetails.SelectParameters.Add("customerid", Convert.ToString(this.gvCustomers.DataKeys[row.RowIndex].Value));        this.dvCustomerDetail.DataSource = this.sqldsCustomerDetails;        this.dvCustomerDetail.DataBind(); In my code I usual...

To use or not to use Delphi
Sadly, it seems to me that there is a sort of race between the two threads, for and against using Delphi in new projects, with more or less the same users posting in both threads. Arguments are fiercely debated in both camps. Borland had their own vision. As a community, now that Delphi has changed ownership I believe we should try to be more consistent, more clear, and more articulate in what we expect from Embercadero in terms of Delphi. We can contribute to keeping Delphi alive and moving in the right direction. "Laurent Cocea" schrieb: > Sadly, it seems to me that there ...

Terms of Use is a broken link
My website has a problem: when you click on the terms of use, it won't work. Sometimes, if you copy it into the address bar, it will give me a 404: Page not found error. Is there anyway to make the Terms of use Page visible or make a new Terms of Use? Please post the URL, that is associated with the link and the error message.Of cause, you can use any page, place a text/html module on it and paste the code from the resource.Sebastian Leupoldgamma concept mbHDeutschNetNuke = DotNetNuke in GermanDNN Project UserDefinedTable...

Web resources about - FileDateToFileTime() Broken?? - embarcadero.cppbuilder.using

Resources last updated: 12/24/2015 5:51:09 AM