Can you lend a hand?
Newbie here ....trying to call a C# COM object (error is below):
****** C# DLL ********
namespace ECSLink
{
public class ECSInvoke
{
public void PrintString(string strName)
{
System.Console.WriteLine("Hello from COM");
}
}
}
Built via:
csc /target:library /out:ECSLink.dll ECSLink.cs
tlbexp ECSLink.dll /verbose
****** C Code *******
#import "ECSLink.tlb"
int main(int argc, char* argv[])
{
CoInitialize(NULL);
ECSInvokePtr ob;
ob->CreateInstance(__uuidof(ECSInvoke));
ob->PrintString();
return 0;
}
ERROR return from: cl client.cpp.....
client.cpp
client.cpp(6) : error C2065: 'ECSInvokePtr' : undeclared identifier
client.cpp(6) : error C2146: syntax error : missing ';' before identifier
'ob'
client.cpp(6) : error C2065: 'ob' : undeclared identifier
client.cpp(7) : error C2227: left of '->CreateInstance' must point to
class/struct/union
type is ''unknown-type''
client.cpp(7) : error C3861: 'ob': identifier not found, even with
argument-dependent lookup
client.cpp(8) : error C2227: left of '->PrintString' must point to
class/struct/union
type is ''unknown-type''
client.cpp(8) : error C3861: 'ob': identifier not found, even with
argument-dependent lookup