I have a C# Dll Registered as COM Interop:
[Guid("B41C2229-DBBD-4614-AE28-BFAE82B10F20")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface ITestCls
{
[DispId(1)]
string test(string input);
}
[Guid("5E88B6B8-AE17-40A0-917A-51DEBD818145")]
[ClassInterface(ClassInterfaceType.None)]
[ProgId("TestNm.TestCls")]
public class TestCls : ITestCls
{
public string test(string input)
{
Console.WriteLine("INSIDE CS :: ");
return "CS :: ARE YOU TESTING WITH THIS INPUT " + input;
}
}
I tried to call the same from my C++ code :
CoInitialize(NULL);
std::cout << data << '\n';
_bstr_t bstrt(data);
BSTR lResult;
CComQIPtr<IWPrint> iWrapClass;
HRESULT hresult;
hresult = iWrapClass.CoCreateInstance(L"TestNm.TestCls");
printf("0x%08lx", hresult);
if (SUCCEEDED (hresult))
{
iWrapClass->test(bstrt,&lResult);
wprintf(L"Response %s\n", lResult);
}
CoUninitialize();
return lResult;
Everything works fine from my developer machine when I run the same from other machine HRESULT give me this :
0x800401f3
Am I missing some registering ?
Thanks
A few things to try while troubleshooting:
RegAsm.exe /codebase
(a strong assembly name is required for that).yes looks like (regasm) it or perms see walkthru
User contributions licensed under CC BY-SA 3.0