API SetWindowText() don't update now on design dialog

Hi all!
i have create a Button normal, by ActiveX Control MFC
so, it can work with vb.net , test container, however, Application MFC is not yet
it only run when we move this button once more
i have used UpdateData(),SetForcus(), SetSel(),MoveWindow(),SetReDraw(),
IsWindow(Button), Inval ...ect
i try, but i can't
any more solution for this!!!

==> i create ActiveX Static, after i have created variable _mybutton to CButton,
i created property Text to Get/Set caption of this button

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

//create button, is coded in function OnCreate

_myButton.Create(_T("hello"),WS_VISIABLE|WS_CHILD,CRect(10,10,15,20),this,1);

//create button, is coded in function OnCreate


BSTR CButtonViewCtrl::GetTex(void)
{
     AFX_MANAGA_STATE(AfxGetStaticModuleState());
     CString strResult;
     _buttonView.GetWindowText(strResult);
    return strResult.AllocSysString();
}
 
voidCButtonViewCtrl::SetTex(LPCTSTR newVal)
{
     AFX_MANAGA_STATE(AfxGetStaticModuleState());
     _buttonView.SetWindowText(newVal);
    SetModifiedFlag();
}


thanks for read my topic
Last edited on
Topic archived. No new replies allowed.