The DDX technology was created for linking resources with class members (for example). In my solution I need to make the connection between myCCtreeCtrl (instant of CCtreeCtrl) does not living in resources with class member CCtreeCtrl.
Now I have CTreeCtrl in resouces and silmple doDataExchange:
#define IDC_TREE_LAYER0 2000
#define IDC_TREE_LAYER1 2001
#define IDC_TREE_LAYER2 2002
// ============================================================================
void ForcesGUI::doDataExchange( int id0, int id1, int id2, CDataExchange* pDX )
// ============================================================================
{
DDX_Control(pDX, id0, m_tree[0].data);
DDX_Control(pDX, id1, m_tree[1].data);
DDX_Control(pDX, id2, m_tree[2].data);
}
but in future it will be necessary to delete CCtreeCtrl from resources and make instance.
You’ll ask me why do you need deleting from resources?
The answer is: In project I have 3 CCtreeCtrls each of them live on his own bar. There is no different betwen them. That is why I want to use 1 bar class with 1 tree on it instead of redundancy. After I’ll create 3 instance of bar and here appears problem with DDX wich does not work here.
Have you any ideas how can I replace basic DDX? May be it will be WinAPI or something else. In any case thanks for help.
If the control isn’t generated automatically from a dialog resource, you’ll have to create it with the
Createmethod. You’ll want to do this inOnInitDialogor whatever equivalent is in your parent window. By creating the window withCreateit will automatically be connected to the object you created it from – no need for DDX_Control.