111,125
社区成员
发帖
与我相关
我的任务
分享
public class Class1
{
[DllImport("fzyktclient.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
public static extern int ykt_opendevice(int devicetype, int com, int baud, ref string region, ref string warnmsg, ref string errmsg);
}
string str_region = "3403";
string ls_warnmsg = "";
string ls_errmsg = "";
static int li_result;
int gi_ndevicetype = 10;
int gi_ncom = 9;
int gi_nbaud = 3;
try
{
li_result = Class1.ykt_opendevice(gi_ndevicetype, gi_ncom, gi_nbaud, ref str_region, ref ls_warnmsg, ref ls_errmsg);
}
catch (ExecutionEngineException ex)
{
MessageBox.Show(ex.ToString());
}