[英]Porting C++ code to Silverlight
I have C++ application which has UI developed using MFC, does some networking using sockets (using boost libraries) and some image processing. 我有C ++应用程序,它使用MFC开发UI,使用套接字(使用boost库)进行一些网络连接和一些图像处理。 I want to move this application into Silvelight framework (I can use 4.0 if required) so that it can be used over the internet easily.
我想将此应用程序移动到Silvelight框架中(如果需要,我可以使用4.0),以便可以轻松地在Internet上使用它。 Here I want to move all parts (UI + networking etc) in to C# but keep the image processing code in unmanaged C++ only.
在这里,我想将所有部分(UI +网络等)移动到C#中,但仅将图像处理代码保留在非托管C ++中。 I don't know .NET framework yet, but whatever I have read so far suggests that it is not possible to call the unmanaged code from a silvelight web application.
我还不知道.NET框架,但到目前为止我所阅读的内容表明,无法从一个非常简单的Web应用程序中调用非托管代码。 Is my understanding correct?
我的理解是否正确? Can something be done to achieve what I am trying to do?
可以做些什么来实现我想做的事情? Also, if somebody has some suggestions on how to go about porting the code?
另外,如果有人对如何移植代码有一些建议?
Silverlight 4 supports COM when running in trusted mode. 在受信任模式下运行时,Silverlight 4支持COM。
I'd suggest using WPF instead of Silverlight if possible. 如果可能的话,我建议使用WPF而不是Silverlight。 With WPF you'd be able to reuse your C++ as is because desktop .NET / unmanaged interop is very good (P/Invoke or CLI/C++).
使用WPF,您可以按原样重用C ++,因为桌面.NET /非托管互操作非常好(P / Invoke或CLI / C ++)。
Otherwise you are stuck porting your C++ to managed code, which could prove to be laborious and the resulting code inefficient. 否则,您无法将C ++移植到托管代码,这可能会很费力并且导致代码效率低下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.