Delphi

Connect via Bluetooth with Delphi XE7 using portable printer

戏子无情 提交于 2020-03-17 06:51:46
问题 I'm trying to communicate with a Sewoo LK-P32 printer via Bluetooth. For this, I am using Delphi XE7 . I made a few examples that come with Delphi and am not having success. I put the paired printer on tablet and even then I am not able to print continuously. When I print something have to restart the application, so I can print something again. Below my sources. Could someone help me? Support on this issue? My time is short to try other technologies. Method that initiates communication with

delphi 弹出输入框的InputQuery, InputQuery 函数用法

亡梦爱人 提交于 2020-03-16 18:33:27
delphi 弹出输入框的InputQuery, InputQuery 函数用法 procedure TForm1.Button1Click(Sender: TObject); var str: string; begin str := InputBox('输入窗口标题', '输入提示', '默认输入内容'); ShowMessage(str); //显示输入的内容 end; InputBox 是调用了 InputQuery, InputQuery 是通过一个 var 参数获取新字串: procedure TForm1.Button2Click(Sender: TObject); var str: string; begin InputQuery('输入窗口标题', '输入提示', str); ShowMessage(str); //显示输入的内容 end; InputQuery 可返回一个 Boolean 值, 可判断用户是确认还是取消, 挺有用的: procedure TForm1.Button3Click(Sender: TObject); var str: string; begin str := '默认输入内容'; if InputQuery('输入窗口标题', '输入提示', str) then ShowMessage(str); //如果点击了 ok

Delphi 让窗体自适应屏幕显示

房东的猫 提交于 2020-03-16 18:28:09
unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,Typinfo, Vcl.StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function PropertyExists(const AObject: TObject; const APropName: string): Boolean; var PropInfo: PPropInfo; begin PropInfo := GetPropInfo(AObject.ClassInfo, APropName); Result :

一个通用的Delphi数据导出到Excel函数

流过昼夜 提交于 2020-03-16 15:16:42
一个通用的Delphi数据导出到Excel函数 (2008-05-09 21:10:07) 关键字:delphi 对Excel编程,TDataSet(Tquery,TTabe)导到Excel,如何设置Excel字体、文本对齐方式,如何设置单元格边框,如何合并单元格,如何Excel打印设置,如何设置单元格为文本格式 主要功能: 1.数据集导出到Excel函数 2.自动设置列宽 3.自动调节适应A4纸张 4.具有打开Excel、打印预览、直接打印选项 unit ExcelReport; interface uses SysUtils, Variants, Controls, Forms, Dialogs, ComObj, ComCtrls, DB, excel2000, StdCtrls, Graphics, Windows, Grids; {************************************************************************************** 数据集导出到Excel函数,自动设置列宽,自动调节适应A4纸张 Columns:可以是DataSet的Fields,ListView的Columns,StringGrid之一 DataSet:数据集 Caption:大标题, SubCaption:子标题,

DELPHI的BPL使用

瘦欲@ 提交于 2020-03-16 06:32:21
了解BPL和DLL的关系将有助于我们更好地理解DELPHI在构件制作、运用和动态、静态编译的工作方式。对初学DELPHI但仍对DELPHI开发不甚清晰的朋友有一定帮助。 BPL vs. DLL (原文http://www.delphi3000.com/ 翻译:房客) 第一部分:有关包的介绍 一般我们编写编译一个DELPHI应用程序时,会产生一个EXE文件,也就是一个独立的WINDOWS应用程序。很重要的一点:区别于Visual Basic,DELPHI产生的是预先包裹的应用程序是不需要大量的运行库(DLL's)。 假设:打开Delphi默认的工程(只有一个空白form),F9她将编译生成一个大约295 KB (Delphi 5)的可执行文件。然后打开Project | Options,把‘Build with runtime packages’选上再编译一下,EXE文件大小就只有15 KB左右了。 我们编译一个DELPHI应用程序时默认地没有选择'Build with runtime packages',编译器将把程序运行所需要的代码直接写入你的EXE文件中,因此产生的程序是一个相对独立的程序,并不需要任何附属的支持文件(例如动态运行库文件DLL),这也就知道了为什么DELPHI产生的应用程序为什么都那么大。 要建立尽可能小的DELPHI程序,方法之一就要充分发挥Borland

How can we connect with a website? Getting SSL error 1409442E

♀尐吖头ヾ 提交于 2020-03-16 06:22:17
问题 I am using Delphi 10.2 Tokyo, trying to download some information from a web server. I pass the command URL https://poloniex.com/public?command=returnCurrencies through this function using Indy 10.6.2.5366 (the command works if I paste it in a browser): function ReadHTTPS(const url: string): string; var IdHTTP: TIdHTTP; IdSSL: TIdSSLIOHandlerSocketOpenSSL; begin IdHTTP := TIdHTTP.Create; try IdSSL := TIdSSLIOHandlerSocketOpenSSL.Create(IdHTTP); IdHTTP.IOHandler := IdSSL; result := IdHTTP.Get

How can we connect with a website? Getting SSL error 1409442E

两盒软妹~` 提交于 2020-03-16 06:22:01
问题 I am using Delphi 10.2 Tokyo, trying to download some information from a web server. I pass the command URL https://poloniex.com/public?command=returnCurrencies through this function using Indy 10.6.2.5366 (the command works if I paste it in a browser): function ReadHTTPS(const url: string): string; var IdHTTP: TIdHTTP; IdSSL: TIdSSLIOHandlerSocketOpenSSL; begin IdHTTP := TIdHTTP.Create; try IdSSL := TIdSSLIOHandlerSocketOpenSSL.Create(IdHTTP); IdHTTP.IOHandler := IdSSL; result := IdHTTP.Get

How detect when a vcl style is changed?

限于喜欢 提交于 2020-03-16 05:57:14
问题 I use several WinAPi functions which needs the Handle of the form in order to work, due which the handle of the form is recreated when the vcl styles is changed many of the calls to these functions stop working. So I need a way to detect when the current vcl style is modified (changed) in order to update the calls to these functions.The question is How detect when a vcl style is changed? 回答1: When a vcl style is changed via the TStyleManager.SetStyle method a CM_CUSTOMSTYLECHANGED message is

How detect when a vcl style is changed?

China☆狼群 提交于 2020-03-16 05:57:11
问题 I use several WinAPi functions which needs the Handle of the form in order to work, due which the handle of the form is recreated when the vcl styles is changed many of the calls to these functions stop working. So I need a way to detect when the current vcl style is modified (changed) in order to update the calls to these functions.The question is How detect when a vcl style is changed? 回答1: When a vcl style is changed via the TStyleManager.SetStyle method a CM_CUSTOMSTYLECHANGED message is

How to look into generic tList during Delphi debugging

北城余情 提交于 2020-03-16 05:54:06
问题 I use Delphi 10.3.1 COMMUNITY version and can't look into generic tList while I debug the project. I know the latest version of Delphi doesn't support the old-typed debug feature which allows to look into generic tList. So I used tList.List in the following code to evaluate the tList. In tList<tRecord>.List I can look into it but can't do it in tList<Integer>.List . type tRecord = record Field: Integer; end; procedure TForm1.FormCreate(Sender: TObject); var _Record: tRecord; _List1: TList