用反射调用dll带参数的方法
try
{
System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom(Application.StartupPath + "\\" + "EMR_iCareComponent.dll");
object obj = asm.CreateInstance("iCare.clsEMRLogin");
Type type = obj.GetType();
System.Reflection.MethodInfo mi = type.GetMethod("m_mthInit");
mi.Invoke(obj, new object[] { frmHRPExplorer.s_objMDIParent, frmHRPExplorer.CurrentLoginInfo });
}
catch (Exception ex)
{
string str = "iCare.clsEMRLogin初始化错误:" + Environment.NewLine + ex.Message + Environment.NewLine + ex.StackTrace + Environment.NewLine;
Exception e = ex.InnerException;
while (e != null)
{
str = e.Message + Environment.NewLine + e.StackTrace + Environment.NewLine;
e = e.InnerException;
}
new com.digitalwave.Utility.clsLogText().LogError(str);
}