QuickOPC User's Guide and Reference
_UAEndpointDialog Interface
Members  Example 



OpcLabs.EasyOpcForms Assembly > OpcLabs.EasyOpc.UA.Forms.Browsing.ComTypes Namespace : _UAEndpointDialog Interface
Exposes OpcLabs.EasyOpc.UA.Forms.Browsing.UAEndpointDialog to COM clients.
Object Model
_UAEndpointDialog InterfaceEasyUAClientSelector ClassUADiscoveryElement ClassUAEndpointDescriptor Class
Syntax
'Declaration
 
<CLSCompliantAttribute(False)>
<ComVisibleAttribute(True)>
<GuidAttribute("3BD24237-FB61-4891-8627-EF6A71D29C87")>
<InterfaceTypeAttribute(ComInterfaceType.InterfaceIsDual)>
Public Interface _UAEndpointDialog 
'Usage
 
Dim instance As _UAEndpointDialog
[CLSCompliant(false)]
[ComVisible(true)]
[Guid("3BD24237-FB61-4891-8627-EF6A71D29C87")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface _UAEndpointDialog 
[CLSCompliant(false)]
[ComVisible(true)]
[Guid("3BD24237-FB61-4891-8627-EF6A71D29C87")]
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface class _UAEndpointDialog 
Example

COM

// This example shows how to let the user browse for an OPC-UA server endpoint.

#include "stdafx.h"    // Includes "QuickOpc.h", and other commonly used files
#include "ShowDialog.h"

namespace _UAEndpointDialog
{
    void ShowDialog1::Main()
    {
        // Initialize the COM library
        CoInitializeEx(NULL, COINIT_MULTITHREADED);
        {
            // 
            _UAEndpointDialogPtr EndpointDialogPtr(__uuidof(UAEndpointDialog));

            //
            EndpointDialogPtr->DiscoveryHost = L"opcua.demo-this.com";

            // 
            DialogResult dialogResult = EndpointDialogPtr->ShowDialog(NULL);
            _tprintf(_T("%d\n"), dialogResult);

            if (dialogResult == 1/*OK*/)
            {
                // Display results
                _tprintf(_T("%s\n"), (LPCTSTR)CW2CT(EndpointDialogPtr->DiscoveryElement->ToString));
            }
        }
         // Release all interface pointers BEFORE calling CoUninitialize()
        CoUninitialize();
    }
}
// This example shows how to let the user browse for an OPC-UA server endpoint.

class procedure ShowDialog.Main;
var
  EndpointDialog: OpcLabs_EasyOpcForms_TLB._UAEndpointDialog;
  DialogResult: System_Windows_Forms_TLB.DialogResult;
begin
  // Instantiate the dialog object
  EndpointDialog := CoUAEndpointDialog.Create;

  EndpointDialog.DiscoveryHost := 'opcua.demo-this.com';

  DialogResult := EndpointDialog.ShowDialog(nil);
  WriteLn(DialogResult);

  if DialogResult <> DialogResult_OK then
    Exit;

  // Display results
  WriteLn(EndpointDialog.DiscoveryElement.ToString);
end;
Rem This example shows how to let the user browse for an OPC-UA server endpoint.

Private Sub ShowDialog_Main_Command_Click()
    OutputText = ""

    Dim EndpointDialog As New UAEndpointDialog
    EndpointDialog.DiscoveryHost = "opcua.demo-this.com"
    
    Dim DialogResult
    DialogResult = EndpointDialog.ShowDialog
    
    OutputText = OutputText & DialogResult & vbCrLf
    If DialogResult <> 1 Then   ' OK
        Exit Sub
    End If
    
    ' Display results
    OutputText = OutputText & EndpointDialog.DiscoveryElement & vbCrLf
End Sub
Rem This example shows how to let the user browse for an OPC-UA server endpoint.

Option Explicit

Const DialogResult_OK = 1

Dim EndpointDialog: Set EndpointDialog = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UAEndpointDialog")
EndpointDialog.DiscoveryHost = "opcua.demo-this.com"

Dim dialogResult: dialogResult = EndpointDialog.ShowDialog
WScript.Echo dialogResult

If dialogResult <> DialogResult_OK Then
    WScript.Quit
End If

' Display results
WScript.Echo EndpointDialog.DiscoveryElement
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also