简体   繁体   English

在C#.net中使用VB6 dll

[英]Using VB6 dll in c#.net

I am using vb6 dll in c#.net. 我在c#.net中使用vb6 dll。 It is working properly but when I host it on iis then it shows an error 它工作正常,但是当我在iis上托管它时显示错误

S**ystem.Runtime.InteropServices.COMException: Unable to show modal form within this context**

I am using VB6 dll in following way first register it, then add reference in my project and use it 我以以下方式使用VB6 dll:首先注册它,然后在我的项目中添加引用并使用它

How can I solve that problem? 我该如何解决这个问题?

Don't show dialogs or message boxes on a web server. 不要在网络服务器上显示对话框或消息框。 If that error wasn't checked, somebody would have to break into the server room to click the OK button. 如果未检查该错误,则必须有人进入服务器机房才能单击“确定”按钮。

There is the compiler option "unatteded execution" in vb6 forcing it to suppress message boxes and error messages. vb6中有一个编译器选项“无保留执行”,强制它禁止显示消息框和错误消息。 Compile it that way and vb6 writes such output to the event log. 以这种方式进行编译,vb6将此类输出写入事件日志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM