[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
CAPE-OPEN • View topic - How to write CAPE-OPEN registry entries under C#

How to write CAPE-OPEN registry entries under C#

How to write CAPE-OPEN registry entries under C#

Postby bcbooo » 17 August 2021, 17:29

When implementing a Unit Operation in C++, there are some registry information stored in .rgs file, and these information will be wrote to Windows registry automatically when the C++ dll file is registered, as follows:

HKCU
{
NoRemove Software
{
NoRemove Classes
{
CPPMixerSplitterexample.CPPMixerSplit.1 = s 'CPPMixerSplitterUnitOperation Class'
{
CLSID = s '{3B7FDF53-EC5A-4BF8-99F2-819A8BF90579}'
}
CPPMixerSplitterexample.CPPMixerSplitte = s 'CPPMixerSplitterUnitOperation Class'
{
CLSID = s '{3B7FDF53-EC5A-4BF8-99F2-819A8BF90579}'
CurVer = s 'CPPMixerSplitterexample.CPPMixerSplit.1'
}
NoRemove CLSID
{
ForceRemove {3B7FDF53-EC5A-4BF8-99F2-819A8BF90579} = s 'CPPMixerSplitterUnitOperation Class'
{
ProgID = s 'CPPMixerSplitterexample.CPPMixerSplit.1'
VersionIndependentProgID = s 'CPPMixerSplitterexample.CPPMixerSplitte'
ForceRemove 'Programmable'
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Apartment'
}
val AppID = s '%APPID%'
'TypeLib' = s '{D2588024-AC34-4F37-BC66-3B020A481366}'
'Implemented Categories'
{
{678C09A5-7D66-11D2-A67D-00105A42887F}
{678C09A1-7D66-11D2-A67D-00105A42887F}
}
CapeDescription
{ val Name = s 'CPP Mixer Splitter Example'
val Description = s 'Microsoft Visual C++ 2005 Mixer and Splitter Example according to CAPE-OPEN Unit Operation specification'
val CapeVersion = s '1.0'
val ComponentVersion = s '1.0.1'
val VendorURL = s 'http://www.colan.org/'
val About = s 'See http://www.colan.org/ for more information'
}

}
}
}
}
}


And now I want to develop a Unit Operation under C# class library environment, and I found COLAN provided a class library to write to registry:

[Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.Guid("B41DECE0-6C99-4CA4-B0EB-EFADBDCE23E9")]//ICapeThermoMaterialObject_IID)
[CapeOpen.CapeNameAttribute("UnitOperationWrapper")]
[CapeOpen.CapeDescriptionAttribute("This class provides access to unit operations based upon .Net-based assembly location rules.")]
[CapeOpen.CapeVersionAttribute("1.0")]
[CapeOpen.CapeVendorURLAttribute("http:\\www.epa.gov")]
[CapeOpen.CapeHelpURLAttribute("http:\\www.epa.gov")]
[CapeOpen.CapeAboutAttribute("US Environmental Protection Agency\nCincinnati, Ohio")]

[System.Runtime.InteropServices.ComSourceInterfaces(typeof(ICapeIdentificationEvents), typeof(System.ComponentModel.INotifyPropertyChanged))]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.None)]
public class UnitOperationWrapper : CapeUnitBase,
ICapeUnitReport,
ICapeUnitReportCOM,
//ICloneable,
System.ComponentModel.INotifyPropertyChanged,
//IDisposable,
System.Runtime.Serialization.ISerializable

But I want to implement the C# unit operation without CAPE-OPEN class library, therefore I need to write the registry information of red color by myself. I don't know how to add these information in my C# source code, could you help me by providing the sample code? Any response is appreciated.
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China

Re: How to write CAPE-OPEN registry entries under C#

Postby jasper » 18 August 2021, 07:46

User avatar
jasper
 
Posts: 1128
Joined: 24 October 2012, 15:33
Location: Spain

Re: How to write CAPE-OPEN registry entries under C#

Postby bcbooo » 18 August 2021, 12:05

Jasper you are so great.
I am investigating a Unit Operation source code implemented by C#, I found it's rather complicated than the ones by C++.
bcbooo
 
Posts: 66
Joined: 22 November 2012, 06:41
Location: China


Return to Unit Operations

Who is online

Users browsing this forum: No registered users and 1 guest

cron