delphi-2007

How can I temporarily disable the “return value might be undefined” warning?

时光毁灭记忆、已成空白 提交于 2019-12-04 00:59:04
I want to disable a specific warning (W1035) in my code, since I think that the compiler is wrong about this warning: function TfrmNagScreen.Run: TOption; begin if ShowModal = mrOk then Result := TOption(rdgAction.EditValue) else Abort end; There is no way the result could be undefined, since Abort throws EAbort . I tried: {$WARN 1035 Off} : Apparently this only works for some specific errors (see Documentation ) {$W-1035} : Does nothing at all I know I can switch off the warning globally in the project options, or using {$WARNINGS OFF} , but that is not what is intended here. Edit: I have QC

How to Append rows to an Excel Sheet?

假如想象 提交于 2019-12-03 21:49:54
I am developing an application that need to generate excel sheets. How do we append rows to an existing excel sheet? I am using Delphi 2007.(and I am using SM Software TXLS... components...but I am ok with answers in native delphi excel components). Thanking you all, Pradeep Over the years, I've found Deborah Pate's site has helped me by providing useful code samples: http://www.djpate.freeserve.co.uk/AutoExcl.htm . We use the CreateOleObject approach. Normally you won't need to append rows, because you can just reference any cell to write in it. You may need to insert rows in the middle of

Encode base64 and Decode base64 using delphi 2007

核能气质少年 提交于 2019-12-03 21:06:58
I have to encode an array of bytes to a base64 string (and decode this string) on an old Delphi 2007. How could I do? Further Informations: I've tried synapse (As suggested here Binary to Base64 (Delphi) ). Indy ships with Delphi, and has TIdEncoderMIME and TIdDecoderMIME classes for handling base64. For example: uses ..., IdCoder, IdCoderMIME; var Bytes: TIdBytes; Base64String: String; begin //... Bytes := ...; // array of bytes //... Base64String := TIdEncoderMIME.EncodeBytes(Bytes); //... Bytes := TIdDecoderMIME.DecodeBytes(Base64String); //... end; There are also methods for encoding

How to make sure a dialog is always front of the main window

送分小仙女□ 提交于 2019-12-03 17:16:45
I have not yet found the best solution for this. I have a non modal dialog that can be opened in unlimited instances by a hotkey in the application. Even the dialog itself can open a new instance. I want those dialogs to always be front of the main application window. I have tried a couple of things. Set FormStyle to fsStayOntop. This works but have the advantage that the dialog will be front of ALL windows even other applications. I only want it to be front of my main window. Set PopupMode to pmAuto. This also works except for the case when one dialog open another dialog. If the first dialog

SSL Issues with IntraWeb - Delphi 2007

元气小坏坏 提交于 2019-12-03 16:17:17
I've been trying to SSL working on my IW program for the last little while and I keep running up against the 'Could not load SSL Library'. I've followed every piece of advice I could find on the subject, but still no joy. I've tried the suggested DLLs in both the local directory and in system32. Does anyone have a definitive answer about what OpenSSL DLLs I should be using? And what build of them? Or any other ideas at all? Indy: updated to the most recent snapshot yesterday IntraWeb: stock D2007 installed This is running on a Vista machine, if that makes any difference. TIA, Trevor SOLVED: It

When does Delphi honor `inline` and when not?

一个人想着一个人 提交于 2019-12-03 15:56:13
I was tying to optimize a piece of code that has this construct: while (i > 0) do begin Dec(i); This looks inefficient, so I tried to do this: while (Dec(i) >= 0) do begin That doesn't work because Dec is a procedure and not a function. So I rewrite it to: procedure Withloop; var .... function Decr(var a: integer): integer; inline; begin Dec(a); Result:= a; end; ... while (Decr(i) >= 0) do begin But this gets compiled into: SDIMAIN.pas.448: while (Decr(i) >= 0) do begin 00468EE5 8BC4 mov eax,esp 00468EE7 E8D0FEFFFF call Decr <<--- A call?? 00468EEC 85C0 test eax,eax 00468EEE 0F8D12FFFFFF jnl

DoubleBuffered property being added in the dfm in Delphi 2009 does not exist in Delphi 2007

这一生的挚爱 提交于 2019-12-03 15:06:14
Does that mean that I can't share a Form between delphi 2007 and 2009? Yes. It is not possible unless you remove the properties that are not published in Delphi 2007 from the DFM. Ondrej Kelle DoubleBuffered has been in TWinControl for some time now. The difference in Delphi 2009 is that it's published now. If you can live with only ignoring the errors (and not making the properties work instead), here is a possible solution: unit Delphi2009Form; interface uses Windows, Classes, SysUtils, Controls, Forms; type {$IFDEF VER200} TDelphi2009Form = class(TForm); {$ELSE} TDelphi2009Form = class

Tools which can parse Delphi XMLDoc format and build online help

淺唱寂寞╮ 提交于 2019-12-03 14:11:06
问题 The XMLDoc tool for API documentation is explained here: http://edn.embarcadero.com/article/32770 Are there any free or commercial tools which can be used to create documentation based on Delphi's XML doc format? Is there a newer version of the 'getting started' documentation? This page refers to Delphi 2005 and third party tools, some of them seem to have moved. The XMLDoc for Delphi 2005 required Python (tested with Python 2.3) Instant Saxon (tested with Instant Saxon 6.5.3) The Java SDK

How can I detect a debugger or other tool that might be analysing my software?

隐身守侯 提交于 2019-12-03 13:29:24
问题 A very simple situation. I'm working on an application in Delphi 2007 which is often compiled as 'Release' but still runs under a debugger. And occasionally it will run under SilkTest too, for regression testing. While this is quite fun I want to do something special... I want to detect if my application is running within a debugger/regression-tester and if that's the case, I want the application to know which tool is used! (Thus, when the application crashes, I could report this information

In Delphi in my DLL do I have to allocate the return pchar of a function

早过忘川 提交于 2019-12-03 12:55:59
I have a DLL in which I have a function that returns a pchar. (as to avoid having to use borlndmm) What I was doing originally was casting a string as a pchar and returning that Result := pChar(SomeFuncThatReturnsString) But I was getting expected results 90% of the time and the other times I would get back nothing. I then got to thinking that I needed to allocate the memory for the pchar and that doing it my original way was having a pchar point to memory that was not always going to be what was there when the function was called originally. So I now have this Result := StrAlloc(128); Strcopy