Click here to Skip to main content
15,891,529 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: Using ATL7 CMimeMessage classes Pin
Amit Dey29-Mar-03 21:39
Amit Dey29-Mar-03 21:39 
GeneralRe: Using ATL7 CMimeMessage classes Pin
geo_m29-Mar-03 22:49
geo_m29-Mar-03 22:49 
GeneralRe: Using ATL7 CMimeMessage classes Pin
Amit Dey30-Mar-03 8:47
Amit Dey30-Mar-03 8:47 
Generalcopy multimap to vector Pin
Anonymous26-Mar-03 9:07
Anonymous26-Mar-03 9:07 
GeneralRe: copy multimap to vector Pin
jbarton26-Mar-03 9:48
jbarton26-Mar-03 9:48 
GeneralRe: copy multimap to vector Pin
Tim Smith26-Mar-03 10:00
Tim Smith26-Mar-03 10:00 
GeneralRe: copy multimap to vector Pin
jbarton26-Mar-03 10:04
jbarton26-Mar-03 10:04 
GeneralHosting a modeless dialog as a control (WTL) Pin
yarp26-Mar-03 4:26
yarp26-Mar-03 4:26 
Hi, I'm trying to host a WTL modeless dialog as a child window in another dialog. My modeless is WTL based and the dialog is not (it is CBuilder).
I did the same with a Win32 modeless and it works fine but although the WTL dialog behaves like a child window I still can see the borders and caption bar. I think I should change the style or declaration in the .rc to have a real control looking dialog.
Below is the code and .rc, please tell me chat's wrong.
btw The _Module is non functionnal has the main message proc is owned by CBuilder so I hooked the Cbuilder message map to get the WH_GETMESSAGE (tips from a code project article) maybe am I missing some other messages ?
class CMyDialog : public CDialogImpl<CMyDialog>, public CUpdateUI<CMyDialog>,
  public CMessageFilter, public CControlWinTraits, public CIdleHandler
{
public:
  enum { IDD = IDD_DIALOG1 };

  CMyDialog()
  {
  }

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

  virtual BOOL OnIdle()
  {
    return FALSE;
  }

  // Message map
  BEGIN_MSG_MAP(CMyDialog)
    MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
    COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
    REFLECT_NOTIFICATIONS()
  END_MSG_MAP()

  BEGIN_UPDATE_UI_MAP(CMyDialog)
  END_UPDATE_UI_MAP()

  // Overrides
  LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled)
  {
    CenterWindow();

    UIAddChildWindowContainer(m_hWnd);

    return TRUE;
  }

  LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
  {
    DestroyWindow();
    return 0;
  }
};

and the .rc declaration:
IDD_DIALOG1 DIALOGEX 0, 0, 187, 95
STYLE DS_MODALFRAME | DS_3DLOOK | WS_CHILD | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_NOPARENTNOTIFY | WS_EX_TOOLWINDOW | WS_EX_CONTROLPARENT
CAPTION "Hello World WTL"
FONT 8, "MS Sans Serif"
BEGIN
    CONTROL         "Check1",IDC_CHECK1,"Button",BS_AUTOCHECKBOX |
                    WS_TABSTOP,7,7,88,10
    CONTROL         "Check2",IDC_CHECK2,"Button",BS_AUTOCHECKBOX |
                    WS_TABSTOP,7,20,84,10
    PUSHBUTTON      "Button1",IDC_BUTTON1,130,7,50,14
    PUSHBUTTON      "Button2",IDC_BUTTON2,130,27,50,14
END

I've been working seriously on WTL for a couple of months now and it's really a powerfull framework base.
Of course the above technique works fine with MFC too Wink | ;)


Yarp
http://www.senosoft.com/
GeneralRe: Hosting a modeless dialog as a control (WTL) Pin
yarp26-Mar-03 4:29
yarp26-Mar-03 4:29 
GeneralRe: Hosting a modeless dialog as a control (WTL) Pin
Michael Dunn26-Mar-03 17:56
sitebuilderMichael Dunn26-Mar-03 17:56 
GeneralRe: Hosting a modeless dialog as a control (WTL) Pin
yarp26-Mar-03 20:20
yarp26-Mar-03 20:20 
GeneralSTL Pin
tsb26-Mar-03 4:26
tsb26-Mar-03 4:26 
GeneralRe: STL Pin
valikac26-Mar-03 11:45
valikac26-Mar-03 11:45 
GeneralRe: STL Pin
geo_m27-Mar-03 0:12
geo_m27-Mar-03 0:12 
GeneralSTL fstream format question Pin
Nitron25-Mar-03 11:31
Nitron25-Mar-03 11:31 
GeneralRe: STL fstream format question Pin
Nemanja Trifunovic25-Mar-03 11:42
Nemanja Trifunovic25-Mar-03 11:42 
GeneralRe: STL fstream format question Pin
Nitron25-Mar-03 11:43
Nitron25-Mar-03 11:43 
GeneralRe: STL fstream format question Pin
Nemanja Trifunovic25-Mar-03 11:52
Nemanja Trifunovic25-Mar-03 11:52 
GeneralRe: STL fstream format question Pin
Nitron25-Mar-03 13:23
Nitron25-Mar-03 13:23 
General_bstr_t problem Pin
particle2k25-Mar-03 6:32
particle2k25-Mar-03 6:32 
GeneralRe: _bstr_t problem Pin
particle2k25-Mar-03 6:39
particle2k25-Mar-03 6:39 
GeneralRe: _bstr_t problem Pin
geo_m25-Mar-03 10:16
geo_m25-Mar-03 10:16 
GeneralRe: _bstr_t problem Pin
particle2k26-Mar-03 1:36
particle2k26-Mar-03 1:36 
GeneralRe: _bstr_t problem Pin
geo_m26-Mar-03 1:55
geo_m26-Mar-03 1:55 
QuestionHow can I change my WTL project to a COM server Pin
Remon Spekreijse24-Mar-03 3:57
Remon Spekreijse24-Mar-03 3:57 

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.