Delphi

Can't replace the footer text in a word application through Delphi

瘦欲@ 提交于 2020-01-04 11:11:34
问题 I am trying to replace text in a footer, I am using the following code through which i can replace the normal content (body) but not the content in the footer/header myWinWordApp := CreateOLEObject('Word.Application'); myWinWordApp.visible := true; myWinWordApp.documents.open('c:\ole.doc'); myWinWordApp.Selection.Find.Text := 'oo'; myWinWordApp.selection.Find.Replacement.Text := 'aa'; myWinWordApp.Selection.Find.Execute(Replace := 2); any help is highly appreciated. Thanks in advance 回答1:

Change the regional settings format for Sysem.Variants.VarToWideStr

孤者浪人 提交于 2020-01-04 09:36:25
问题 A third party component (FastReports) on my application is using extensively the System.Variants.VarToWideStr function, which is fine except that it ignores the regional settings I need that application to use. Example: FormatSettings.ShortDateFormat := 'dd/mm/yyyy'; ShowMessage(VarToWideStr(Date)); FormatSettings.ShortDateFormat := 'yyyy/mm/dd'; ShowMessage(VarToWideStr(Date)); This code always returns the same string, ignoring the regional settings that I indicate the application to use. Do

Delphi and HDD I/O Quoting , Resource Pre-Caching , Read/Write/seek parameter limiting

*爱你&永不变心* 提交于 2020-01-04 09:18:27
问题 I have dynamic array filled with bytes, which are read from .raw file with BlockRead() and this operation, logically, requires hell of a Shell resources and I wanted to know if there is any methods to reserve some amount or limit maximum amount of Read/Write/Seek used for Program run time from Hard Disk Drive***** [Clarification] : I meant to set maximum reading speed from HDD while performing action with windows shell / internal app resources. In this moment app is very sensitive to hdd's

How to access a Cassandra distributed database from Delphi

女生的网名这么多〃 提交于 2020-01-04 09:15:28
问题 I am looking at whether Cassandra might be an option for a distributed database store for our server software. The server software is written in Delphi, but I'm having difficulty locating descriptions of how to access a Cassandra database from Delphi. 回答1: One suggestion elsewhere on SO is to write your own Delphi generator for the Thrift framework. 回答2: I see two options, either write your own native Delphi driver or use available drivers somehow. One solution could be to use Python4Delphi

How to access a Cassandra distributed database from Delphi

跟風遠走 提交于 2020-01-04 09:15:08
问题 I am looking at whether Cassandra might be an option for a distributed database store for our server software. The server software is written in Delphi, but I'm having difficulty locating descriptions of how to access a Cassandra database from Delphi. 回答1: One suggestion elsewhere on SO is to write your own Delphi generator for the Thrift framework. 回答2: I see two options, either write your own native Delphi driver or use available drivers somehow. One solution could be to use Python4Delphi

What's the cartoon speech bubble coming from the notification area called, and how do I create one?

主宰稳场 提交于 2020-01-04 09:13:05
问题 Can some one tell me what the name of the following popup window is: How do I create such a popup for my application? 回答1: To be more specific, this is indeed called a Notification (a specific type of balloon) see also here and the icon from which it comes from is called a Notification area Icon . The area of the screen in which this icon is located is called the Notification Area . This is not specific to Windows - other operating systems have their own form of Notification Areas. The

Find out the current frequency of the CPU

好久不见. 提交于 2020-01-04 08:28:27
问题 The Windows 8 Task manager shows the current (not maximum) frequency of the CPU (e.g. 1.2 GHz). Is there a way to get this frequency with the Windows API? Preferrably using Delphi or Visual C++. 回答1: I would look into WMI, specifically, the CurrentClockSpeed property of the Win32_Processor class. MSDN link 来源: https://stackoverflow.com/questions/14916327/find-out-the-current-frequency-of-the-cpu

Indy and smtps: cannot connect

我的未来我决定 提交于 2020-01-04 06:58:05
问题 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';

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';

WYSIWIG with Unicode

ぐ巨炮叔叔 提交于 2020-01-04 06:55:21
问题 I've written a Windows program in Delphi that places and wraps text very precisely to both the screen and printer using GetCharWidth and Em-Square. This has worked well with ANSI text where you only need to retrieve and calculate the widths of 255 characters but when you go to Unicode with 65535 characters its too slow. The problem is made worse by having to create 2 arrays of width, one for normal and one for bold. //Setup a reference canvas for measuring purposes RefDC := CreateCompatibleDC