wtl

TVN_SELCHANGING not received

China☆狼群 提交于 2019-12-24 15:36:23
问题 I have a WTL81 app. CMainFrame has a child CPaneContainer, that has a child window CTreeViewCtrl. The problem is CTreeViewCtrl doesn't receive TVN_SELCHANGING message. I have "spied" CTreeViewCtrl and his parent (CPaneContainer) and no notification code is received. CMainFrame is implemented from public CFrameWindowImpl<CMainFrame> CPaneContainer is implemented like this class PaneContainerReflectNotif : public CPaneContainer { BEGIN_MSG_MAP(PaneContainerReflectNotif) CHAIN_MSG_MAP

Getting alpha blending to work with CImageList

元气小坏坏 提交于 2019-12-23 17:58:10
问题 There are several other questions that are very similar to this that I have come across: Is it possible to create a CImageList with alpha blending transparency? Transparent images in ImageLists for ListViews ImageList Transparency on Listviews? I am using WTL9.0. I have a frame window with a CTreeViewCtrlEx as its child. I am using SHGetFileInfo() to obtain the icons I want to use in the tree, but they show up with black backgrounds. Here is a complete sample. #define WINVER 0x0601 // Windows

Search Outlook Contact using COM?

a 夏天 提交于 2019-12-23 03:11:09
问题 I want to add support for searching for local Outlook contacts to my ATL/WTL app. Does anyone know of the Outlook COM interface (Office 2003 or greater) allows you to search for contacts? I already have LDAP lookup support but users want to be able to search their private contacts as well. Any information would be welcome. 回答1: To get access to the contacts you first have to get a Namespace object using the Application's GetNamespace function, passing "MAPI" as the namespace name. Then you

Errors in Windows - DWORD (GetLastError) vs HRESULT vs LSTATUS

爱⌒轻易说出口 提交于 2019-12-20 09:37:55
问题 I'm doing some programming in Win32 + WTL, and I'm confused with the available types of errors. In general, I want to check for an error, and feed it to AtlGetErrorDescription (which calls FormatMessage). My questions are: What's the difference between: DWORD , returned by GetLastError . HRESULT , returned by e.g. the CAtlFile wrapper, which uses HRESULT_FROM_WIN32 to convert from DWORD . LSTATUS , returned by e.g. RegCreateKeyEx . Which types of errors can I feed to FormatMessage ? Its

flicker free tab control with WS_EX_COMPOSITED

时间秒杀一切 提交于 2019-12-18 09:21:30
问题 I have a VS2008 C++ application for Windows XP SP3 developed using WTL 8.1. My application contains a tab control that flickers when the application border is resized. My window hierarchy looks like this: CFrameWindowImpl CMainFrm |-CSplitterWindow Splitter |-CTabView Configuration Tabs | |-CDialogImpl Configuration View 1 | |-CDialogImpl Configuration View 2 | |-CDialogImpl Configuration View 3 |-CDialogImpl Control View The solution I'm trying is to make the CFrameWindowImpl derived class

How to add WTL and ATL to visual studio c++ express 2008

你离开我真会死。 提交于 2019-12-17 10:44:50
问题 I start using the visual studio c++ express 2008 at home but there is no ATL in it. How can I add ATL to visual studio c++ express 2008? 回答1: ATL 7.1 is now part of the Windows Driver Kit. 回答2: ATL was only included in older versions of the SDK. Recent versions of ATL share much code with MFC and are only available with the real versions of Visual Studio, i.e. not with VS Express. So: to use ATL and/or MFC, you need to buy the Professional version of Visual Studio. If you are content with old

How to get items from a ListViewCtrl multiple selection in WTL?

半腔热情 提交于 2019-12-13 05:35:43
问题 I have a ListViewCtrl in a WTL program. I need to get the items selected by the user(multiple selection). I can only het the count of selected items using GetSelectedCount() . GetSelectedItem() doesnt work with multiple selection. 回答1: Have a look here: CListViewCtrl ListView = ... for(INT nItem = ListView.GetNextItem(-1, LVNI_SELECTED); nItem >= 0; nItem = ListView.GetNextItem(nItem, LVNI_SELECTED)) { // Here you go with nItem } 回答2: Now this is just the way that I did it: for(int j=0;j<list

How to create a splitter in ATL/WTL?

青春壹個敷衍的年華 提交于 2019-12-12 09:59:14
问题 I want to place the elements of my (resizable) dialog in one of two panes. How do I create a splitter for the panes, using WTL? I found CSplitterImpl and CSplitterWindowImpl , but I can't figure out how to use them with my dialogs. 回答1: WTLExplorer sample from WTL should get you the idea, see \Samples\WTLExplorer. If you'd like more, there's a lot around, e.g. http://www.viksoe.dk/code/splitterbar.htm 来源: https://stackoverflow.com/questions/7324153/how-to-create-a-splitter-in-atl-wtl

Error when trying to hook up a control with DDX_CONTROL

左心房为你撑大大i 提交于 2019-12-12 04:17:58
问题 This is the code I'm trying to get to work right now: #pragma once #include "stdafx.h" #include "resource.h" class MusicPlayerDialog : public CDialogImpl<MusicPlayerDialog>, public CWinDataExchange<MusicPlayerDialog> { public: MusicPlayerDialog(); ~MusicPlayerDialog(); enum { IDD = IDD_MAINDIALOG }; BEGIN_MSG_MAP_EX(MusicPlayerDialog) MESSAGE_HANDLER(WM_CLOSE, OnClose) MESSAGE_HANDLER(WM_DESTROY, OnDestroy) MESSAGE_HANDLER(WM_INITDIALOG, OnInit) COMMAND_ID_HANDLER_EX(IDC_CLOSE,

WM_SYSCOMMAND SC_MOVE eats up mouse events and mouse up is not fired

二次信任 提交于 2019-12-12 00:30:24
问题 My program is a chromeless window and I want to move the window when user drag any part of my dialog. Once WM_SYSCOMMAND is used, all subsequent mouse events are lost. First I wrote a program to capture the mouse events and all working fine with WTL. BEGIN_MSG_MAP(CMainDlg) MSG_WM_LBUTTONUP(OnMouseUp) MSG_WM_LBUTTONDOWN(OnMouseDown) .... LRESULT OnMouseDown ( UINT uKeys, CPoint pt ) { print ("on mouse down"); return 0; } LRESULT OnMouseUp ( UINT uKeys, CPoint pt ) { print ("on mouse up");