文档介绍:开发人员开发DLL文件
规范说明(For Cute pet)
所需平台:
Windows 2000 Server + service pack 2
Visual Studio .NET beta2
项目引用文件:
(fake)——用于控制agent的动作。
——用于和主进程的通讯。
注意事项:
dll编写时应注意对客户端事件的响应,为了能使用户能终止dll的调用,必须经常检查client重的CR值,一但该值为false,即应该停止程序。
为了防止在运行一个dll时,另一个dll被调用,请在程序开始就设client的OP值为true,并在程序结束前设回false。
建议项目流程图:
初始化,设op,cr值
建线程调用Web Service
()
等待web service 返回,做空闲事件
处理web service结果,做回应事件
()
线程阻塞1秒,等待回应事件完成
退出,设op,cr值
false
false
true
finished
unfinished
true
finished
unfinished
示例如下:
using System;
using ;
namespace NAME
{
public class CLASSNAME
{
private static int status;//0-ready to start,1-running,2-end essfully,3-error occured
private static string HtmlContent ;
private static void FetchContent()
{
status=1;
try
{
myService=new ();
HtmlContent=();
status=2;
}
catch
{
status=3;
}
}
public static void MainProcess( agent, client)
{
(true);
status=0;
int mm=1;
try
{
Thread t=new Thread(new ThreadStart(CLASSNAME. FetchContent));
();
while (status<2 && ())
{
if (())
{
//Idle events
}