|
I think that should be ALT_MSG_MAP - A<span style="font-weight: bold;">LT</span> , not A<span style="font-weight: bold;">TL</span> . You'll need to #include atlwin.h .
|
|
|
|
|
I already included atlwin.h in stdafx.h!
Don't quite understand your replay "I think that should be ALT_MSG_MAP - ALT, not ATL"?
Anyway big thanks to you!
|
|
|
|
|
You typed "ATL_MSG_MAP" in your original message. That symbol isn't in ATL, but ALT_MSG_MAP is, i.e. I think you made a typo at some point.
|
|
|
|
|
Need your help again, this time it's about adding notify handler for LVN_ITEMCHANGED message which is sent from listview ctrl.
NOTIFY_HANDLER_EX(IDC_LIST,LVN_ITEMCHANGED,OnListItemchanged)
I've included atlcrack.h but still get complaints?
I know that I'm trying to use code for WTL 7/7.1 while I have WTL 9 installed on VS2008 but I'm stern to go trough the series of articles here on CP by Dunn.
And sorry if I'm a pain to you
|
|
|
|
|
Solved the entry was in the wrong map!
|
|
|
|
|
josip cagalj wrote: I'm stern to go trough the series of articles here on CP by Dunn
They're good articles - Michael's (to my mind) one of the most knowledgeable WTL experts.
josip cagalj wrote: sorry if I'm a pain to you
If you were, I probably wouldn't be answering your questions
|
|
|
|
|
Thanks for previous post.
I tried to add a dialog to my app so after designing one mfc wizard showed up for adding a class for the new dialog so I followed it. When I compiled afterward i got an error saying "fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>", I deleted the dialog and corresponding *.h and *.cpp from project but the error persist?
I think I need to skip the mfc wizard and manually add an class for the new dialog I've designed class:
class CMyNewDlg : public CDialogImpl<cmaindlg>,
public CWinDataExchange<cmynewdlg>
{
public:
enum { IDD = IDD_MYNEWDLG };
CMyNewDlg();
...
If so can I add this in existing .h file like CMainDlg.h or I need to manually add CMyNewDlg.h and CMyNewDlg.cpp files?
|
|
|
|
|
It probably added one or more MFC include files (afx.h?) to your stdafx.h. Remove those.
|
|
|
|
|
What this means:
error C2039: 'SubclassWindow' : is not a member of 'WTL::CTreeViewCtrlT<tbase>'</tbase>
I've placed an treeview ctrl on my new dlg and everything is ok when I use m_wndTree.Attach(GetDlgItem(IDC_TREE));
but when I want to use DDX_CONTROL like this
BEGIN_DDX_MAP(CMyTreeDlg)
DDX_CONTROL(IDC_TREE, m_wndTree)
END_DDX_MAP()
I get above error
|
|
|
|
|
I believe you need to declare m_wndTree with type CContainedWindowT< CTreeViewCtrl > for it to have a SubclassWindow member.
[edit]You also need to construct m_wndTree correctly:
- If
m_wndTree doesn't have a message map (using ALT_MSG_MAP )
CMyTreeDlg() : m_wndTree(this)
. . .
. . . - If
m_wndTree has a message map (using ALT_MSG_MAP(number )
CMyTreeDlg() : m_wndTree(this, number)
. . .
. . .
[/edit]
|
|
|
|
|
i,ve an int that should be increased each time the picturebox gets a new picture, what is the event i can use, i tried LoadCompleted but it didn't success.
|
|
|
|
|
Hi,
I'm working on some test app and i need help. I'm using vs2008 wtl. I add an handler for timer functionality and it looks like: MESSAGE_HANDLER(WM_TIMER, OnTimer) ,
and implementationLRESULT OnTimer(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
Unlike old MSG_WM_TIMER(OnTimer) and implementation void OnTimer ( UINT uTimerID, TIMERPROC pTimerProc )
My question how can I get timer id out from param's in 'new' MESSAGE_HANDLER ontimer f.?
Thanks in advance
|
|
|
|
|
Look at the documentation[^] - wParam == timer ID.
So, uncomment the relevant parameter's name in your implementation and use it. You should have something like this:
LRESULT OnTimer(UINT , WPARAM wParam, LPARAM , BOOL& );
or you could even alter the parameter's name to be more descriptive...
LRESULT OnTimer(UINT , WPARAM timerID, LPARAM , BOOL& );
|
|
|
|
|
Thanks once again Stuart, indeed I've done so.
UINT uTimerID = (UINT)wParam;
Similarly I've get HDC out from WM_ERASEBKGND implementer;
HDC hdc = (HDC)wParam;
One question do, I'm getting error on my CRect member: "error C2065: 'CRect' : undeclared identifier"
???
Do I need additional include?
|
|
|
|
|
By including 'atltypes.h'
|
|
|
|
|
CRect is defined in atltypes.h in ATL in Visual Studio 2003, 2005 and 2008, or alternatively in atlmisc.h in WTL - if you're using one of those Visual Studio versions, I'd #include atltypes.h rather than atlmisc.h .
|
|
|
|
|
THANKS!
I've included atltypes.h now complaining about
"error C2079: 'sTime' uses undefined class 'WTL::CString'"
sTime - is my CString variable
I have
#define _WTL_USE_CSTRING in my stdafx.h
|
|
|
|
|
Just remove my include 'atltypes.h' instead included 'atlmisc.h' no error now!
|
|
|
|
|
See the "WTL CString support" section on this page[^] - you're probably better off using ATL's CString rather than WTL's, as ATL's CString is (now) MFC's CString, so may be more fully featured and optimised?
|
|
|
|
|
Thanks, I've read the article and I must say it's a little ambiguous.
Why couldn't I just leave it as is (including atlmisc.h) is it wrong?
Everything is compiling ok?!
|
|
|
|
|
You can - I'm just pointing out the options I suspect that the WTL CString is no longer developed (I could be wrong), whereas the ATL/MFC CString is as mainstream as C++ gets in Microsoft development.
|
|
|
|
|
Hey everyone I'm having trouble with receiving events in ATL. I have a control that isn't receiving certain events. For example I've created a message handler for WM_CREATE. I've tested this with the ActiveX Control Test Container and the message is never triggered. The same happens with WM_PAINT. However I get messages for WM_LBUTTONDOWN. Can anyone tell me if I'm missing something?
|
|
|
|
|
I'm trying to get the icons on a CTabCtrl in high resolution, but all I've managed to establish is, WTL GetPage doesn't return something usefull or I don't know how to use it.
I've got this:
...
CTabCtrl tab = GetTabControl();
int nPages = tab.GetItemCount();
for(int i = 0; i < nPages; ++i)
{
???? HELP !!!! page = tab.GetPage(i);
ctrlImageList.AddIcon(LoadIcon(NULL, page.pszIcon));
}
tab.SetImageList(ctrlImageList);
...
ctrlImageList is created using ILC_COLOR32 | ILC_MASK
I'm only able to get the same stupid anoying hatefull error no matter what i try.
Please, i need help solving this
|
|
|
|
|
Use TCITEM structure
tab.SetImageList(ctrlImageList);
TCITEM tabItem;
BOOL bSuccess = tab.GetItem(nTabIndex, &tabItem);
//update members related to icons
if(bSuccess)
{
tabItem.mask = ..;
tabItem.iImage = ..;
tab.SetItem(nTabIndex, &tabItem);
}
|
|
|
|
|
Sorry the delay, I'm without connection at the moment.
I need to access the pszIcon in the m_psp, to load the icon into a CImageList. I've got a CTreeViewCtrl where I need the tab icons loaded into, and when i use ctrlTreeView.SetImageList(tab.GetImageList()), i only get 8 colors.
...
CTabCtrl tab = GetTabControl();
ctrlTreeView.SetImageList(tab.GetImageList());
...
I'm thinking in the lines of ctrlImageList.AddIcon(LoadIcon(NULL, m_psp.pszIcon)), but i don't know how to access the m_psp.
|
|
|
|