I have an application written in c++ which uses Excel to display data. Also I have written addins for Excel in vsto.
Now I want to send a event to my c++ application about addin click.
To achieve that I have written com interface in c++. And now I want to set the object for that class in vsto c# dll so that I can call a method from my c++ application.
Excel::_ApplicationPtr &app;
CComObject<TestEvent> *obj = new CComObject<TestEvent>;
obj->Init(this);
variant_t v = static_cast<IDispatch *>(obj);
app->Run("SetEventSinkTest", v);
Can I call SetEventSinkTest method written in c++ from my C# dll. I have launch Excel process from c++ application which has the vsto addin written in c#. I want to get Excel addin click event back to the c++ application.
To achieve this I have a com object of class TestEvent whose pointer will be set in C# vsto dll. on addin click event I will execute a function from TestEvent class whose object I want set in vsto c# project.
Can this is possible in com and VSTO