Using C # in a heavy COM application

I would like to use C # for the application that I am building, but the application makes heavy use of automation (i.e. Excel, Word).

Is it possible to use C # for such an application? It used to be a nightmare for using languages ​​like C for things like parameter lists with null arguments, etc.

What are some tips to help make things easier or should I just stick with VB.NET?

+4
source share
2 answers

It depends on which version of the language you are using. In .Net 4, C # supports named parameters (optional parameters). VB.Net has always had this. If you are not using .Net 4, I would recommend using VB.Net for the interop bit - see this post from Scott Hanselman for an example.

+1
source

Wait for C # 4, which supports optional parameters and implicit ref arguments.
It will make your life easier.

If you are using C # 4 or C # 3, you must use Office Interop Extensions from VSTO Power Tools ; they will make your life even easier.

0
source

Source: https://habr.com/ru/post/1302138/


All Articles