在ISAPI程序和客户端,自己定义了一个简单的线程类,代码如下:type
TMyThread = class(TThread)
private
FCDS: TClientDataSet;
protected
procedure Execute; override;{ 执行线程的方法 }
public
constructor Create(CDS: TClientDataSet); virtual;
end;{ TMyThread }constructor TMyThread.Create(CDS: TClientDataSet);
begin
FCDS := CDS; //参数中的CDS赋给线程类的私有变量FCDS
FreeOnTerminate := False;
inherited Create(True);
end;procedure TMyThread.Execute;
begin
inherited;
try
FCDS.Open; //在线程中打开数据集:此处出错
except
ShowMessage('线程发生异常'); { 线程异常 }
end;
end;在运行中:
FCDS.Open; //在线程中打开数据集:此处出错
这一行出错,错误提示: project project1.exe raised exception with message 'Microsoft MSXML is not installed" process stopped. Use Step or Run to continue
TMyThread = class(TThread)
private
FCDS: TClientDataSet;
protected
procedure Execute; override;{ 执行线程的方法 }
public
constructor Create(CDS: TClientDataSet); virtual;
end;{ TMyThread }constructor TMyThread.Create(CDS: TClientDataSet);
begin
FCDS := CDS; //参数中的CDS赋给线程类的私有变量FCDS
FreeOnTerminate := False;
inherited Create(True);
end;procedure TMyThread.Execute;
begin
inherited;
try
FCDS.Open; //在线程中打开数据集:此处出错
except
ShowMessage('线程发生异常'); { 线程异常 }
end;
end;在运行中:
FCDS.Open; //在线程中打开数据集:此处出错
这一行出错,错误提示: project project1.exe raised exception with message 'Microsoft MSXML is not installed" process stopped. Use Step or Run to continue
解决方案 »
- delphi 16进制字符串运算
- 最近机器莫名其妙死机,难道跟Windows2003 SP2有关?
- 关于父窗体关闭的问题
- 一个空的无窗体的.pas文件可以自己创建一个Adoquery对象和数据库交互吗?
- 高手来
- 高手讲解一下VB的Delphi之间有什么差别
- 关于Tquery控件的字段长度的问题
- 如何取得tdxtreelist所有结点的数目,并遍历一遍?
- 关于Socket的一个基本问题
- clientdataset过滤使用like 语句 ,出现type mismatch inexpression .安装delphi2010后又可以什么原因
- delphi自动填写上传图片的问题 急!!!
- 求登陆的代码,要求delphi写的
例如:procedure TMyThread.Execute;
begin
//inherited; 这一行不需要
CoInitializeEx(Nil, COINIT_MULTITHREADED);
try
try
FCDS.Open; //在线程中打开数据集:此处出错
except
ShowMessage('线程发生异常'); { 线程异常 线程里面不能使用ShowMessage,否则可能显示不出来}
end;
finally
CoUninitialize;
end;
end;
另外一个帖麻烦帮我再看下:http://topic.csdn.net/u/20081212/08/07157dfd-7a08-4666-a50d-4eaa8adb6ea7.html