delphi-2006

How to download a file over HTTPS using Indy 10 and OpenSSL?

流过昼夜 提交于 2019-11-30 00:51:26
I have the following task: download a file using HTTPS and authentication. Indy seems the way to go but for some reason it doesn't work so far. I have the following in place: a TIdHTTP component which I use for downloading a TIdURI component used to create the URL a TIdSSLIOHandlerSocketOpenSSL component which should provide the secure connection. The required DLLs are in the binary folder. The site also requires authentication and I included the user/pass in the URL as in the example below. In short this is the code: URI := TIdURI.Create('https://test.example.com/'); URI.Username :=

Delphi - How do you generate an event when a user clicks outside modal dialog?

拥有回忆 提交于 2019-11-29 03:01:22
问题 Is it possible to fire an event when the user clicks outside a modal dialog? OK, Windows provides it's own clues when you do this by making the "bonk" sound, or by flashing the app's taskbar button, but I would like to provide some sort of additional clue for situations where sound is not available and/or the user doesn't recognise the reason for the taskbar flashing. Also, I would like to try using this as a way to bring the modal dialog to the front if it has become hidden behind the main

Delphi - finding the process that is accessing a file from my program

狂风中的少年 提交于 2019-11-28 20:42:31
I have a Delphi app that regularly writes to a local disk file. Occasionally it is unable to access the file - a sharing violation results when it tries to open it. A retry after a short delay is all that is needed, but when it occurs, I would like to report the process that prevented the access. Is it feasible when a sharing violation occurs for my program to enumerate all the file handles in use, inspect the filename, and if it matches the name of my data file, retrieves the process name associated with that handle? Some example code would be nice. You have basically two ways The Easy Way if

When should I use enhanced record types in Delphi instead of classes?

余生长醉 提交于 2019-11-28 19:13:29
问题 Delphi 2006 introduced new capabilities for records, making them more 'object-oriented'. In which situations is the record type more appropriate for a design than a class type? Which advantage does it have to use these record types? 回答1: You have records, objects and classes. Records are available since turbo pascal 1. They are lightweight, capable of having properties and methods, but they do not support inheritance, There are some issues with functions that return records. If these records

INDY 10.1.5 - Which SSL dlls work with Delphi 2006?

心不动则不痛 提交于 2019-11-28 09:06:16
I'm trying to connect to google documents (following Marco Cantu's excellent REST example) but I am getting the following SSL errors: 1) If I use the SSL dlls from openssl-0.9.8i-i386-win32.zip I get the error: "Could not load SSL library" 2) If I use the SSL dlls from indy_OpenSSL096m.zip I get the error: "Error connecting with SSL" 3) If I use the SSL dlls from openssl-0.9.8h-i386-win32-Indy-IntraWebEdition.zip I get the error: "Could not load SSl Library" Now I've researched this and there are a lot of recommendations with dead links to dlls about, including links on stack overflow. I

Delphi - TXMLDocument created at run-time generates AV, with component on the form is working

半世苍凉 提交于 2019-11-28 03:29:58
问题 I'm creating an instance of TXMLDocument at runtime, to load and parse a XML file. You can check the code below: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, xmldom, XMLIntf, msxmldom, XMLDoc, StdCtrls; type Txml = class(TForm) // XMLDocument1: TXMLDocument; Memo1: TMemo; procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var xml: Txml; implementation {$R *.dfm} procedure

Unit testing in Delphi - how are you doing it? [closed]

强颜欢笑 提交于 2019-11-28 03:08:10
I'm wondering how the few Delphi users here are doing unit testing, if any? Is there anything that integrates with the IDE that you've found works well? If not, what tools are you using and do you have or know of example mini-projects that demonstrate how it all works? Update: I forgot to mention that I'm using BDS 2006 Pro, though I occasionally drop into Delphi 7, and of course others may be using other versions. DUnit is a xUnit type of unit testing framework to be used with win32 Delphi. Since Delphi 2005 DUnit is integrated to a certan point into the IDE. Other DUnit integration tools for

Delphi debug a wrong unit

可紊 提交于 2019-11-28 02:00:48
This is an odd behaviour by my D2006 as it happens sometimes only. I have a project I want to debug. The file I want to debug is named 'Main.pas'. I have another unrelated project with the same Unit name and sometimes the Debug prompt me the wrong Main file instead of the Main unit from the current project. This have happened to me with other files with the same name. I can't debug then as the debug keys don't work (they just don't do anything). Do you have experienced the same problem? How can I fix it? Thanks. Do you use relative paths? If yes, I found out it helps to set the working

Strategy or tools to find “non-leak” memory usage problems in Delphi?

我们两清 提交于 2019-11-27 06:05:22
问题 One old application started to consume memory a lot after server update. Memory usage seems to rise with out limit until program hangs. According to FastMM4 and EurekaLog, there's no memory leak (except 28 bytes), so I assume all memory is freed when application is shutdown. Are there any tools or strategies suitable for tracking this kind of memory problem? 回答1: The growing memory consumption is an application issue. It is not a bug, which can discover FastMM4 or EurekaLog. As from they

INDY 10.1.5 - Which SSL dlls work with Delphi 2006?

谁都会走 提交于 2019-11-27 02:40:11
问题 I'm trying to connect to google documents (following Marco Cantu's excellent REST example) but I am getting the following SSL errors: 1) If I use the SSL dlls from openssl-0.9.8i-i386-win32.zip I get the error: "Could not load SSL library" 2) If I use the SSL dlls from indy_OpenSSL096m.zip I get the error: "Error connecting with SSL" 3) If I use the SSL dlls from openssl-0.9.8h-i386-win32-Indy-IntraWebEdition.zip I get the error: "Could not load SSl Library" Now I've researched this and there