如何将C#窗口(窗体)句柄传递给VB6项目或表单?
问题描述:
We have an application where we launch a VB modal dialog from a c# form on a button click. Even though the VB dialog is a modal window we are able to go back to C# dialog on click and then the application hangs.
Looks like the VB6 form does not have a parent and hence the issue. So we decided to pass the form handle from c# to VB and make our c# dialog as a parent to the VB dialog. Any help or a sample code would be really appreciated. Thanks.
答
好吧,VB6的一个可选参数 Form.Show方法 [ ^ ]是拥有表单的STRING表示。我不知道你将如何从C#中使用它,或者它是否可能。
说真的,用C#重写愚蠢的形式并保存所有的尝试与VB6互操作的麻烦。
Well, one of the optional parameters of the the VB6 Form.Show method[^] was a STRING representation of the owning form. I have no idea how you're going to use this from C#, or if it's even possible.
Seriously, rewrite the stupid form in C# and save yourself all the trouble of trying to interop with VB6.