0

When I make a dialog with visual c++ editor, I would see the code generated by my editor to make the window components..It's possible? When I double-click on a component, I see only the handler

volperossa
  • 1,339
  • 20
  • 33

1 Answers1

1

The controls/components of a Dialog Box are described in a Resource Template, in a RC file. In the Solution Explorer, right click on the RC file in "Resource Files" and then choose "Open with..." and select "C++ Code Editor".

The link between the content of the RC file and the C++ code creating the Dialog Box at Run Time is done via the CreateDialog API, or one of his cousin, as CreateDialogParam.

manuell
  • 7,528
  • 5
  • 31
  • 58
  • cool!can I insert my code here or it's not compiled by "standard" c++ compiler? – volperossa Dec 07 '13 at 14:22
  • I would insert every ID Component into an array or other data structure – volperossa Dec 07 '13 at 14:26
  • 1
    The RC file is a static description of the your Dialog Box as a collection of windows controls. No C++ code here. You could enumerate all child windows of your Dialog Box in it's WM_INITDIALOG – manuell Dec 07 '13 at 14:30
  • and if I would that, for example, every TextBox created is a child of a my personal subclass of TextBox? For example, I would override the mousemove method of a textbox generated from the editor – volperossa Dec 07 '13 at 14:37
  • 1
    What you want is possible, either by subclassing oy by registering your own class. Discussion about that won't fit in a comments thread :-) – manuell Dec 07 '13 at 14:39