Click here to Skip to main content
15,868,164 members
Everything / Desktop Programming / WTL

WTL

WTL

Great Reads

by Tim Smith
Color picker control for WTL applications including optional support for XP themes
by Ernest Laurentin
Full-fledged ATL Windowless ActiveX Container. Ideal for hosting Windows Media Player, Transparent Flash and Silverlight Animations.
by Michael Dunn
How to use power status notifications to make your applications conserve power when necessary.
by Michael Dunn
Create custom tasks in your app's jump list on Windows 7

Latest Articles

by Clifford Nelson
Shows how to set DataContext of View to itself using XAML and discusses the advantages of INotifyPropertyChanged to DependencyProperty
by Taehoon Kim 1004
Capture program using GDI
by Suarte
A hands on example of domain driven design - Part 3
by Timo Kunze
Use undocumented parts of the Windows Vista list view API to enhance your application.

All Articles

Sort by Score

WTL 

13 Jun 2002 by Tim Smith
Color picker control for WTL applications including optional support for XP themes
5 Mar 2009 by Ernest Laurentin
Full-fledged ATL Windowless ActiveX Container. Ideal for hosting Windows Media Player, Transparent Flash and Silverlight Animations.
25 Sep 2008 by Rajesh R Subramanian
Of all your questions I've attempted, this is the toughest one, Christian.First off, .NET and C++ (I will say only C++ in this message. But, When I say C++, include the frameworks and libraries built on and around it - MFC, ATL, WTL, etc.,) are...
29 Dec 2006 by Michael Dunn
How to use power status notifications to make your applications conserve power when necessary.
29 Jun 2009 by Michael Dunn
Create custom tasks in your app's jump list on Windows 7
16 Jul 2007 by PrafullaT
This is a toolbar for the Internet Explorer which shows information from RSS taken from the Internet.
31 Jan 2001 by Less Wright
This article will show you how to make use of WTL’s DDX/DDV implementation using a real world example.
20 Feb 2002 by Jens Nilsson
An article on the framework for implementing snapping windows.
21 Jun 2009 by _oti
A WTL Hunspell-checked edit control.
13 Aug 2009 by Stuart Dootson
The way I'd approach it is like this:1. Define functions that return random voewls and random consonants - here's a random vowel function:char RandomVowel(){ const char vowels[] = {'a', 'e', 'i', 'o', 'u'}; // Use rand() to get a number...
1 Sep 2009 by PARK Youngho
A tool that enumerates all fonts installed on Windows, and shows you the preview so as to help you code conveniently.
12 Oct 2009 by Jörgen Sigvardsson
In addition to what Stuart said, if you really don't want to change the function signature from floatto double, you can always use literals that are typed as float. If you add the suffix f to the floating point numbers, they will be typed float.Your examples would then be function(1.2f, 2f) and func
3 Sep 2013 by Nikolay Ananenko
Avoid horizontal scroll and effectivelly use whole horizontal control width: resize all columns except one to their content and this one to all remaining space.
4 Apr 2002 by Daniel Bowen
Issues and solutions when creating a new MDI child in a WTL application when the last active child was maximized
22 Aug 2008 by Perspx
I don't know about removing power but you can lock volumes with DeviceIoControl() with the FSCTL_LOCK_VOLUME which means that your process has exclusive access to that volume. Take a look at the documentation here. You could do this with the CD...
17 Oct 2009 by Rajesh R Subramanian
hanlei0000000009 wrote:I need my program sleep 1 microsecond, but Sleep() can not do this.Neither can any other API do this (under Windows). Windows was never designed to provide this kind of functionality (it is not a real-time OS). If you use something like Sleep(2), your program may sleep for 2 m
19 Sep 2011 by Yvan Rodrigues
How to install the WTL Wizard for Visual Studio 2010.
27 Jun 2001 by Rashid Thadha
An outlook control and framework that can be used in your WTL Application
22 Aug 2008 by Jijo.Raj
ameyakoshti wrote:1st of all i want to know whether it is possible to disable usb portsTo disable USB ports, check this[^]. You have to programatically access the registry and set the key.ameyakoshti wrote:and CD rom "POWER" through VC++.I hope...
30 Jan 2009 by CPallini
"text && text" If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.This is going on my arrogant assumptions....
30 Sep 2002 by Ernest Laurentin
Shows how to use Microsoft Script Hosting inside existing ATL/WTL Application
22 Aug 2008 by vikas amin
its simple by modifying the registery , check this linkhttp://forums.msdn.microsoft.com/en-US/vcgeneral/thread/15469774-bd67-4bed-b797-32a899eb79d3[^] Vikas AminMy First Article on CP" Virtual Serial Port "[^]modified on Thursday, July 24, 2008...
2 Aug 2009 by «_Superman_»
In an executable, there must be one entry point that can be called by the loader, runtime etc.There cannot be any ambiguity here.That is why we can have only one main function in a console program and only one WinMain function in a windows...
8 Aug 2009 by David Crow
See here. "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." -...
13 Feb 2009 by «_Superman_»
SetEndOfFile can be used to extend or truncate a file. «_Superman_»
8 Feb 2015 by tkontos
A WTL based, XML driven shortcut replacement
22 Dec 2001 by David Y. Zhao
This is a simple tabbed MDI for WTL
22 Apr 2009 by Stuart Dootson
Use std::inserter[^] or std::back_inserter[^] for the output iterator. That causes the items to be inserted into the container without having to know what size it should be before you've constructed it.If you're using a vector or list as the...
3 Aug 2008 by hoxsiew
int count; // Loop counter variableint correct;char correct_answers[count] = {B, D, A, A, C, A, B, A, C, D, B, C, D, A, D, C, C, B, D, A}This can only cause problems. correct_answers[count] should probably be correct_answers[NUM_QUESTIONS] since...
1 Aug 2009 by Bacon Ultimate Cheeseburger
Simply make a call to GetObjectType().
13 Aug 2009 by Stuart Dootson
Using Spy++ on a sample application I just built, it would seem that instead of edt1, you now want to use cmb13 (0x47c). I guess they decided that as that field is (now) actually a combo-box, that would be a better ID to use. Java, Basic, who...
13 Oct 2009 by Cedric Moonen
No, you can't select the type of the class this way. However, by using pointers (or references), you can manipulate all buildings the same way by manipulating pointers to the base class (this is called polymorphism, google for it if you want more information).What you want are virtual constructors,
4 Sep 2010 by Alain Rist
Hi,This bug in WTL 8.0 (Memory for dialog template is allocated using GMEM_FIXED flag and re-allocated without GMEM_MOVEABLE flag)[^] is fixed in the current (beta) WTL 8.1 files.If you want to stay on 8.0 you can download the fixed atldlgs.h at...
19 Dec 2008 by Stuart Dootson
I think you need to add the WTL include directory to the include directory path for the resource compiler. Right-click on the project, select 'Properties', select Resources->General in the properties window and add the WTL include directory to...
21 Apr 2009 by liquid_
How to compute difference and intersection of two sets?There are functions set_difference and set_intersection which requires two pairs of iterators of source sets and output iterator of resulting set. Here, set can be any sorted container with...
22 Sep 2008 by Christian Flutcher
I am progressing with my C++ learning. I am stuck with the following code. void ChangeData(int** ptr){ int ab = 1000; // scope in this method *ptr = &ab;}int _tmain(int argc, _TCHAR* argv[]){ int a = 10; int* aPtr = &a; ChangeData(&aPtr); cout...
22 Sep 2008 by Russell'
The variable is destroyed, but not the contents.You know the abbress s you can continue to check it's value...but, as you sad, it is wrong, so do not do it. The system can use the same locatio of that variable in any moment after that the...
22 Sep 2008 by Cedric Moonen
Christian Flutcher wrote:I am confused how this is happening?Because you were lucky (or in your case, not ). In your ChangeData function, your local variable has a certain address which you store in your ptr variable. When the function exits,...
10 Oct 2008 by led mike
Gut Mikh Tappe wrote:Please let me know what to do Ok I will try. What you need to do is read the documentation.[^]Also reading this might help as well.[^]In my experience not all authors match every reader. So if you find reading those sources...
10 Dec 2008 by Kiran Pinjala
Hi,I have creted a MFC SDI project in VC 2008 and compiled in Vista OS. Now when i copied the project into XP OS system and opened. I can open all views(class view, solution explorer...) but the resource view...it is showing a MessageBox statingA...
29 May 2009 by «_Superman_»
Call GetLogicalDrives to get all the available drive letters.Call GetSystemDirectory to get the drive which contains the OS.Open the volume using CreateFile("\\.\C:", ...Here replace C: with the drive letter returned in GetSystemDirectory.Call...
1 Jul 2009 by David Crow
Caslen wrote:If it is my problem is there anyway to detect programatically whether a file is already open somewhere else?Open it exclusively. All other attempts will fail. "Old age is like a bank account. You withdraw later in life what you...
1 Aug 2009 by «_Superman_»
OnCreate is called just when the application requests that the Create function be called. So it is not guarenteed that the window is fully created. OnInitDialog is called after the window (in this case the dialog) is completely created.When you...
16 Oct 2009 by Stuart Dootson
Yeah, that's not happening...Why 1 microsecond, FFS? What are you trying to do? Because there may well be a better way.
3 Apr 2009 by David Crow
The union looks something like this:-----------------------| 512 |-----------------------| 00000010 | 00000000 |-----------------------| 2 | 0 |----------------------- "Old age is like a bank account. You withdraw...
16 Oct 2010 by Aescleal
If you're using C++ there's no reason to use printf or the whole god awful family of C relics. Use a stream. Then you get type safety and you won't try reading return addresses off the stack to interpret as strings. Consider rewriting along the lines of:int main(){ int d = 20; ...
28 Oct 2010 by Paul Heil
A look at the undocumented message hook functions for Windows Mobile
7 Nov 2002 by Rob Caldecott
Use this class in your WTL apps to retrieve a list of installed printers
19 Dec 2008 by josip cagalj
Hi to all. I'm trying to open some project wroted using WTL. When I try to rebuild it (using VS2008 on Win XP) I get the compile error as above. Now, "atlres.h" file is in directory which I added to my project settings properly and I don't know...
26 May 2009 by followait
I tried as below, but ostream cannot be instantiate?ifstream ifs1("file1");ifstream ifs2("file2");ostream oss;oss
26 May 2009 by Stuart Dootson
ostream is an abstract base class - that's why you can't instantiate it. Also, you can't use the insertion operator on streams to get what you're wanting.So...what do you mean by "memory binary stream"? If you were using strings, then this should...
15 Oct 2010 by fantasy1215
Please run the code below.int main(int argc, char* argv[]){ int ii = 20; char tmp[32] = "loveing"; printf("[%d]hello[%s]\n", tmp); //no integer fill the %d format char szData[52] = {0}; sprintf(szData, "[%d]saying [%s]\n",ii);//no string fill the %s format printf("%s", szData); return 0;}The...
9 Sep 2008 by SandeepNK
Sample code is as follows:class TestClass{CCriticalSection m_csTest;void Fun1() { m_csTest.Lock(); Fun2(); MessageBox("In Fun1 critical section."); m_csTest.Unlock();}void Fun2(){ m_csTest.Lock(); MessageBox("In Fun2 critical...
25 Sep 2008 by Christian Flutcher
I know .NET framework and C# well. Recently I started working with C++/CLI which I felt more interesting than C#. Since .NET framework is becoming popular, do you think MFC got obsolete? Are you guys doing any projects in MFC other than...
10 Oct 2008 by Mark Salsbery
In addition to super_ttd's reply...If you must use fopen(), then you should probably use a CStringA.CString has a generic internal character type, depending on whetherUNICODE or _UNICODE is defined.If you want to use the generic text CString,...
7 Jan 2009 by CPallini
I suppose it depends on color depth... See BITMAP struct definition [^], the bmBitsPixel member looks promising. If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. ...
8 Jan 2009 by Code-o-mat
Take a look at this[^], might be usefull. > The problem with computers is that they do what you tell them to do and not what you want them to do.
8 Jan 2009 by Hamid_RT
OR see CRichEditControl50W - A VC++ Rich Text Edit 4.1 MFC Control[^]. Of one Essence is the human racethus has Creation put the baseOne Limb impacted is sufficientFor all Others to feel the Mace(Saadi )
27 Jan 2009 by Garth J Lancaster
1) this sounds like homework - we dont do homework - at best we will give you hints, but if you're expecting us to jump in and solve all your issues, go to RentACoder or such 2) DONT GET IMPATIENT AND POST MORE THAN ONCE - most of us here have...
22 Jun 2009 by Stuart Dootson
Member 4399131 wrote:I assumed that the problem isn't in my coding technique, it must be generally in the algorithm I use!!!Yep.Member 4399131 wrote:Does somebody know a better algorithm to implement FindOneOf???Looking at their code (strpbrk -...
2 Aug 2009 by CPallini
Because there is only one application in your application... If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of...
6 May 2010 by sashoalm
Here's my try:#include using namespace std;int main(int argc, char* argv[]){ string name; static const int namelen = 15; static const char* letters[2] = { "bcdfghjklmnpqrstvwxyz", "aeiouy" }; static const letterlen[2] = { strlen(letters[0]), strlen(letters[1])...
13 Aug 2009 by softwaremonkey
Hi,In an older (MSVC++6.0) project I used HideControl(edt1) to hide the filename edit control in a CFileDialog derrived class, which worked fine at the time.When I compile this project with MSDEV2008, the code complies OK but control is no longer...
13 Aug 2009 by Stuart Dootson
Could you do all of the automation, including creation of the Word object, on the worker thread?Basically you're running foul of COM single-threaded apartments and things, I think. This article[^] explains them well. Java, Basic, who cares - it's...
31 Aug 2009 by Moreno Airoldi
Consider this as a rough idea:#include void PrintArrayClockwise(int *array, int rows, int columns){ int r = 0; int rh = rows / 2; int i; while (r
15 Aug 2009 by Stuart Dootson
birajendu wrote:I want to write some code which will double click a desktop shortcut. or the alternate way is how can i run a desktop shurtcut using Createprocess() api.If you know the path to the desktop shortcut, then you should be able to use...
16 Aug 2009 by David Crow
The SetActivePage() method looks promising. "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown"Fireproof doesn't mean the fire will never come. It means when the fire comes that you...
15 Jul 2008 by CPallini
1.From the same article, below your quoted sentence.The LEA instruction uses hardwired address generation tables that makes multiplying by a select set of numbers very fast (for example, multiplying by 3, 5, and 9). Twisted, but true.That means...
13 Mar 2009 by Cedric Moonen
Which kind of string ? C style strings ? Then use strcat. std::string ? Then use the + operator. Cédric MoonenSoftware developerCharting control [v1.5]OpenGL game tutorial in C++
10 Mar 2009 by Iain Clarke, Warrior Programmer
I've just noticed you posted the same question four hours before. You really should have more patience! People volunteer to answer these questions. Asking the same one again in a short time is not helpful to you...Iain. Codeproject MVP for C++, I...
10 Oct 2008 by Maximilien
George_George wrote:I am developing for both x86 and x64. I stop mouse on size_t in the code, and "typedef unsigned int size_t" is always displayed. I think it is not correct for x64. Since x64 size_t is 64-bit and unsigned int on x64 is 32-bit....
10 Oct 2008 by Chris Losinger
from io.h (and crtdefs.h)#ifndef _SIZE_T_DEFINED#ifdef _WIN64typedef unsigned __int64 size_t;#elsetypedef _W64 unsigned int size_t;#endif#define _SIZE_T_DEFINED#endif image processing toolkits | batch image processing
27 May 2010 by Aescleal
If you're programming in C, then:strncpy( q, p, 499 );q[499] = '\0';will do the trick and work however long the string is. If you'd like to obfuscate things a bit more then you can combine the two lines into one by exploiting the return value of strncpy:strncpy( q, p, 499 )[ 499 ]...
31 May 2010 by Anu Koshy
if it is a text control, set "No Prefix" as True.That should solve the problem. :)
3 Aug 2010 by Jörgen Sigvardsson
You need to marshal calls across threads/apartments. See this[^] article for different ways to perform cross thread marshalling. CoMarshalInterThreadInterfaceInStream() would probably be the easiest approach. Look it up in the MSDN documentation. It's quite easy to use.
9 Jul 2012 by armagedescu
First you need to open the right theme from the current skin:hThm = OpenThemeData(hWnd, L"WINDOW");After that you may draw the needed thing with DrawThemeBackground,DrawThemeBackground( hThm, hDC, WP_CAPTION, CS_ACTIVE, &rc, 0 );
5 Aug 2012 by Anna-Jayne Metcalfe
Theme support in Visual Studio 2012
8 Mar 2013 by Sergey Alexandrovich Kryukov
For now, I can only answer your follow-up question on WTL documentation. WTL is not a Microsoft product anymore. This is open-source. Please see:http://en.wikipedia.org/wiki/WTL[^],http://sourceforge.net/projects/wtl/[^],http://wtl.sourceforge.net/[^].As to you main question, right...
5 Oct 2013 by Raymund Macaalay
How to use a Sybase with S#arp architecture and nHibernate
20 Apr 2016 by Suarte
A hands on example of domain driven design - Part 3
10 Mar 2002 by Rui Lopes
Class for Synchronizing the Active State of multiple windows.
4 Jul 2009 by Kannan Ramanathan
One more req I have to worry abt: The 64bit local server should be able to implement connection points (32bit client being the sink)...is this possible? Thanks.
28 Jul 2008 by sashoalm
MFC has issues with multiple threads and possibly also with dlls. In this case GetParentFrame() is the culprit as it makes an internal call to CWnd::FromHandle which looks like this:CWnd* PASCAL CWnd::FromHandle(HWND hWnd){ CHandleMap* pMap =...
8 Aug 2008 by Naveen
"_$h@nky_" wrote:HTREEITEM item = tc.GetSelectedItem(); Because you are setting the image of selected item. Use pnmtv->itemNew.hItemHTREEITEM item = pnmtv->itemNew.hItem; nave[OpenedFileFinder]
5 Sep 2008 by Ben Burnett
I was wondering if anyone knew of a straight forward way of calling (non-exported) functions in an executable from a DLL. We are building a, for lack of a better name, private plug-in system that will grant the plug-in access to all of a...
5 Sep 2008 by Garth J Lancaster
oohhh .. thats a hard one. Unless your executable exposes some sort of API I think you'd have to resort to using injection/hooking from the dll (which I presume is in another process) to access the functions in the executable, even then ......
10 Oct 2008 by DSPCottage
Dear AllIn visual C++ 2005 I want to change a CString file to char* I used following codeBut fopen needs a char* for its first parameterPlease let me know what to doRegards char...
10 Oct 2008 by super_ttd
It should do.So, what's wrong ? Do you get an error ?CString has an inner cast Operator (LPCTSTR) which converts the CString object to a const char* (if compiling ANSI) of const wchar_t* (if building unicode), so you should not have to do any...
23 Dec 2008 by CPallini
Merry Christmas to you, Iain (an anonymous fan ).Iain Clarke wrote:To those regulars who post great answers, thanks for educating me.To those posting interesting questions - thanks for helping me educate myself!BTW it looks like you missed the...
8 Jan 2009 by Iain Clarke, Warrior Programmer
Not quite sure where the question is here. It sounds like you're telling us about your day.Assuming you're needing some help with this...http://www.codeproject.com/KB/static/pphtmlstatic.aspx[^] should be of some help to you.Iain. Codeproject MVP...
27 Jan 2009 by arad.moradi
i don't know what is the reason of of error.i write it with c++ & i send what is it about.it is the code:#include #include #include using namespace std;class cart{public: cart(char a[2]="paq"){ cout
29 Jan 2009 by calducciano
Hi, I have a quick question. (well, hopefully the answer is as quick as my question as I'm sure I'm doing something dumb.)I have a direct sound application that runs just fine as a windows console app which makes sense because there is nothing...
29 Jan 2009 by Stuart Dootson
calducciano wrote:I know about MsgWaitForMultipleObjects but it just falls throughBut with what return code? That's what tells you if you a) have a message to process, or b) one of your handles has been signalled!For something like audio, I'd...
29 May 2009 by Madan Chauhan
Hi all,My application is for windows Vista and XP. There are more than on Hard drive connected to my machine. I need to get Drive Letters of the Hard drive from which my system is booting. By using GetLogicalDriveStrings Function I can get the...
2 Jun 2009 by agetina
I can read the prototypes for windows.h in the include folder (I have installed dev c++) but i want a list of explained functions. I don't know for what to use each of them.Thank you! modified on Wednesday, June 3, 2009 4:29 AM
2 Jun 2009 by CPallini
Well, usually you don't need to read the explanations of all Win32 API functions in order to be a developer. Anyway (you know) you may find help for each and every function online, for instance searching for EncodePointer (the first function I...
22 Jun 2009 by Ivan Ivanov 83
Hi AllI'm developing my own CString class. With the idea to make it "much" faster than the standard CString, easily upgradeable, and to include into it some non-standard parsing functions I often use in my work, those will be much better to be...
22 Jun 2009 by Skippums
Without knowing the logic behind the standard implementation, it is impossible to know why your algorithm is being beat. Perhaps the standard string stores data about specific searches so that, in your loop, it loads known results instead of...
22 Jun 2009 by Roger Stoltz
I think Stuart's advice to use the C runtime in this case is the best alternative.An algorithm can be optimized for different purposes and can also be better or worse in some scenarios. I guess the standard C runtime implementation is rather...