易截截图软件、单文件、免安装、纯绿色、仅160KB

Delphi字符串、PChar与字符数组之间的转换

Delphi字符串、PChar与字符数组之间的转换
设有以下三个变量:
var
s:string;
p:pchar;
a:array[1..20] of char;
那么三者之间的转换如下:
1、字符串到PChar
    p:=PChar(s);
2、PChar到字符串
    s:=p;
3、PChar到字符数组
    StrCopy(@a,p);
4、字符数组到PChar
    PChar(@a);
5、字符串与字符数组之间的转换就只有通过PChar来中转了。例如下面这个例子:
procedure TForm1.btn1Click(Sender: TObject);
var
str:array[1..10] of char;
begin
StrCopy(@str,PChar(mmo1.Text));
mmo2.Text:=PChar(@str);
end;


相关文档:

delphi引入ActiveX控件报coreide70.bpl错误解决办法

    今天在大理剑川做监控联网工程,遇到2台DIY的PC-DVR,联网很不顺利。机器的软件是盗版破解的,只破解了服务器端,客户端未破解,还有就是版本也不对。最后发现软件下有一ActiveX控件可以做联网使用,于是想把这个OCX引入项目软件工程。在引入的时候delphi提示coreide70.bpl报错,错误代码:00000019 ......

Delphi 资源


 关于IntraWeb程序在编译时出现错误的解决方法
错误提示:[Error] IWLicenseKey.pas(12): Undeclared identifier: 'SetLicenseKey'
处理方法:进入菜单Tools->Environment Options,选择‘Library’,将'Library path'参数中有关intraweb的目录放在前面即可。
使用&n ......

Delete Delphi temporary file

Rem Delete Delphi temporary file
Rem ****************************
@echo Delete Delphi temporary file
@dir/w/s *.~*
@echo 以上为当前目录及子目录临时文件,请按任意键确认删除!
@pause
@for /r . %%a in (.) do @if exist "%%a\*.~*" del "%%a\*.~*"
@echo 删除成功!
@pause
Rem ************************* ......

Delphi关联文件扩展名

unit unitMain;
interface
uses
Registry, shlobj,
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TExtForm = class(TForm)
ledExtension: TLabeledEdit;
ledAssocApp: TLabeledEdit;
GetAssocApp: TButton;
AssocTh ......

Delphi中利用MSCOMM控件进行GPS数据采集

1、准备
  GPS(Global Positioning System),即全球定位系统,利用24颗GPS卫星的测距和测时功能进行全球定位,在许多系统中,如机场导航系统,出租车辆管理和调度系统、江河流域的灾害信息管理和预测系统中,GPS得到了广泛的应用。本文利用MSCOMM控件实现了GPS数据的采集,可为信息管理和指挥调度等提供定位数据。
  ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号