问题描述
- 急啊!!C# 动态库调用问题
-
调用别人的动态库,窗体模式下可以调用成功,有返回值;
[DllImport("lisreportdll.dll", EntryPoint = "f_lisinit")]
private static extern int f_lisinit(string as_connectstring, string as_printer, string as_hosname);实现:
public int lisinit(string connectstring, string printer, string hosname)
{
int isok= f_lisinit(connectstring, printer, hosname);
return isok;}
窗体按钮:
private void button1_Click(object sender, EventArgs e)
{
int i = lisinit("111","","");
}这里设断点,int isok= f_lisinit(connectstring, printer, hosname);
有返回值但是用控制台应用程序却不行,一直卡在方法那里!
static void Main(string[] args)
{
int i = lisinit("111","","");
Console.WriteLine(i);
Console.ReadKey();
}
时间: 2024-10-03 02:32:56