2013年2月19日 星期二

C# DLL COM


from http://www.cppblog.com/mzty/archive/2007/05/29/25043.html
http://www.codeproject.com/Articles/12673/Calling-Managed-NET-C-COM-Objects-from-Unmanaged-C




Steps to create a Managed .NET C# COM Object:

1. Open VS.NET2003->New Project->Visual C# Projects->Class Library.
2. Project name: MyInterop.
3. Create MyDoNetClass.cs file, and add the following lines of code:
using System.Runtime.InteropServices;
using System.Windows.Forms;
4. Create an Interface IMyDotNetInterface.
5. Create a class MyDoNetClass.
6. Add the following line for MyDotNetClass:
[ClassInterface(ClassInterfaceType.None)]

0 意見:

張貼留言

 

MangoHost Copyright © 2009 Cookiez is Designed by Ipietoon for Free Blogger Template