This method is called from the generic server at startup for normal operation or for registration. It provides server registry information for this application required for DCOM registration. The DANSrv registers the OPC server accordingly. The XDARap XML DA server ignores most of the registration information.
This method does typically not have to be changed. The wizard generated the GUIDs for this server and inserts the server names as defined in the wizard dialog.
The default implementation in IGeneric.cs/vb initializes default values and tries to read the configuration definitions from the file DANSrv.exe.config respectively web.config for XML DA servers. The method can be replaced by defining an overload in ServerAdapt.cs/vb.
The definitions can be made in the code to prevent them from being changed without a recompilation.
The definitions for the DA server are used if the empty strings ("") are defined.
Note: With the same CLSID for DA and AE on client connect an instance of each server type (DA and AE) is created and this method is called for each instance. At instance creation time it's not known what functionality the client is going to use. If the application uses the ServerInstancesChange method to supervise the instance creation/destruction it's better to define a different CLSID/ProgID for DA and AE.
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As GenericServer Dim value As SrvRegDef value = instance.GetAEServerRegistryDef() |
C# | |
---|---|
public SrvRegDef GetAEServerRegistryDef() |
Return Value
Definition structureThe default implementation in IGeneric.cs/vb tries to read the definitions for the following configuration definitions from the DANSrv.exe.config respectively web.config file. The following are sample definitions values.
<add key="ClsidServer" value = "{604C23CE-816F-46ed-BCF9-0473A0A3617F}" />
<add key="ServerProgID" value = "Advosol.DANSrv.AE" />
<add key="CurrServerProgID" value = "Advosol.DANSrv.AE.1" />
<add key="ServerName" value = "Advosol DANSrv AE Option" />
<add key="CurrServerName" value = "Advosol DANSrv AE Option V1.0" /> The XDARap returns this definitionin the GetStatus client call.
<add key="CompanyName" value = "Advosol Inc." />
The CLSID definitions need to be unique and can be created with the Visual Studio Create GUID tool.
The DANSrv/XDARap project generation wizards create a file with unique CLSIDs and the definitions from the wizard dialog. The default values in the code are the same as in the config file.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2