Click here to Skip to main content
15,910,981 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralInformation of running application's objects Pin
naveensg18-Nov-03 23:08
naveensg18-Nov-03 23:08 
GeneralDDX DLL and CComboBoxImpl in WTL Pin
bryces18-Nov-03 17:17
bryces18-Nov-03 17:17 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
Michael Dunn18-Nov-03 17:26
sitebuilderMichael Dunn18-Nov-03 17:26 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
bryces18-Nov-03 17:39
bryces18-Nov-03 17:39 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
Michael Dunn22-Nov-03 16:30
sitebuilderMichael Dunn22-Nov-03 16:30 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
bryces23-Nov-03 11:47
bryces23-Nov-03 11:47 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
bryces23-Nov-03 11:53
bryces23-Nov-03 11:53 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
bryces23-Nov-03 12:29
bryces23-Nov-03 12:29 
Ahhhh found out something interesting.

if you try to change the About dialog in a WTL wizard created application, which is dialog based.... the compiler bombs as well. so if you do the following: Add a combo box to the about dialog and label it IDC_COMBO_TARGET

aboutdlg.h
<br />
// aboutdlg.h : interface of the CAboutDlg class<br />
//<br />
/////////////////////////////////////////////////////////////////////////////<br />
<br />
#if !defined(AFX_ABOUTDLG_H__A290BA10_FE73_4A12_8FCA_FEBA7A47586B__INCLUDED_)<br />
#define AFX_ABOUTDLG_H__A290BA10_FE73_4A12_8FCA_FEBA7A47586B__INCLUDED_<br />
<br />
class CAboutDlg : public CAxDialogImpl<CAboutDlg>,<br />
                  public CWinDataExchange<CAboutDlg>,<br />
                  public CComObjectRootEx<<CComSingleThreadModel>,<br />
                  public CComCoClass<CAboutDlg><br />
{<br />
public:<br />
	enum { IDD = IDD_ABOUTBOX };<br />
<br />
	BEGIN_MSG_MAP(CAboutDlg)<br />
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)<br />
		COMMAND_ID_HANDLER(IDOK, OnCloseCmd)<br />
		COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)<br />
      COMMAND_HANDLER(IDC_COMBO_TARGET, CBN_SELCHANGE, OnSelchangeCombo_target)<br />
      COMMAND_HANDLER(IDC_COMBO_TARGET, CBN_DROPDOWN, OnDropdownCombo_target)<br />
	END_MSG_MAP()<br />
<br />
// Handler prototypes (uncomment arguments if needed):<br />
//	LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)<br />
//	LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)<br />
//	LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)<br />
<br />
	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);<br />
	LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);<br />
   LRESULT OnSelchangeCombo_target(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);<br />
   LRESULT OnDropdownCombo_target(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);<br />
<br />
private:<br />
   CComboBoxImpl m_pComboBox;<br />
   CString m_szTargetLayer;<br />
};<br />
<br />
#endif // !defined(AFX_ABOUTDLG_H__A290BA10_FE73_4A12_8FCA_FEBA7A47586B__INCLUDED_)<br />


aboutdlg.cpp
<br />
// aboutdlg.cpp : implementation of the CAboutDlg class<br />
//<br />
/////////////////////////////////////////////////////////////////////////////<br />
<br />
#include "stdafx.h"<br />
#include "resource.h"<br />
<br />
#include "aboutdlg.h"<br />
<br />
LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)<br />
{<br />
	CenterWindow(GetParent());<br />
	return TRUE;<br />
}<br />
<br />
LRESULT CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)<br />
{<br />
	EndDialog(wID);<br />
	return 0;<br />
}<br />
<br />
LRESULT CAboutDlg::OnSelchangeCombo_target(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)<br />
{<br />
   //DoDataExhange(true);<br />
   //UpdateData();<br />
	// TODO : Add Code for control notification handler.<br />
   CString pValueString;<br />
   //BSTR pValueString;<br />
   int i = this->m_pComboBox.GetDlgItemText(IDC_COMBO_TARGET, &pValueString);<br />
   //this->m_pComboBox.GetLBText(wNotifyCode, pValueString);<br />
<br />
   //AtlMessageBox(NULL, pValueString.AllocSysString(), _T("Selection"), MB_OK);<br />
	return 0;<br />
}<br />
LRESULT CAboutDlg::OnDropdownCombo_target(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)<br />
{<br />
   HRESULT hr;<br />
   return 0;<br />
}<br />


Then in your stdafx.h define the following
<br />
#define _WTL_USE_CSTRING<br />
#define _ATL_APARTMENT_THREADED<br />
<br />
//.... other stuff..<br />
<br />
#include <atlcom.h><br />
#include <atlhost.h><br />
#include <atlwin.h><br />
#include <atlctl.h><br />
<br />
#include <atlframe.h><br />
#include <atlcrack.h><br />
#include <atlmisc.h><br />
#include <atlctrls.h><br />
#include <atlctrlx.h><br />
#include <atldlgs.h><br />
//#include <atlctrlw.h><br />
#include <atlddx.h><br />
<br />
//.. other stuff..<br />
<br />
class CComboBoxImpl : public CWindowImpl<CComboBoxImpl, CComboBox><br />
    { DECLARE_EMPTY_MSG_MAP(); };<br />


Anyone got thoughts on why this would happen?

cheers
Bryce
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
Michael Dunn23-Nov-03 14:57
sitebuilderMichael Dunn23-Nov-03 14:57 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
bryces23-Nov-03 15:17
bryces23-Nov-03 15:17 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
Michael Dunn23-Nov-03 17:37
sitebuilderMichael Dunn23-Nov-03 17:37 
GeneralRe: DDX DLL and CComboBoxImpl in WTL Pin
bryces23-Nov-03 17:57
bryces23-Nov-03 17:57 
GeneralATL & DHTML Pin
Leesen18-Nov-03 5:33
Leesen18-Nov-03 5:33 
GeneralTemplate and message map Pin
Stephane David18-Nov-03 3:59
Stephane David18-Nov-03 3:59 
GeneralRe: Template and message map Pin
Member 20218605-Jun-05 22:50
Member 20218605-Jun-05 22:50 
GeneralTemplate issue.. Pin
GDavy18-Nov-03 2:11
GDavy18-Nov-03 2:11 
GeneralRe: Template issue.. Pin
GDavy18-Nov-03 2:16
GDavy18-Nov-03 2:16 
GeneralRe: Template issue.. Pin
GDavy18-Nov-03 3:25
GDavy18-Nov-03 3:25 
GeneralIOleInPlaceObjectWindowLessImpl::GetDropTarget Pin
Jörgen Sigvardsson18-Nov-03 0:31
Jörgen Sigvardsson18-Nov-03 0:31 
GeneralParent-Child windows relationship Pin
Gabriel.P.G17-Nov-03 10:46
Gabriel.P.G17-Nov-03 10:46 
QuestionHow do I read one vector from another? Pin
WREY16-Nov-03 17:08
WREY16-Nov-03 17:08 
AnswerRe: How do I read one vector from another? Pin
Michael Dunn16-Nov-03 18:46
sitebuilderMichael Dunn16-Nov-03 18:46 
GeneralRe: How do I read one vector from another? Pin
WREY16-Nov-03 21:44
WREY16-Nov-03 21:44 
GeneralRe: How do I read one vector from another? Pin
berndg17-Nov-03 3:13
berndg17-Nov-03 3:13 
GeneralRe: How do I read one vector from another? Pin
WREY17-Nov-03 8:19
WREY17-Nov-03 8:19 

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.