I just wanted to build the Demo Client solution at development\NET\samples\client\Demo Client but there are several issues when trying to do so.
WinFormsUI project is missing the files Enums.cs and NativeMethods.cs in the folder Win32. They are included in the WinFormsUI.csproj file, see here
Can you maybe provide those files? I have downloaded the latest version of the project from the successor but here the method ShowWindow is missing.
I have just found the missing function in the history
Maybe this helps you to provide the missing files.
Next thing that seems to be missing is the icon.ico file within the WinFormsUI project. I solved that one by using the default icon - but it should be fixed if possible. :)
Could not find file 'development\NET\samples\client\Demo Client\WinFormsUI\icon.ico'.
After solving the above mentioned issues I get the following compile errors:
There is no argument given that corresponds to the required formal parameter 'aType' of 'DaAddressSpaceElement.DaAddressSpaceElement(EnumAddressSpaceElementType, string, string, string, uint, DaSession)' DemoClient2.0 C:\Dev\opc-classic\sdk\development\NET\samples\client\Demo Client\CS\TabControls\AddressSpaceControl.cs 891
which I would fix like this
//previous
DaAddressSpaceElement daAddressSpaceElement = new DaAddressSpaceElement();
//fix
DaAddressSpaceElement daAddressSpaceElement = new DaAddressSpaceElement(EnumAddressSpaceElementType.BRANCH, String.Empty, string.Empty, string.Empty, 0, null);
And the following two
There is no argument given that corresponds to the required formal parameter 'executionOptions' of 'DaSession.Browse(string, string, DaAddressSpaceElementBrowseOptions, out DaAddressSpaceElement[], ExecutionOptions)' DemoClient2.0 C:\Dev\opc-classic\sdk\development\NET\samples\client\Demo Client\CS\DockWindows\MainWindow.cs
There is no argument given that corresponds to the required formal parameter 'executionOptions' of 'DaSession.Browse(string, string, DaAddressSpaceElementBrowseOptions, out DaAddressSpaceElement[], ExecutionOptions)' DemoClient2.0 C:\Dev\opc-classic\sdk\development\NET\samples\client\Demo Client\CS\DockWindows\MainWindow.cs
which I would fix like this
// previous code´
daSession.Browse(itemName, browseOptionsLeaf, out addressSpaceElements, executionOptions))
// fixed code
daSession.Browse(((DaAddressSpaceElement)selectedNode.Tag).ItemId,
((DaAddressSpaceElement)selectedNode.Tag).ItemPath,
browseOptionsLeaf,
out addressSpaceElements,
executionOptions))
The Main function required attribute [STAThreadAttribute]
The App.config required to be changed to only one TraceFile entry:
I had to manually copy the OTBux64.dll from the bin folder to the bin folder of the Demo Client. I guess here the copying may also be broken or it is connected to my settings - idk.
Hey there,
thank you for sharing your code!
I just wanted to build the Demo Client solution at
development\NET\samples\client\Demo Client
but there are several issues when trying to do so.WinFormsUI
project is missing the filesEnums.cs
andNativeMethods.cs
in the folderWin32
. They are included in theWinFormsUI.csproj
file, see here Can you maybe provide those files? I have downloaded the latest version of the project from the successor but here the methodShowWindow
is missing. I have just found the missing function in the history Maybe this helps you to provide the missing files.Next thing that seems to be missing is the
icon.ico
file within the WinFormsUI project. I solved that one by using the default icon - but it should be fixed if possible. :)After solving the above mentioned issues I get the following compile errors:
which I would fix like this
And the following two
which I would fix like this
[STAThreadAttribute]
App.config
required to be changed to only oneTraceFile
entry:OTBux64.dll
from thebin
folder to thebin
folder of theDemo Client
. I guess here the copying may also be broken or it is connected to my settings - idk.Now I was able to start the
Demo Client
.Thank you!
BR Stefan