Delphi

How to encode base64 in Delphi 6? [duplicate]

怎甘沉沦 提交于 2020-01-14 02:35:05
问题 This question already has answers here : Binary to Base64 (Delphi) (2 answers) Closed 6 years ago . I need to encode a pdf document to base64 in Delphi6. Can anyone help me? 回答1: You can use the EncdDecd unit that is supplied with Delphi. The function you need is EncodeStream . You simply need to create two streams, one for input and one for output. If you are working with files then you should create TFileStream instances. Once you have your two file streams created, all you need is:

TStreamWriter (Auto)Flush does not?

匆匆过客 提交于 2020-01-13 20:22:12
问题 Despite what is said in Text File Writing performances in Delphi (comments under Ken White's answer), I see the TStreamWriter not flushing with the following code: procedure TFrmAddEvents.LogEvent(AEvent: TcxSchedulerEvent); begin if not Assigned(FStreamWriter) then begin FStreamWriter := TStreamWriter.Create(TFileStream.Create(ChangeFileExt(ParamStr(0),'.log'),fmCreate or fmOpenRead)); FStreamWriter.AutoFlush := true; end; FStreamWriter.WriteLine(TcxEventDescription(AEvent)); // Even this

TStreamWriter (Auto)Flush does not?

坚强是说给别人听的谎言 提交于 2020-01-13 20:21:58
问题 Despite what is said in Text File Writing performances in Delphi (comments under Ken White's answer), I see the TStreamWriter not flushing with the following code: procedure TFrmAddEvents.LogEvent(AEvent: TcxSchedulerEvent); begin if not Assigned(FStreamWriter) then begin FStreamWriter := TStreamWriter.Create(TFileStream.Create(ChangeFileExt(ParamStr(0),'.log'),fmCreate or fmOpenRead)); FStreamWriter.AutoFlush := true; end; FStreamWriter.WriteLine(TcxEventDescription(AEvent)); // Even this

ShortDateFormat vs FormatSettings.ShortDateFormat?

旧城冷巷雨未停 提交于 2020-01-13 19:48:06
问题 In trying to get Log4D to compile in XE4, I was seeing [dcc32 Error] Log4D.pas(2139): E2003 Undeclared identifier: 'ShortDateFormat' on this line: SetOption(DateFormatOpt, ShortDateFormat); A bit of googling led me to the solution of changing ShortDateFormat to FormatSettings.ShortDateFormat , which led to the following compiling code on XE4: SetOption(DateFormatOpt, FormatSettings.ShortDateFormat); However, I don't really understand why that fixes things why it's needed to specify

EOutOfMemory Creating Large XML Using Delphi

随声附和 提交于 2020-01-13 19:41:11
问题 I'm using Delphi to create an XML document from data in a relational database. It tests fine with small datasets, but when I try to expand the size of the data set to production levels it eventually bombs out with an EOutOfMemory exception during node creation. I'm using a TXMLDocument dropped on a form (MSXML as the Vendor), and my code generally looks like this: DS := GetDS(Conn, 'SELECT Fields. . . FROM Table WHERE InsuredID = ' +IntToStr(AInsuredID)); try while not DS.Eof do with ANode

Retrieving Outlook 'Inbox' and 'Sent' folders in Delphi using OLE

别来无恙 提交于 2020-01-13 16:45:09
问题 What's the best way to go about extracting Outlook folders from within Delphi? Ideally I'd like to retrieve the Inbox folder and any other folders within it. I don't require the email headers/message just purely the folder names. Delphi BDS 2006 回答1: See here for Outlook's Object Model. Below displays the names of folders in the Inbox: procedure TForm1.Button1Click(Sender: TObject); var Outlook, oNameSpace, Inbox: OleVariant; i: Integer; begin try Outlook := GetActiveOleObject('Outlook

Delphi native Web Service applications not working. IIS 7 seems to be stripping the pathinfo

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-13 15:48:00
问题 I've run into an interesting problem that I never encountered with XP or IIS 6. Basically, I can't get a native Delphi (WebBroker) Web service server to work with a native Web service client in Windows 7 64-bit. Here's the most basic breakdown. If I create a new Web service application in Delphi 2010 (or any version, back to Delphi 7), and access it using IE 8, I can see the HTML that the WSDLHTMLPublish component creates, but I can never get to the SOAP. In the same way, the WSDL Importer

Delphi 文件类型

夙愿已清 提交于 2020-01-13 15:02:35
该内容整理自以下链接 http://www.cnblogs.com/chenyunpeng/archive/2012/08/02/2620513.html 1.DPR: Delphi Project文件,系统的工程文件。文本格式,需要进源代码库。 2.PAS: Pascal文件,Pascal单元的源代码,可以是与窗体有关的单元或是独立的单元。 3.DFM: Delphi Form File,描述窗体或数据模块及其组件属性的二进制文件。窗体界面文件, 同PAS文件同名,而且一一对应, 定义了窗体属性和构件的属性。 4.BPG: Borland Project Group, 工程项目包, 多个工程文件(DPR)的集合。文本格式,需要进源代码库;bpg文件其实是makefile格式,要编译bpg文件可以使用make工具,语法如下:make -f %FileName% 5.DOF: Delphi Option File, 选项文件, 包括编译信息等。 6.CFG: Project Configuration File, 编译器可读的配置文件。 7.DSK: Desktop Setting File, 保存工程文件的桌面摆布情况, 下次打开时可以恢复上次保存的桌面状态。文本格式,此文件不应进源代码库。 8.DSM:集成开发环境IDE的临时保存文件, 有时IDE总出错, 可以将这个文件删掉,

Stop the IDE from adding uses units automatically

一曲冷凌霜 提交于 2020-01-13 14:40:17
问题 I am moving a Lazarus project to Delphi Seattle. The Lazarus project depends on 40+ units (including controls) and has several applications. In the uses clause of all the projects they used the following: uses Classes, SysUtils, Forms, Controls, Graphics, Dialogs, DBCtrls, {$I OurLibrary.inc}; where they included those 40+ units with $I OurLibrary.inc . As some of those units are controls i registered them in Delphi. However if i save the project or build / compile it, Delphi adds the units

How to capture frames using Delphi/DSPack without displaying it on TVideoWindow?

这一生的挚爱 提交于 2020-01-13 14:07:33
问题 DSpack has example code to play a DirectShow compatible video device and to capture the video frames simultaneously. A TVideoWindow is attached to the FilterGraph to display the video (Firgure-1). If you remove the TVideoWindow, then the Operating System (Windows) will automatically bring up ActiveMovie and display the video on a separate window (Figure-2). Is there a way to use DSPack to capture video frames without using any of the GUI components and without displaying the video? DSPack