I'm parsing some third-party's software "script" which generates a GUI form based on it's contents and I want to read the script within a C# program and produce a similar output, here's an example script:
BEGIN SECTION Intro
BACKPICTURE=xxxx.gif
PICTUREPOSN=Center
BEGIN CONTROL CLI
IS RADIO=NO
CLSID={49EBC3A3-727D-11CF-9BB9-080000001311}
POSITION=(24,16,250,45)
QUESTION=@0:232
BEGIN PROPERTY Title
DISPID=2
SETTING=CLI :
TYPE=BSTR
END PROPERTY
BEGIN PROPERTY Arrangement
DISPID=3
SETTING=1
TYPE=I4
END PROPERTY
BEGIN PROPERTY EditBoxLength
DISPID=4
SETTING=3
TYPE=I4
END PROPERTY
The properties I'm interested in is BEGIN CONTROL
and BEGIN PROPERTY
as these indicate the start of an ActiveX control and it's properties.
My question: how would I load this ActiveX control by it's CLSID and set its properties? Type.GetTypeFromCLSID
seems to be what I want and it doesn't throw any exceptions when I use Activator.CreateInstance(Type)
so it must be creating a valid instance but how would one set is properties and then "draw" this control to a Windows form?
Thanks.