Click here to Skip to main content
15,887,083 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Tranlating old code to the STL style Pin
Stuart Dootson12-Aug-10 9:16
professionalStuart Dootson12-Aug-10 9:16 
GeneralRe: Tranlating old code to the STL style Pin
VeganFanatic12-Aug-10 9:20
VeganFanatic12-Aug-10 9:20 
QuestionATL: WM_MOUSELEAVE Pin
Supriya Tonape6-Aug-10 4:30
Supriya Tonape6-Aug-10 4:30 
AnswerRe: ATL: WM_MOUSELEAVE Pin
Frank Seidler6-Aug-10 4:38
Frank Seidler6-Aug-10 4:38 
GeneralRe: ATL: WM_MOUSELEAVE Pin
Sauro Viti6-Aug-10 4:46
professionalSauro Viti6-Aug-10 4:46 
GeneralRe: ATL: WM_MOUSELEAVE Pin
Supriya Tonape9-Aug-10 2:25
Supriya Tonape9-Aug-10 2:25 
GeneralRe: ATL: WM_MOUSELEAVE Pin
Supriya Tonape9-Aug-10 2:28
Supriya Tonape9-Aug-10 2:28 
QuestionHow can my CDerivedEdit respond WM_SHOWWINDOW? (OnShowWindow) Pin
dancingfish5-Aug-10 21:41
dancingfish5-Aug-10 21:41 
How can my CDerivedEdit respond WM_SHOWWINDOW?

(OnShowWindow)just like MFC.

class CMouseValueEdit
: public CWindowImpl<cmousevalueedit, cedit="">
{
public:
DECLARE_WND_CLASS(_T("CMouseValueEdit"));

BEGIN_MSG_MAP_EX(CMouseValueEdit)
MESSAGE_HANDLER(WM_SHOWWINDOW, OnShowWindow)
MSG_WM_SHOWWINDOW(OnShowWindow)
//MESSAGE_HANDLER(WM_CTLCOLOREDIT, OnCtlColorEdit)
//MSG_WM_PAINT(OnPaint)
//MESSAGE_HANDLER(OCM_CTLCOLOREDIT, OnCtlColorEdit)
MSG_OCM_CTLCOLOREDIT(OnCtlColorEdit)
//REFLECTED_NOTIFY_CODE_HANDLER( WM_SHOWWINDOW, OnShowWindow)
DEFAULT_REFLECTION_HANDLER()
//CHAIN_MSG_MAP(CWindowImpl<cmousevalueedit, cedit="">)
END_MSG_MAP_EX()

CMouseValueEdit& operator=(HWND hWnd)
{
//m_hWnd = hWnd;
SubclassWindow(hWnd);
return *this;
}
}




class CMainDlg : public CDialogImpl<cmaindlg>, public CUpdateUI<cmaindlg>
, public CMessageFilter, public CIdleHandler
, public CWinDataExchange<cmaindlg>
{
public:
CMainDlg();
virtual ~CMainDlg();

CMouseValueEdit m_editMouse;
enum { IDD = IDD_MAINDLG };

BEGIN_DDX_MAP(CMainDlg)
DDX_CONTROL_HANDLE(IDC_EDIT_MOUSE, m_editMouse)
END_DDX_MAP();

virtual BOOL PreTranslateMessage(MSG* pMsg)
{
return CWindow::IsDialogMessage(pMsg);
}

virtual BOOL OnIdle()
{
return FALSE;
}

BEGIN_UPDATE_UI_MAP(CMainDlg)
END_UPDATE_UI_MAP()

BEGIN_MSG_MAP_EX(CMainDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout)
COMMAND_ID_HANDLER(IDOK, OnOK)
COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
REFLECT_NOTIFICATIONS()
END_MSG_MAP_EX()

LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
// center the dialog on the screen
CenterWindow();

//mp_editMouse->SubclassWindow(GetDlgItem(IDC_EDIT_MOUSE));
DoDataExchange();

// set icons
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
SetIcon(hIcon, TRUE);
HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
SetIcon(hIconSmall, FALSE);

// register object for message filtering and idle updates
CMessageLoop* pLoop = _Module.GetMessageLoop();
ATLASSERT(pLoop != NULL);
pLoop->AddMessageFilter(this);
pLoop->AddIdleHandler(this);

UIAddChildWindowContainer(m_hWnd);

return TRUE;
}
}




OnShowWindow is not called.
I can't understand WTL...
QuestionAuthentication client-server using message queues in c language Pin
ralph 230-Jul-10 2:31
ralph 230-Jul-10 2:31 
AnswerRe: Authentication client-server using message queues in c language Pin
Richard MacCutchan30-Jul-10 3:17
mveRichard MacCutchan30-Jul-10 3:17 
GeneralRe: Authentication client-server using message queues in c language Pin
ralph 230-Jul-10 3:20
ralph 230-Jul-10 3:20 
QuestionProgressBar and Threading.. Pin
Anil Kumar.Arvapalli29-Jul-10 19:53
Anil Kumar.Arvapalli29-Jul-10 19:53 
AnswerRe: ProgressBar and Threading.. Pin
Richard MacCutchan29-Jul-10 22:24
mveRichard MacCutchan29-Jul-10 22:24 
QuestionAdd Publisher name to my application Pin
Cvaji29-Jul-10 2:20
Cvaji29-Jul-10 2:20 
GeneralRe: Add Publisher name to my application Pin
Sauro Viti29-Jul-10 9:15
professionalSauro Viti29-Jul-10 9:15 
QuestionHow to play flash movies with transparent background color in a Window? Pin
itmagina28-Jul-10 14:51
itmagina28-Jul-10 14:51 
AnswerRe: How to play flash movies with transparent background color in a Window? Pin
sunlin730-Jul-10 18:30
sunlin730-Jul-10 18:30 
Questionwhy does this thread just show the last one record? Pin
wangningyu27-Jul-10 20:59
wangningyu27-Jul-10 20:59 
QuestionATL error [modified] Pin
shakumar_212-Jul-10 21:32
shakumar_212-Jul-10 21:32 
AnswerRe: ATL error Pin
Stephen Hewitt4-Jul-10 14:48
Stephen Hewitt4-Jul-10 14:48 
QuestionCapturing IE Events Pin
Adeel Mirza1-Jul-10 0:08
Adeel Mirza1-Jul-10 0:08 
QuestionHow to get Drive name of current OS installed Pin
am 200928-Jun-10 18:46
am 200928-Jun-10 18:46 
AnswerRe: How to get Drive name of current OS installed Pin
gpsushil28-Jun-10 20:26
gpsushil28-Jun-10 20:26 
QuestionDisplay controls in editor-created tab control [modified] Pin
Splatt4223-Jun-10 7:59
Splatt4223-Jun-10 7:59 
AnswerRe: Display controls in editor-created tab control Pin
Jonathan Davies10-Jul-10 3:04
Jonathan Davies10-Jul-10 3:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.