c#

C#からExcelを開く

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Microsoft.Office.Interop; using Excel = Microsoft.Office.Interop.Excel; using System.IO; using System.Runtime.Interop…

C++のクラスをC#で継承する。swig使用。

まさかこんなことができるとは思っていなかった。 やりたいこと C++で定義されたコードをC#で継承してい使用する。 参考 http://www.swig.org/Doc1.3/CSharp.html cpp class Base { public: virtual ~Base() {} virtual void tell() const = 0; }; class Cal…

std::vector<T>をC#から使えるようにする。

swigを使用。 SwigSample.i %include std_vector.i %template(VectorDouble) std::vector<double>; のようにすればよい。C#でVectorDoubleという名前でstd::vectorが使用できるようになる。あとはいつも通り swig -csharp -c++ SwigSample.i</double>

C#で作ったdllをExcel/VBAから呼び出す方法。

c#

参考 Excel から使うマネージDLL を作る。 | supermab's blog 課題 関数にsummaryを書き、xmlを生成したが、Excel/VBAでは表示されない。 下記のコードの意味がよく分からない。 [ComRegisterFunctionAttribute] private static void RegisterFunction(Type …