简体   繁体   中英

How can I test a COM interface implemented in .NET?

I have written a COM interface in C#. I then tried to write a simple application that references it so that I can test the COM interface, however Visual Studio does not allow COM interfaces to be referenced if they have been written in C#.

Is there any way to get around this? If not, which language is likely to be the easiest for me to accomplish my task?

I would suggest the Excel VBA editor for this.

Open Excel, hit Alt + F11 to invoke the VBA editor.

Create a new module, go to Tools -> References, find your COM object in the list, and check the box.

You should then be able to create an object, and test your interface is working.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM