我需要使用最新的Indy组件库版本.我可以通过一些源代码命令或任何其他技巧来获取库版本,以确保我使用正确的库.我知道我正在使用indy....160.bpl- 这是我的Delphi XE2在将鼠标移到组件栏上时所说的.我从Fulgan Indy采取的最新INDY lib
VCL 不是线程安全的。因此,我想在 INDY 10 TCPserver.execute(...) 函数中将信息写入 gui 不是一个好主意。
如何将信息从服务器执行发送到 VCL?
我需要修改一个tcpserver.execute函数内的 TBitmap 。如何使该线程安全?
如何初始化一个数组
TMyArray = array[1..2, 1..3] of Integer;
Run Code Online (Sandbox Code Playgroud)
我试过了
MyArray : TMyArray;
MyArray = ( (1,2,3), (3,4,5) );
Run Code Online (Sandbox Code Playgroud)
但这种风格没有任何运气......
我正试图在我的计算机上列出所有正在运行的进程.
EnumWindowsProc()我的简短示例代码中的调用语句有什么问题.我的编译器声称,在这一行:
EnumWindows(@EnumWindowsProc, ListBox1);
Run Code Online (Sandbox Code Playgroud)
在函数调用中需要一个变量.我应该如何更改@EnumWindowsProc为var?
unit Unit_process_logger;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
Vcl.ExtCtrls, Vcl.StdCtrls;
type
TForm1 = class(TForm)
ListBox1: TListBox;
Timer1: TTimer;
procedure Timer1Timer(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
function EnumWindowsProc(wHandle: HWND; lb: TListBox): Boolean;
var
Form1: TForm1;
implementation
{$R *.dfm}
function EnumWindowsProc(wHandle: HWND; lb: TListBox): Boolean;
var
Title, ClassName: array[0..255] of Char;
begin
GetWindowText(wHandle, Title, 255);
GetClassName(wHandle, ClassName, 255);
if IsWindowVisible(wHandle) then
lb.Items.Add(string(Title) + '-' …Run Code Online (Sandbox Code Playgroud) 当我尝试运行以下简单的代码序列时,我收到Abstract Error错误消息:
type
TForm1 = class(TForm)
Image1: TImage;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure TForm1.Button1Click(Sender: TObject);
var
ImageStream: TStream;
begin
ImageStream := TStream.Create;
Image1.Picture.Bitmap.SaveToStream(ImageStream);
...
end;
Run Code Online (Sandbox Code Playgroud)
我需要提取一个流以TBitmap供以后处理......我做错了什么?
我使用以下代码来评估msg.使用INDY 10组件收到的E Mail消息的内容(正文/行)
function LinesFromMsg(aMsg: TIdMessage): TStrings;
var
i: Integer;
begin
for i := 0 to aMsg.MessageParts.AttachmentCount-1 do
begin
if (amsg.MessageParts.Items[i].ContentType ='HTML') then
begin
if (amsg.MessageParts.Items[i] is Tidtext) then
Result := TidText(amsg.MessageParts.Items[i]).body;
end;
end;
end;
Run Code Online (Sandbox Code Playgroud)
关于这段代码我有两个问题:
a)这是在仲裁邮件中找到Tlines部分的正确方法吗?(考虑INDY 10 EMAIL MSG PARTS上显示的建议)
b)我在哪里可以找到所有不同Contenttype字符串值的教程?
我很难理解IDSYNC和IDNOTIFY之间的真正区别,对于我编写的代码行,什么意味着同步/异步?
procedure TForm1.IdTCPServerExecute(AContext: TIdContext);
begin
....
DoSomeThing (TIDNotify) ....
DoSomethingOther(TIDsync) ......
end;
Run Code Online (Sandbox Code Playgroud)
为什么我不确定这两行代码是否在TCPServer Execute函数中执行?是否存在在我的TIDSynfunction中没有执行几行代码或者如何解释Deadloack的风险?
我希望使用Sender作为TObject作为我的case ...语句的选择标准
procedure TForm.ShowGUI (Sender: TObject);
begin
case sender of
ToolButton1: begin
do_something;
end;
ToolButton2: begin
///
end;
ToolButton3: begin
do_stufff_here;
end;
ToolButton3: begin
///
end;
else ;
end;
end;
Run Code Online (Sandbox Code Playgroud)
根据case语句的要求使发件人成为序数类型的技巧?
在我的编程团队中,我们都使用Delphi XE2 Professional.我们只是发现在不同的计算机上可以使用不同数量的VCL样式.
VCL风格来自哪里?我是否必须小心将样式从一个Delphi安装移动到另一个?
我目前正在使用这样输入的通用列表:
List: TList<TPoint>;
Run Code Online (Sandbox Code Playgroud)
List作为一种替代方案,我希望能够拥有三个坐标:
type
TPoint3D = record
x, y, z: Integer;
end;
Run Code Online (Sandbox Code Playgroud)
我想宣布这样的事情:
List: TList<TCanBeEitherTPointOrTPoint3D>;
Run Code Online (Sandbox Code Playgroud)
当然这不起作用,但我不知道什么会起作用!