Closed ericbourque29 closed 7 years ago
Hello. Could you share URL you have typed in the textbox?
I am also getting similar kind of issue.
So, tried to make it simple. I have not done anything extra just using TitaniumAS.Opc.Client project, trying to call OpcServerEnumeratorTests to check the server connection.
Every time I receive error: Unable to cast COM object of type 'System.__ComObject' to interface type 'TitaniumAS.Opc.Client.Interop.Common.IOPCServerList2'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{9DD0B56C-AD9E-43EE-8305-487F3188BF7A}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
or
Unable to cast COM object of type 'System.__ComObject' to interface type 'TitaniumAS.Opc.Client.Interop.Common.IOPCServerList'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{13486D50-4821-11D2-A494-3CB306C10000}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
--- Code ----
ComServer = DoComCall(comServer, "IUnknown::QueryInterface
Helllo! Possibly you have not installed OPCEnum service, try install Opc Core Components (https://opcfoundation.org/developer-tools/developer-kits-classic/core-components)
I had the same problem. In my case, the solution is:
Thank you @duckl1ng ! It is useful notice. The code really should be compiled under 32-bit architecture. We'll add a notification about it.
@duckl1ng I have created troubleshooting section in readme with you findings. ;)
Hello,
I tried using your project to make a small test app but I get this Exception when trying to connect...
\ Texte de l'exception ** System.Runtime.InteropServices.ExternalException (0x80040154): CoCreateInstanceEx: Classe non enregistrée
à TitaniumAS.Opc.Client.Interop.System.Com.CreateInstance(Guid clsid, String host, NetworkCredential credential) à TitaniumAS.Opc.Client.Common.OpcServerEnumeratorAuto.CLSIDFromProgId(String progId, String host) à TitaniumAS.Opc.Client.Da.OpcDaServer.<>cDisplayClass7.b 4(String host, String progId)
à TitaniumAS.Opc.Client.Common.UrlParser.Parse[T](Uri opcServerUrl, Func
3 withProgId, Func
3 withCLSID) à TitaniumAS.Opc.Client.Da.OpcDaServer.Connect() à OPCTester.Form1.button1_Click(Object sender, EventArgs e) dans C:\Users\EB.NIKLAS\Desktop\TitaniumAS.Opc.Client-master\TitaniumAS.Opc.Client-master\OPCTester\Form1.cs:ligne 32 à System.Windows.Forms.Control.OnClick(EventArgs e) à System.Windows.Forms.Button.OnClick(EventArgs e) à System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) à System.Windows.Forms.Control.WndProc(Message& m) à System.Windows.Forms.ButtonBase.WndProc(Message& m) à System.Windows.Forms.Button.WndProc(Message& m) à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)This is the simple code I used:
`using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using TitaniumAS.Opc.Client.Common; using TitaniumAS.Opc.Client.Da; using TitaniumAS.Opc.Client.Da.Browsing;
namespace OPCTester { public partial class Form1 : Form { OpcDaBrowserAuto browser;
}
Do you know what the problem might be?`