我有一个庞大的应用程序是由COM +对象,我想跟踪/记录这些组件的事件调用.目的是找出问题和改造那种方法.我已经找到了一些API的文档,如http://msdn.microsoft.com/pt-br/library/dd179218(v=VS.85).aspx,但我唯一能做的就是获取池名称在com +中.
我正在使用python4delphi.如何从包装的Delphi类函数返回一个对象?
代码片段:
我有一个简单的Delphi类,我将其包装到Python脚本中,对吧?
TSimple = Class
Private
function getvar1:string;
Public
Published
property var1:string read getVar1;
function getObj:TSimple;
end;
...
function TSimple.getVar1:string;
begin
result:='hello';
end;
function TSimple.getObj:TSimple;
begin
result:=self;
end;
Run Code Online (Sandbox Code Playgroud)
我使用了类似于demo32的TPySimple来提供对Python代码的类访问.我的Python模块名称是test.
TPySimple = class(TPyDelphiPersistent)
// Constructors & Destructors
constructor Create( APythonType : TPythonType ); override;
constructor CreateWith( PythonType : TPythonType; args : PPyObject ); override;
// Basic services
function Repr : PPyObject; override;
class function DelphiObjectClass : TClass; override;
end;
...
{ TPySimple }
constructor TPySimple.Create(APythonType: TPythonType);
begin
inherited;
// we …
Run Code Online (Sandbox Code Playgroud) Somoene知道我是否可以在一台显示器中设置我的IDE显示源代码而在另一台显示器中设置我的IDE?我谈论相同的.pas,因为我可以在每个显示器中查看2个不同的.pas.
我想使用各种类型的开放数组(例如:)['string',12,123.21]
.在我搜索期间,我发现了两种方法.一个是array of TVarRec
和另一个是使用varArray
.我认为TVarRec数组是最好的选择,因为它似乎更轻量级,另一方面varArray已经有一些我必须创建的实现,如果我想使用TVarRec数组.
有人对这两种使用方式有什么看法吗?