跨语言用法 [英] Cross Language usage
问题描述
朋友,我有大量的C#源代码.是否可以在使用MFC的.NET中使用它.如果不是MFC,是否可以在Visual C ++ NET中使用C#代码?无论是托管C ++还是MFC,我都可以实例化C#类并使用它吗?
顺便说一句,我在这里提到的C#代码与TIFF图像读取和写入有关.如果有兴趣,可以从 www.bitmiracle.com [< ^ ].在这里您还可以在JPEG上找到某些内容(尽管我尚未下载JPEG代码).
谢谢了,
拉杰斯瓦里
Friends I have a vast C# source code. Is it possible to use it in .NET (that uses MFC). If not MFC, can the C# code be used in Visual C++ NET? Either Managed C++ or MFC, can I instantiate the C# class(es) and use?
By the by, the C# code I have mentioned here is related to TIFF image reading and writing. If interested you can download from www.bitmiracle.com[^]. There you can also find something on JPEG (though I haven''t downloaded the JPEG code).
With thanks,
Rajeswari
推荐答案
是的,您可以在托管或非托管C ++中使用它: ^ ]
Yes, you can use it from managed or unmanaged C++: How to call C++ code from Managed, and vice versa (Interop)[^]
以下是一些可以帮助您的链接:
从非托管C ++代码调用托管.NET C#COM对象 [ ^ ]
在没有Regasm的情况下从非托管到托管的调用(从C ++到C#) [从C ++调用C#代码,然后读取包含字符串的结构数组 [分步:调用C ++ VC ++和VB中的DLL-第1部分 [
And here are few more links to help you:
Calling Managed .NET C# COM Objects from Unmanaged C++ Code[^]
Unmanaged to Managed calls (C++ to C#) without Regasm[^]
Call C# code from C++ and read an array of struct which contains strings[^]
Step by Step: Calling C++ DLLs from VC++ and VB - Part 1[^] - The whole series of this is good for beginners
这篇关于跨语言用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!