delphi-2007

How to get the millisecond value from a Timestamp field in firebird with Delphi 2007

∥☆過路亽.° 提交于 2019-12-22 06:09:22
问题 I have a Firebird database (running on server version 2.1.3) and am connecting to it with Delphi 2007 using the DBExpress objects (using the Interbase driver) One of my tables in the database looks something like this CREATE TABLE MYTABLE ( MYDATE Timestamp NOT NULL, MYINDEX Integer NOT NULL, ... Snip ... PRIMARY KEY (MYDATE ,MYINDEX) ); I can add to the table OK, and in Flame Robin it shows the timestamp field as having a millisecond value. But when I do a select all ( select * from MYTABLE

Delphi upgrade from RAD Studio to Delphi XE

心不动则不痛 提交于 2019-12-22 05:36:10
问题 We are thinking of upgrading from Rad Studio 2007 to Delphi XE and need to convince the boss that the cost is justified. I would appreciate comments that could help me answer the question: "What does Delphi XE bring to the table that makes it worth while to upgrade?" Regards, Pieter 回答1: Check this white paper from Andreano Lanusse. Reasons to Migrate to Delphi XE – What you might have missed since Delphi 7 Inside of this document you can find a resume with the new features since delphi 7 or

WrapText for WideString in Delphi

拟墨画扇 提交于 2019-12-22 05:01:03
问题 Delphi has a WrapText function: function WrapText(const Line, BreakStr: string; const BreakChars: TSysCharSet; MaxCol: Integer): string; function WrapText(const Line: string; MaxCol: Integer): string; Now i need a version that handles WideStrings: function WrapTextW(const Line: WideString; MaxCol: Integer): WideString; Is any such function written somewhere already? WARNING: Not every wide string character is 2-bytes Which is why i'm afraid to write it Update : Example of a character that

Converting LogFont height to Font size in points

亡梦爱人 提交于 2019-12-21 17:24:07
问题 I have a LOGFONT structure. Now all i'd like to do is get the associated font size in points from the LOGFONT height. 回答1: When the mapping mode is mm_Text (which it usually is), and when the lfHeight field is positive, it already gives the height in points. When it's negative, the units are pixels. MSDN for LogFont gives you the formula to convert between them: lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72); There are 72 points per inch. GetDeviceCaps tells you the number

Best way to find if a string is in a list (without generics)

送分小仙女□ 提交于 2019-12-20 09:29:30
问题 I want do something like this: Result = 'MyString' in [string1, string2, string3, string4]; This can't be used with strings and I don't want to do something like this: Result = (('MyString' = string1) or ('MyString' = string2)); Also I think that creating a StringList to do just this is too complex. Is there some other way to achieve this? Thanks. 回答1: You could use AnsiIndexText(const AnsiString AText, const array of string AValues):integer or MatchStr(const AText: string; const AValues:

Creating a UDF for MySQL in Delphi

我的未来我决定 提交于 2019-12-20 02:11:18
问题 How do I create a UDF for MySQL using Delphi? Does anyone have any code templates? I want the code template to be integrated in Delphi versions(2007 and upper), so I need these templates to be usable with and without Unicode support. 回答1: For starters, Google reveals: documentation a forum thread an example You need to create a DLL with a few exported functions, as documented. 来源: https://stackoverflow.com/questions/5894258/creating-a-udf-for-mysql-in-delphi

How to find the smallest and biggest number in an array?

北慕城南 提交于 2019-12-18 16:49:30
问题 Hello how can I find the smallest and biggest number in delphi? Suppose I have 10 different numbers stored in an array: How can I find the biggest number and smallest numbers in my array? 回答1: Simply loop through the array in linear fashion. Keep a variable for the min value and one for the max values. Initialise both to the first value in the array. Then for each element, update the min or max value if that element is less than or greater than the min or max value respectively. minval := a[0

How do I copy a form as an image to the clipboard

情到浓时终转凉″ 提交于 2019-12-18 12:34:16
问题 I need to copy a form (Delphi 2007) to the clipboard as an image to paste what the user can see into a word document. The clipboard part is not really a problem. The questions is how to get a bitmap for the form. Searching has turned up multiple options. Call GetFormImage Use the PrintWindow API function that is part of the GDI+ Send a WM_PRINT message Copy the Canvas for the current form using Canvas.CopyRect I also found a component called TExcellentFormPrinter that has a solution that

Why 2 GB memory limit when running in 64 bit Windows?

旧巷老猫 提交于 2019-12-17 22:20:49
问题 I'm a member in a team that develop a Delphi application. The memory requirements are huge. 500 MB is normal but in some cases it got out of memory exception. The memory allocated in that cases is typically between 1000 - 1700 MB. We of course want 64-bits compiler but that won't happen now (and if it happens we also must convert to unicode, but that is another story...). My question is why is there a 2 GB memory limit per process when running in a 64 bit environment. The pointer is 32 bit so

Delphi MSBuild Build Configurations From Command Line

淺唱寂寞╮ 提交于 2019-12-17 15:25:08
问题 Delphi 2009 uses build configurations . When you create a new project you have two default build configurations "Debug" and "Release". Now I asked myself how to automate builds using MSBuild (which is supported by Delphi since version 2007). You can start the "msbuild" command in the "RAD Studio Command Prompt" in some Delphi project directory and it will build the default build configuration (the last activated build configuration inside the Delphi IDE). Now, I want to specify a certain (non