delphi-xe2

Indy and smtps: cannot connect

左心房为你撑大大i 提交于 2020-01-04 06:57:28
问题 I am trying to send emails from smtps (secure smtp) using Indy and the technique exaplined in this Marco Cantù article. This is what I am using: object SMTP: TIdSMTP IOHandler = IdSSLIOHandlerSocketOpenSSL1 SASLMechanisms = <> UseTLS = utUseExplicitTLS Left = 32 Top = 196 end and SMTP.Host := 'smtps.pec.aruba.it';; SMTP.Port := 465;; SMTP.Username := 'myaddress@pec.it'; SMTP.Password := 'myPassw0rd'; MailMessage.Encoding := meDefault; MailMessage.From.Address := 'myaddress@pec.it';

Delphi Login Form using App Tethering by Connecting to SQLite Database

余生长醉 提交于 2020-01-04 05:53:30
问题 Hi, EveryBody! I'm new to programming! I need your help plz. I've 2 project: 1. Project Login page. Using App Tethering and 2 buttons(Connect button =>connects to the server AND Login button=>Sends request to the Server to check Valid username and password). 2. Project Server page. In a Server Page using App tethering and FDQuery +( SQLite database test.db). When Client Connects to the Server and sends request to the Server to check valid username and password it gives wrong result. plz help

Downloading list of files from remote FTP

☆樱花仙子☆ 提交于 2020-01-04 02:44:27
问题 I'm getting a problem using the TidFTP component. I'm able to connect with the server using a code like this vFileList := TStringList.Create; oClientFTP := TidFTP.Create(nil); oClientFTP.Port := PortFTP; oClientFTP.Host := IPHost; oClientFTP.UserName := UserFTP; oClientFTP.Password := PasswordFTP; After getting several files from the StringList (this one has exactly 778 elements) when the element no. 137 is retrieved the exception EIdAcceptTimeout is raised with "Accept timed out." message.

Why does a TToolBar calculate button widths automatically when ShowCaption is set True?

我与影子孤独终老i 提交于 2020-01-03 15:25:07
问题 I need to have two TToolBar s on the right side of my main form, so I put three TPanel s for alignment, and then put the TToolBar s inside them. I've been trying to tell the toolbutton s to have the same width for the past day, to no avail. Here's a screen shot of what I've got: I found out that if ShowCaption is set to True , the toolbars calculate the button width automatically. My question is why, and how to disable this? 回答1: Take a look at this approach: Set Autosize to False for all

How to create subitems menus under the application name on OSX?

大城市里の小女人 提交于 2020-01-03 08:38:52
问题 How to add TMenuItem under Project1 and above Quit on the screenshot below? I have created a TMenuBar with property UseOSMenu checked. The first TMenuItem I added is the second one in the main bar... 回答1: You can do this by assigning a TMenuBar of IItemsContainer implementing class to the Application.ApplicationMenuItems property. Example: If there was a menu bar component on the form called MenuBar1, then you would just call the following in your forms constructor (or OnCreate). Application

F2051 Unit JclUnitVersioning was compiled with a different version of System.Contnrs.TObjectList.Remove

北城以北 提交于 2020-01-03 03:07:06
问题 I'm migrating a Delphi 2 project to RAD Studio XE2. When I try to compile I get [DCC Fatal Error] MyUnit.pas(9): F2051 Unit JclUnitVersioning was compiled with a different version of System.Contnrs.TObjectList.Remove at the following row: unit MyUnit; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DB, DBTables, TB97, ExtCtrls, Grids, DBGrids, Vcl.Mask, JvExMask, Vcl.DBLookup, JvToolEdit, {<-- error here} TB97Ctls; {...} I tried uninstalling

TMainMenu is not shown when the vcl styles is removed from the NC Area

你。 提交于 2020-01-02 06:33:52
问题 I'm using this code to remove the vcl styles from the non client area of a form. type TFormStyleHookNC= class(TMouseTrackControlStyleHook) protected procedure PaintBackground(Canvas: TCanvas); override; constructor Create(AControl: TWinControl); override; end; constructor TFormStyleHookNC.Create(AControl: TWinControl); begin inherited; OverrideEraseBkgnd := True; end; procedure TFormStyleHookNC.PaintBackground(Canvas: TCanvas); var Details: TThemedElementDetails; R: TRect; begin if

execute exe in memory

给你一囗甜甜゛ 提交于 2020-01-02 06:30:12
问题 I was trying out this code. execute EXE from memory I am hitting on error "Types of actual and formal var parameters must be identical" . Any help in this regard is highly appreciated. ...... ReadProcessMemory(ProcInfo.hProcess, pointer(Context.Ebx + 8), @BaseAddress, 4, Bytes); <-- error is here ....... and ..... WriteProcessMemory(ProcInfo.hProcess, pointer(ImageNtHeaders.OptionalHeader.ImageBase), InjectMemory, InjectSize, Bytes); <---- error here ...... I am using Delphi XE2 and windows 7

Why do the System.IOUtils functions and TStreamReader use fmShareCompat?

萝らか妹 提交于 2020-01-02 03:50:29
问题 When I first saw the System.IOUtils unit with functions like TFile.ReadAllBytes and TFile.ReadAllText and the TStreamReader and TBinaryReader classes in System.Classes I was quite excited to have easy ways to read binary and text files. After using them for a while I noticed that the default share mode is implicitly fmShareCompat , since they all use TFileStream.Create , but do not explicitly specify a share mode. Since fmShareCompat is treated as fmShareExclusive on Windows this leads to

How to iterate a TDictionary and delete item?

心不动则不痛 提交于 2020-01-02 03:12:50
问题 I have a TDictionary and add some items to it: for index := 0 to 10 do dict.Add(IntToStr(index), index); Now, I need to iterate the container and remove items I wanted: pairEnum := dict.GetEnumerator; while pairEnum.MoveNext do begin if pairEnum.Current.Value mod 2 = 0 then dict.Remove(pairEunm.Current.Key); end; I expect I now only have odd number in the dictionary. But what I actually got are: key=1 value=1 key=3 value=3 key=5 value=5 key=7 value=7 key=9 value=9 key=8 value=8 <- Why the "8"