AnsweredAssumed Answered

Need help getting the type for each ProcessBook symbol in display (ActiveX)

Question asked by Asle Frantzen Champion on Dec 15, 2014
Latest reply on Dec 19, 2014 by gregor



I'm creating a docking window add-in to ProcessBook, and I'm foreach'ing my way through all the symbols in the active display to locate the ones I'm going to work with. All the trends and value symbols are easily identifiable, but I'm going to work on an ActiveX component and I can't seem to get the type/class for these controls. All I get when I debug is the name (which could be "HistogramControl1") and a lot of System.___COMobject stuff, but I'd like to get the class name ("HistogramControl") so that I can be sure I'm working on the correct items. (Of course I could use the name of the object, since they are named "HistogramControl1/2/3" etc. but end users might rename them to something else so I'd like to avoid that).


I'm also able to filter on ActiveX / COM controls in general, in the display symbols collection:


foreach (PBObjLib.Symbol s in currentDisplay.Symbols)
if ((PBObjLib.pbSYMBOLTYPE)s.Type == PBObjLib.pbSYMBOLTYPE.pbSymbolControl)
     //Do work


But I just can't seem to get more information out from my Symbol s.




When I look at the Properties dialog for each Symbol in ProcessBook I see the name of the object + the class (in the dropdown list on top of the dialog), so the class information should be available. I'm thinking it's just a matter of casting it to the right type, but so far I haven't been successful with that. Any idea on how to extract the type/class info for these controls?


Another part of my add-in is to add new controls to the active display, and here I've successfully been able to add new instances of my ActiveX control by sending the ProgID into the Symbols.Add function:


PBObjLib.Symbol aControl = currentDisplay.Symbols.Add(PBObjLib.pbSYMBOLTYPE.pbSymbolControl, "Amitec.Amitec_Histogram_Component.HistogramControl");


But it seems that once I "send" that ProgID into the Add function it's gone, and there's no way to retrieve it. What am I doing wrong?