delphi-7

TAdoQuery.ParseSql do not work in xe4

时光总嘲笑我的痴心妄想 提交于 2019-12-10 14:16:07
问题 I have a project in Delphi 7 and I use TAdoQuery.ParseSql(); to load parameters. Now I compile it in XE4 and type of parameters is sometimes wrong. It's really ftInteger but created as ftSmallint . What can I do to solve this problem? My DB is SQL Server 2008 R2. Table definition: CREATE TABLE [dbo].[tblTest]( [sysId] [int] IDENTITY(1,1) NOT NULL, [Code] [nvarchar](50) NOT NULL, [Name] [nvarchar](500) NOT NULL, CONSTRAINT [PK_tblTest] PRIMARY KEY CLUSTERED ( [sysId] ASC ) WITH ( PAD_INDEX =

Using New/Dispose with record pointer containing WideString

混江龙づ霸主 提交于 2019-12-10 14:03:33
问题 I have very old code (from D3): TMyRecord = record Index : Integer; Header : String[70]; Strings : Array[1..MAX_VALUES] of String[70]; end; TMyClass = class(TComponent) FData : ^TMyRecord; ... end; constructor TMyClass.Create(AOwner: TComponent); begin inherited Create(AOwner); New(FData); ... end; destructor TMyClass.Destroy; begin Dispose(FData); inherited; end; Q: Is it safe to replace String[70] with WideString; and Array[1..MAX_VALUES] of String[70] with Array[1..MAX_VALUES] of

Delphi overwrite existing file on save dialog

本小妞迷上赌 提交于 2019-12-10 13:54:19
问题 I am using the TSaveDialog component to save a file from a button click. However, I am having trouble with saving on an existing file name. Generally, when you want to save over an existing file in Windows, a message box pops up asking you if you really want to overwrite the file. This is not the case with the TSaveDialog component and it will go ahead and write over the file without asking. I was hoping there was a TSaveDialog function or event that I could use but I have not seen anything

I get an error EStackOverflow when creating packed struct in delphi 7.0

放肆的年华 提交于 2019-12-10 13:44:59
问题 I'm getting an EStackOverflow when creating a packed struct in Borland Delphi 7.0 I want to do the following: Type T4 = packed record VT : integer; SKT : byte; end; T3 = packed record O : boolean; TT4 : array of T4; end; T2 = packed record con : boolean; TT3 : array [64..90,64..90] of T3; End; TTT = array [64..90,64..90] of T2; procedure TForm1.Button1Click(Sender: TObject); var Arr : TTT; begin Arr[64,64].con:=false; end; But when I run the program and click the button, I get an

Can we call Native Windows API from Delphi?

China☆狼群 提交于 2019-12-10 13:16:31
问题 Is it possible to call the kernel Native APIs from within a Delphi application? Like nt and zw syscalls. 回答1: You can indeed call the native API from Delphi. Delphi does not ship with header translations for the native API. So you need to provide your own, or use a pre-existing translation. For example. the JEDI translation of the NT API. 回答2: As David Heffernan says it's perfectly possible to use the Native API from usermode and thus Delphi. You will need the JwaNative unit from the Jedi

Delphi 7 TIdFTP FTP security (password protection)

夙愿已清 提交于 2019-12-10 12:55:50
问题 I have been dealing with FTP lately and I'm not sure about the security of the Indy component TIdFTP . That is why I have created some tests which I want to share with you so you could give your opinion of best practices and how it is done. First of all I just added the username and password in the component using the Object Inspector: And created a simple connection which works well: procedure TForm1.FormActivate(Sender: TObject); begin try FTP.Connect(); ShowMessage ('Connection success');

Make owner-drawn TPageControl tabs look nicer, like without owner-draw

核能气质少年 提交于 2019-12-10 10:48:26
问题 I use Delphi7, PageControl with owner-draw. I can't get so plain and nice look of tabs, as I see on not-owner-drawn PageControls. What's bad: when using owner-draw, I can't draw on "entire" tab header area, small 1-2px frame around tab header is painted by OS. 1) Delphi not owner-draw, look is OK too (XPMan used): 2) Delphi owner-draw, you see not entire tab header can be colored (XPMan used): I draw current tab with blue and others with white, here. Only example. Code: procedure TForm1

Delphi 7 macro preprocessor support

泄露秘密 提交于 2019-12-10 10:37:20
问题 Is there a macro preprocessor for Delphi 7? There isn't one built in so maybe there's a possibilty to use a third party or some other languages preprocessor (like c preprocessor). If there's one, how to set it up for Delphi 7? I'm trying to do function inlining (for speed). Macro preprocessor seems to be the only easy option for delphi. Thanks, Egon 回答1: You can always run an external macro processor, such as m4 or even (shudder) cpp on your code before you compile it. I wouldn't recommend

How to Use FFMPEG in inside the Delphi [closed]

我是研究僧i 提交于 2019-12-10 10:08:07
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Iam beginner in delphi.i create the one sample application i need one help.how to use FFMPEG in inside the delphi? 回答1: FFMPEG is a command line app, so you can easily call it using ShellExecute() , with some

How to stop music started via SndPlaySound

十年热恋 提交于 2019-12-10 09:43:27
问题 At this Website I found how to add music into a .res file and then use it in your delphi .exe. Here is the code for starting the WAVE song. procedure TForm2.FormActivate(Sender: TObject); var hFind, hRes: THandle; Song: PChar; begin hFind := FindResource(HInstance, 'SonicSong', 'WAVE') ; if hFind <> 0 then begin hRes:=LoadResource(HInstance, hFind) ; if hRes <> 0 then begin Song:=LockResource(hRes) ; if Assigned(Song) then SndPlaySound(Song, snd_ASync or snd_Memory) ; UnlockResource(hRes) ;