titanium-as / TitaniumAS.Opc.Client

Open source .NET client library for OPC DA
MIT License
193 stars 94 forks source link

OpcDaItemResult.Error.Failed - 'FAILED' is ambiguous #32

Open TheMadHatt3r opened 6 years ago

TheMadHatt3r commented 6 years ago

I am unable to read the result of a .AddItems() call. The OpcDaItemResult.Item object is fine. Both OpcDaItemResult.Error.Failed or OpcDaItemResult.Error.Success Cause an error in VS 2015 VB.NET,

BC31429 'FAILED' is ambiguous because multiple kinds of members with this name exist in structure 'HRESULT'.

I am unable to effectively follow your example code because result.Error.Failed will not compile with above issue.

OpcDaItemResult[] results = group.AddItems(definitions);
// Handle adding results.
foreach (OpcDaItemResult result in results)
{
    if (result.Error.Failed)
        Console.WriteLine("Error adding items: {0}", result.Error);
}

Any advice on the issue here? I am using 1.0.2 of your DLL.

TheMadHatt3r commented 6 years ago

Hmmm, more research shows that VB.NET is not case sensitive... While C# is. This is very frustrating, that being said, it looks like your class is not CLS compliant, any chance of that changing in the future? Or at lease put something in your readme to warn people not to start the project in VB.

https://stackoverflow.com/questions/3491801/vb-net-ambiguous-class-name-error-when-no-ambiguity-exists