Eric Hartwell's InfoDabble

Welcome to Eric Hartwell's InfoDabble
About | Site Map
Home Tech Notes Apollo 17: Blue Marble Apollo 17 Flight Journal   Calendars About me  
 Exoware .....  

Tech Note 

Using the MyApp CustomComboBox Control

Eric Hartwell - January 2000

The MyApp  CustomComboBox control is used to specify the value

Intimate ties to the data dictionary:

  • auto-complete variable names
  • specified data type
  • numeric, date, and character constants
  • lookup tables
  • add variables to the dictionary

Used as a control in HTML screens and/or the MyApp grid control.

In the DOS version, each field had direct access to the data dictionary and current rule's variables through global pointers. While MyApp  normally runs in a single process space, so global pointers are theoretically available, it's not difficult to use a more generic approach where the plan pointer is explicitly passed to the control, and the control manages its data as a simple text string.

MyAppField ActiveX Control

At this point, let's review an earlier, simpler control, the MyAppField control. Originally called HTMLHelper, MyAppField is a hidden ActiveX control that is embedded in each MyApp HTML screen. While it does not directly display any data, MyAppField is responsible for formatting the value of each field, interpreting the results, and collecting any changes and/or errors on the screen.

DHTML scripting code within the page triggers MyAppField methods when the screen is first loaded, and whenever the value of an input field is changed. External code in the screen's container (i.e. MyAppHtmlView) explicitly calls the CMyAppField::GetChanges method before navigating away from the screen (see Issuing Commands to the HTML View).

MyAppField is packaged as an ActiveX control so it can be used by remote clients in an Internet/Intranet application.

CustomComboBox Control

The CustomComboBox is used only by MyApp, which is a stand-alone application. Since the document/view architecture has direct access to the HTML Document Object Model (DOM) (see Using the MyApp HTML View Automation Classes), there's no need to jump through the same hoops as with MyAppField.

At the same time, since MyApp fields are intimately tied to the data dictionary and rule specifications, it makes sense to use the control as a visual control on the screen. 

  • ActiveX control for HTML screens
  • subclassed field in MyApp Grid control
  • ActiveX control for Grid in HTML screens

The CustomComboBox control is derived from the Enhanced Flat ComboBox Control

Dynamic Dropdown List

Sometimes the contents of the dropdown list aren't known until runtime, or the list is simply too big to be preloaded. In either case, the solution is to subclass the dropdown list and replace it with your own window.

Q174667 - HOWTO: Subclass CListBox and CEdit Inside of CComboBox

See: Drop down a popdown window instead of a dropdown list from a combobox

The dropdown list box can be easily subclassed.


  1. January, 2000 - Initial version
Creative Commons License

Unless otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License


Site Map | About Me