从C ++ exe调用时窗口窗体(GUI)(C#)挂起 [英] windows forms(GUI) (C#) hangs when called from C++ exe

查看:62
本文介绍了从C ++ exe调用时窗口窗体(GUI)(C#)挂起的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在为仅支持c ++的第三方软件开发C ++ / CLI插件。



我的C ++ / CLI插件是第三方软件和我已经开发的c#代码之间的接口。



C ++ / CLI调用C#GUI API。 />


我的C#代码生成如下表格:



Hi,

I am developing C++/CLI Plugin for Third party software which supports only c++.

My C++/CLI plugin is working as interface between this third party software and my already developed c# code.

C++/CLI calls C# GUI API .

My C# code generates form as follows:

if (mTestUI == null)
 {
   mTestUI = new TestUI(mCFDocument, mClientGraphics);
   Application.Run(mTestUI);
 }





TestUI继承自Windows窗体,如下所示:



TestUI is inherited from windows form as follows:

public partial class TestUI : Form





当Application.Run(mTestUI)执行第三方exe并生成表单时,挂起。



我无法找到原因。我可以理解第三方软件是挂起的,因为控件是我生成的表格。



但这个表格正在挂起?



这个相同的代码与支持C#接口进行插件开发的其他第三方软件一起正常工作。



when Application.Run(mTestUI) executed both third party exe and generated form get hang.

I am unable to find reason. I can understand third party software gets hang, as control is with my generated form.

But this form is getting hang ?

this same code is working fine with other third party software which supports C# interface for plugin development.

推荐答案

这是一个线程问题。



小心在单独的帖子中启动你的应用程序。
it is a thread issue.

Be care to launch your app in a separate thread.


这篇关于从C ++ exe调用时窗口窗体(GUI)(C#)挂起的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆