Excel-DNA Vs COM (for C++ - via c#)

Jul 16, 2012 at 11:11 PM

I'm very new to Excel-DNA, I got it working and I'm very impressed.

i have lot of C++ code, which is currently used through a thin layer COM. I really like to use excel-dna.

My question is, is it worth for me writing some C# around the C++ dll to use within excel-dna? i.e. would there be any performance issues? can all objects be created as passed on as normal?

I'm not a super expert and would really appreciate your input. COM is fine but I find it really ugly and that's why I want to move away from it. but is there any advantages on COM I should know? (I wouldn't want to regret later after switch).

My code base at work is definitely C++ and will stay that way - so rewriting everything in C# is no option.

 

THANK YOU!

 

Coordinator
Jul 17, 2012 at 7:55 PM
Edited Aug 11, 2012 at 11:21 PM

Hi,

If you want to stay with everything in C++, then Excel-DNA and .NET are not the right tools for you. I suggest you evaluate the following C++ -based add-in libraries:

Another approach (probably what I would do in your situation) is to use C# and .NET with Excel-DNA for all the Excel-specific integration. Then you can leave the core computation code in a C++ library, for which you either make a C-style interface to that you access from C# via P/Invoke, or use the C++/CLI support to make a .NET-friendly wrapper.

But if the Excel integration code will remain in C++ then introducing .NET adds complexity with little value, and the above toolkits will put you on the right path.

Regards,

Govert

Jul 18, 2012 at 8:59 PM

Hi Govert, many thanks for your response, really appreciate it.