使VC ++项目和VC#项目相互交互 [英] making VC++ project and VC# project interacting with each other
问题描述
大家好,
我正在尝试提出一项申请.我用vc ++编写了所有代码,一切正常..但是现在我必须为应用程序制作UI..
我没有关于C#,MFC,win32的任何知识.这就是为什么我去c#的原因,因为我认为vc#会很容易做到这一点.
但是现在的问题是如何使两个项目同步进行.我知道它的体系结构很差.如果我将所有代码都移植到c#中或使用win32,MFC创建UI,效果会更好.
如果可以的话,我只是在尝试一个机会..以使其发挥作用.
我还要添加的一件事是,我要保持将值从UI传递到C ++文件,反之亦然.可以使用dll,因为我正在尝试该选项?
命名管道
MSMQ
TCP/IP
ActiveMQ
tush_2003写道:我还要添加的另一件事是,我一直保持将值从UI传递到C ++文件,反之亦然. dll被使用,因为我正在尝试该选项?
两个选择:使用PInvoke ^ ]在C#GUI应用程序中以访问C ++ dll中的方法,或编写托管的c ++包装器 [ ^ ]围绕您的C ++ dll.
PInvoke可能是最简单的方法,包装器最有效.
hi all,
i am trying to make one application. i write all the code in vc++ its working fine..But now i have to make UI for the application..
i dnt have any knowledge about C#, MFC, win32.. thats why i went wid c#,as I thought vc# will be easy to make that.
but now the problem is how to make both projects work in synch. I know its a bad architechture.. n it will be better if either i port all the code in c# or use win32, MFC to create UI...
i am just taking a chance if there is any way.. to make it work.
One more thing i will like to add is i hav to keep passing the values from UI to the c++ files and viceversa.. can dll be used, as i am trying that option???
Named Pipes
MSMQ
TCP/IP
ActiveMQ
tush_2003 wrote:One more thing i will like to add is i hav to keep passing the values from UI to the c++ files and viceversa.. can dll be used, as i am trying that option???
This is probably your best option it will certainly perform the best.
Two choices: use PInvoke [^] in your C# GUI app to access methods in your C++ dll, or write a managed c++ wrapper[^] around your C++ dll.
PInvoke is probably the simplest approach, the wrapper the most efficient.
这篇关于使VC ++项目和VC#项目相互交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!