I have created MFC ActiveX project in VS 2010 using C++. I have added just one function "Add" to the project by clicking the Add method option in the menu that pops when you right click _DProjectname under ProjectnameLib in solution explorer.
SHORT CSampleProgramActivex01Ctrl::Add(SHORT a, SHORT b)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// TODO: Add your dispatch handler code here
return ( a + b);
}
Now I have created a simple C# console application that references the generated COM file and when I try to use the method, the application stops with the error: Catastrophic failure(Exception from HRESULT: 0x8000FFFF(E_UNEXPECTED)).
Does anybody can give me hint why I am running into this error