delphi-2010

Secure way to store password in Windows

家住魔仙堡 提交于 2019-11-28 18:55:47
I'm trying to protect a local database that contains sensitive info (similar to this question , only for delphi 2010 ) I'm using DISQLite component , which does support AES encryption, but I still need to protect this password I use to decrypt & read the database. My initial idea was to generate a random password, store it using something like DPAPI ( CryptProtectData and CryptUnprotectData functions found in Crypt32.dll), but I couldn't find any example on that for Delphi My question is: how can I safely store a randomly generated password? Or, assuming the DPAPI road is secure, how can I

Which language elements can be annotated using attributes language feature of Delphi?

江枫思渺然 提交于 2019-11-28 18:54:15
问题 Delphi 2010 introduced custom attributes which can be added to type declarations and methods. For which language elements can a custom attribute be used? The examples which I have found so far include class declarations, fields and methods. (And AFAIK generic classes do not support custom attributes). Some examples are shown in this article. It looks like variables (external to any class declaration) also can have attributes. Based on this article, attributes can be used for class and record

What is TMonitor in Delphi System unit good for?

爷,独闯天下 提交于 2019-11-28 18:51:32
问题 After reading the articles "Simmering Unicode, bring DPL to a boil" and "Simmering Unicode, bring DPL to a boil (Part 2)" of "The Oracle at Delphi" (Allen Bauer), Oracle is all I understand :) The article mentions Delphi Parallel Library (DPL), lock free data structures, mutual exclusion locks and condition variables (this Wikipedia article forwards to 'Monitor (synchronization)', and then introduces the new TMonitor record type for thread synchronization and describes some of its methods.

How to “automatically” remove unused units from uses clause?

瘦欲@ 提交于 2019-11-28 17:55:06
问题 Does anyone know about a utility, that can automatically detect and remove unrequired units from the uses clause? Preferably it .. can be run against a unit and/or a project is free and works with Delphi 2010 Thanks in advance. 回答1: Try using the "Uses Unit Cleaner" Wizard from CnPack you can download from here Another option is use ICARUS. ICARUS is a small subset of Pascal Analyzer. It parses Delphi or Borland Pascal source code and generates a list of unneeded unit references in your uses

How do I work around Delphi's inability to accurately handle datetime manipulations?

人走茶凉 提交于 2019-11-28 10:59:38
I am new to Delphi (been programming in it for about 6 months now). So far, it's been an extremely frustrating experience, most of it coming from how bad Delphi is at handling dates and times. Maybe I think it's bad because I don't know how to use TDate and TTime properly, I don't know. Here is what is happening on me right now : // This shows 570, as expected ShowMessage(IntToStr(MinutesBetween(StrToTime('8:00'), StrToTime('17:30')))); // Here I would expect 630, but instead 629 is displayed. WTF!? ShowMessage(IntToStr(MinutesBetween(StrToTime('7:00'), StrToTime('17:30')))); That's not the

Getting size of a file in Delphi 2010 or later?

笑着哭i 提交于 2019-11-28 10:41:58
Delphi 2010 has a nice set of new file access functions in IOUtils.pas (I especially like the UTC versions of the date-related functions). What I miss so far is something like TFile.GetSize (const Path : String) What is the Delphi 2010-way to get the size of a file? Do I have to go back and use FindFirst to access TSearchRec.FindData ? Thanks. Deltics I'm not sure if there's a "Delphi 2010" way, but there is a Windows way that doesn't involve FindFirst and all that jazz . I threw together this Delphi conversion of that routine (and in the process modified it to handle > 4GB size files, should

How to install a component from .pas file in delphi?

[亡魂溺海] 提交于 2019-11-28 10:29:53
i've downloaded the RealTimeMarquee component for embarcadereo delphi 2010 which comes as a two files RealTimeMarquee.pas SimpleHTML.pas But when i tried to open the file using delphi to compile it, i can't see the green button ( compile / build ) activated. My question: How to install this component. thankyou PresleyDias My question: How to install this component. To install follow the steps below (same steps as Remy Lebeau-answer ) Step #1 . make a new package - Step #2 . Select New package Step #3 . Add the source files RealTimeMarquee.pas,SimpleHTML.pas Step #4 . Step #5 . A) Compile and

Using HIDController on Delphi 2010

别等时光非礼了梦想. 提交于 2019-11-28 09:37:47
问题 I have an application that uses HID Controller on delphi 7 but now I need to use it on Delphi 2010(license problems) but I've found some compatibility problems of this HIDController in this delphi 2010. This library is part of Project JEDI. I notice some questions from people using this library(JvHidDeviceController component) with Delphi 2010 and Win7. Maybe someone who faced the same problem could help me. I now its possible I just can't figure how. 回答1: This is working code for D2010: Use

Delphi 2010 RTTI - RttiContext.FindType

荒凉一梦 提交于 2019-11-28 09:29:08
问题 With RttiContext.FindType('Classes.TStringList') I get RttiType of TStringList with no problem. But with RttiContext.FindType('MyUnit.TMyClass') I always get nil (of course MyUnit is in uses clause). Why, what is wrong? Example: unit MyUnit; interface uses Classes; type TMyClass = class(TStringList) end; implementation end. Main unit: ... uses MyUnit, ... var oCont: TRttiContext; oType: TRttiType; begin oCont := TRttiContext.Create; try oType := oCont.FindType('MyUnit.TMyClass'); <== oType =

Delphi 64-bit Preview Compiler available?

淺唱寂寞╮ 提交于 2019-11-28 09:18:44
问题 is there a 64-bit preview compiler available, as announced a long time ago? I wasn't able to find anything. I really need a 64-bit compiler to target the 64-bit versions of Microsoft Office. 回答1: Not yet. According to the latest roadmap Delphi X and Chromium seem to be the current priorities, followed by Commodore, so I'm not sure when a 64 bit preview compiler will be available. If you want an early peek at these things, it might be worth signing up for the betas. 回答2: You could try FPC: