string strSource; //从仪器接收到的原始数据
string strResult = ""; //检验结果字符串
string strReserved = ""; //本次未解析完的数据
string strCmd = ""; //应答指令
strSource = "xxxx";
//获取COM类型
Type type = Type.GetTypeFromProgID("zlLISDev.clsLISDev_ABL800");
//创建COM类型示例
object instance = Activator.CreateInstance(type);
//参数构造
//注意:需要通过ParameterModifier显示指定哪些参数是引用类型
object[] args = new object[] { strSource, strResult, strReserved, strCmd };
ParameterModifier argsMod = new ParameterModifier(4);
argsMod[1] = true;
argsMod[2] = true;
argsMod[3] = true;
ParameterModifier[] mods = { argsMod };
//反射调用方法
type.InvokeMember( "Analyse", BindingFlags.InvokeMethod, null, instance, args, mods, null, null);
regsvr32 zlLISDev.dll
TlbImp.exe zlLISDev.dll /namespace:zlLISDev /out:Interop.zlLISDev.dll