wtl

Simplest way to change listview and treeview colours

I'm trying to find a simple way to change the colour of the text and background in listview and treeview controls in WTL or plain Win32 code. I really don't want to have to implement full owner drawing for these controls, simply change the colours used. I want to make sure that the images are still drawn with proper transparency. Any sug...

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

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? ...

Framework to bind object properties to WTL controls

I would like to have something like this: class Foo { private: int bar; public: void setBar(int bar); int getBar() const; } class MyDialog : public CDialogImpl<MyDialog> { BEGIN_MODEL_MAPPING() MAP_INT_EDITOR(m_editBar, m_model, getBar, setBar); END_MODEL_MAPPING() // other methods and message map private: Foo * m_mod...

Does ATL/WTL still require the use of a global _Module variable?

I'm just starting up a new ATL/WTL project and I was wondering if the global _Module variable is still required? Back a few years when I started working with WTL it was required (at least for ATL 3.0) that you define a global variable such as: CAppModule _Module; To get ATL to work correctly. But recently I've read somewhere that th...

ActiveX in IE. Dialog Box not showing XP Visual Style

I have an ActiveX control in IE (7). When it shows a dialog box, the dialog box is not showing in XP visual style. I have tried embedding manifests to no avail. Anybody got any idea? by the way, the dialog boxes were implemented using wtl. ...

BEGIN_MSG_MAP_EX breaks Visual Studio 2005 intellisense?

I have a C++ application using WTL/ATL BEGIN_MSG_MAP_EX macros for message handling. I use some macros from atlcrack.h. When we upgraded the projects to Visual Studio 2005, intellisense acts crazy. I've tracked the behavior down to the BEGIN_MSG_MAP_EX macro not behaving correctly with intellisense. However, I can not find a way to cont...

How to diagnose Access Violation on application exit

I have an application that I'm trying to debug a crash in. However, it is difficult to detect the problem for a few reasons: The crash happens at shutdown, meaning the offending code isn't on the stack The crash only happens in release builds, meaning symbols aren't available By crash, I mean the following exception: 0xC0000005: Acc...

Pre-registering an ATL window class

I am using a combination of the ATL and WTL for a project and have derived my own class from CWindowImpl, which looks something like this: class CMyControl : public CWindowImpl<CMyControl> { public: DECLARE_WND_CLASS(_T("MyClassName")) ... BEGIN_MSG_MAP(CMyControl) ... END_MSG_MAP() }; This is all good, and if ...

Why a child window may not receive mouse events?

I have a custom WTL control which is a panel with a list and a custom scroll bar. class Panel : public ATL::CWindowImpl<Panel>, public WTL::CDoubleBufferImpl<Panel> { public: DECLARE_WND_CLASS("Panel") BEGIN_MSG_MAP_EX(Panel) MSG_WM_CREATE(OnCreate) MSG_WM_DESTROY(OnDestroy) MSG_WM_SIZE(OnSize) CHAIN_MSG_MAP...

How can you allow a window in an MDI app to leave it's parent container w/Win32?

I have an MDI app. I would like to add an icon to the non client title bar of the child window that allows the window to float separately from the parent MDI container, allowing the user to take the child windows and arbitrarily place them around the desktop, outside of the MDI window. I have seen it done so I know it's possible, but I'...

How do I use WTL in a DLL?

I'm trying to use WTL within an in-process COM server DLL (an IE BHO), but am struggling with _Module. My DLL needs CMyModule derived from CAtlDllModuleT<>: class CMyModule : public CAtlDllModuleT< CMyModule > { public: DECLARE_LIBID(LIBID_MyLib) DECLARE_REGISTRY_APPID_RESOURCEID(IDR_MYPROJ, "{...}") }; CMyModule _Module; ext...

How do you handle right click on a treeview in WTL/Win32 apps?

I have a basic app written with ATL, using the wizard with VS2008. I have a treeview in the left side of the app. I see how to (painfully) add tree items. Question is how do I show a menu when the mouse is right clicked? How do I trap any click events on each item that could be selected? ...

WTL/MFC/Native Win32 vs. .NET + Native Compilation

I have been working on an WTL UI app lately and tearing my hair out with how absolutely archaic everything is. I went with ATL because I needed to be able to offer the application to users who don't have or don't want to be bothered with the .NET Framework installation. I wanted to be able to distribute it without anyone having to do any...

How to send a link to an application, like Spotify does.

Hi, When we save a level in our editor, we create a log file of any errors it contains. These consist basically of an error message and a path that allows the user to find the erronous item in a tree view. What I want is to make that path a link, something like < a href="editor://path/to/gameobject" > Click to see object in editor< /a ...

Search Outlook Contact using COM?

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. ...

Convert short (8.3) paths to long?

In a Win32/WTL/C++ app, I need to convert some 8.3 paths to their true file names. How do I do it? Thanks, ...

WTL CListViewCtrl with status text

I have a Windows Template Library CListViewCtrl in report mode (so there is a header with 2 columns) with owner data set. This control displays search results. If no results are returned I want to display a message in the listbox area that indicates that there were no results. Is there an easy way to do this? Do you know of any exist...

Using WTL with Codeblocks

I want to try WTL, but problem is i can't use Visual Studio for this. So i've codeblocks on my side. Is there any way i can use WTL with codeblocks ? I mean configuration/settings that i need to do for this ? is it possible to use WTL with codeblocks? Just to clear first, i tried google for this. No satisfactory success. So asking t...

Visual styles on WTL CreateSimpleToolbar()

I have created WTL 8.1 project with the wizard. Visual styles are applied to menu and about dialog, but toolbar looks ugly. How can I make the toolbar look native in Vista/7? ...

WTL 8.0 _Module and Message Loop

I'm working on a WTL project, actually WTL 8.1 with VS2008. In many tutorials I've seen the usage of _Module global variable, e.g: _Module.AddMessageLoop. My current application creates a CMessageLoop in the stack at WinMain and later calls the CMessageLoop::Run () method. So far, it's running well. Anyone the reason (if it's necessary) ...