如何为我的DLL创建托管头文件

问题描述:


我有一个使用C#(.Net 4.0)开发的桌面应用程序.我需要创建一个将由两个应用程序使用的DLL,
1)使用C#(.Net 4.0)开发的应用程序
2)使用VC6.0开发的应用程序

这个怎么做.我听说将DLL头文件转换/导入到托管头文件中可以解决此问题.如何将我的DLL头文件转换/导入到托管头文件中?

问候,
Sankar.

Hi,
I have a desktop application developed using C# (.Net 4.0). I need to create a DLL which will be used by two applications,
1) Application developed using C# (.Net 4.0)
2) Application developed using VC6.0

How to do this. I heard converting/importing my DLL header file into a managed header file would solve this. How to convert/import my DLL header file into a managed header file?

Regards,
Sankar.

如果您想同时在.net和VB6中使用dll,则必须开发COM可见的.net dll.
在C#中构建COM对象 [ http://www.geeksengine.com/article/create-dll.html [ ^ ]
这是完整的指南,您只需在Google上搜索"com interop .net vb6",就会发现更多结果
http://support.microsoft.com/kb/817248 [
wel if you want to use dll in both .net and VB6 then you have to develop COM visible .net dll.
Building COM Objects in C#[^]
http://www.geeksengine.com/article/create-dll.html[^]
and here are complete guidelines and you can simply google "com interop .net vb6" and you will find a lot more results
http://support.microsoft.com/kb/817248[^]