📄 wtl for mfc programmers, part i.mht
字号:
width=3D16></TD>
<TD class=3DsmallText><A=20
href=3D"http://www.codeproject.com/store/"><B>MSDN =
Univ. from=20
$1950</B></A></TD></TR>
<TR vAlign=3Dtop>
<TD></TD>
<TD></TD></TR>
<TR vAlign=3Dtop>
<TD><IMG height=3D16=20
src=3D"http://www.codeproject.com/images/print.gif" =
width=3D16></TD>
<TD class=3DsmallText><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp?print=3Dtrue"=20
target=3D_print>Print version</A></TD></TR>
<TR vAlign=3Dtop>
<TD><IMG height=3D16=20
src=3D"http://www.codeproject.com/images/link.gif" =
width=3D16></TD>
<TD class=3DsmallText><A=20
=
href=3D"http://www.codeproject.com/script/profile/add_bookmark.asp?t=3D0&=
amp;ct=3D%2Fwtl%2Fwtl4mfc1%2Easp&guid=3DWTL4MFC1%2Fwtl3%2F22%2F2003">=
Bookmark=20
this</A></TD></TR></TR>
<TR vAlign=3Dtop>
<TD><IMG height=3D16=20
src=3D"http://www.codeproject.com/images/mail.gif" =
width=3D16></TD>
<TD class=3DSmallText><A=20
=
href=3D"http://www.codeproject.com/script/recommend/form.asp?guid=3DWTL4M=
FC1%2Fwtl3%2F22%2F2003">Send=20
to a friend</A></TD></TR>
<TR vAlign=3Dtop>
<TD></TD>
<TD></TD></TR>
<TR vAlign=3Dtop>
<TD></TD>
<TD class=3DInfoBarHeader>My Profile</TD></TR>
<TR>
<TD bgColor=3Dblack colSpan=3D2><IMG height=3D1=20
src=3D"http://www.codeproject.com/images/space.gif"=20
width=3D1></TD></TR>
<TR vAlign=3Dtop>
<TD><IMG height=3D16=20
=
src=3D"http://www.codeproject.com/images/profile_small.gif"=20
width=3D16></TD>
<TD class=3DsmallText><A=20
=
href=3D"http://www.codeproject.com/script/profile/modify.asp?ct=3D/wtl/wt=
l4mfc1.asp">My=20
Settings</A></TD></TR>
<TR vAlign=3Dtop>
<TD><IMG height=3D16=20
=
src=3D"http://www.codeproject.com/images/submit_small.gif"=20
width=3D16></TD>
<TD class=3DsmallText><A=20
=
href=3D"http://www.codeproject.com/script/articles/list_articles.asp?user=
id=3D273403">My=20
Articles</A></TD></TR>
<TR vAlign=3Dtop>
<TD><IMG height=3D16=20
=
src=3D"http://www.codeproject.com/images/bookmarks.gif"=20
width=3D16></TD>
<TD class=3DsmallText><A=20
=
href=3D"http://www.codeproject.com/script/profile/bookmark_list.asp">My=20
Bookmarks</A></TD></TR>
<TR vAlign=3Dtop>
<TD><IMG height=3D16=20
=
src=3D"http://www.codeproject.com/images/logoff_small.gif"=20
width=3D16></TD>
<TD class=3DsmallText><A=20
=
href=3D"http://www.codeproject.com/script/profile/logoff.asp?ct=3D/wtl/wt=
l4mfc1.asp">Sign=20
out</A></TD></TR>
<TR>
<TD bgColor=3Dblack colSpan=3D2><IMG height=3D1=20
src=3D"http://www.codeproject.com/images/space.gif"=20
width=3D1></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD> </TD></TR>
<TR>
<TD>
<CENTER>
<SCRIPT language=3DJavaScript=20
=
src=3D"http://www.codeproject.com/script/admentor/include/flashad.js"></S=
CRIPT>
<SCRIPT language=3DJavaScript>
document.write(FlashAdText('/script/admentor/images/Infragisticstracker_s=
s.swf',
=
'http://www.codeproject.com/specials.asp?id=3D538',
=
'/script/admentor/images/InfragisticsTrackerss.JPG',
120,600));
</SCRIPT>
<BR></CENTER><BR></TD></TR></TBODY></TABLE></TD>
<TD width=3D5 rowSpan=3D2><IMG height=3D1=20
src=3D"http://www.codeproject.com/images/space.gif" width=3D5> =
</TD>
<TD align=3Dright width=3D"100%" bgColor=3Dwhite>
<TABLE width=3D"100%">
<TBODY>
<TR>
<TD class=3DsmallText vAlign=3Dtop noWrap><IMG=20
src=3D"http://www.codeproject.com/images/prize_winner.gif"=20
align=3DabsMiddle> <B>Prize winner: March, =
2003</B></TD>
<TD noWrap align=3Dright><A name=3D__top></A>
<TABLE>
<TBODY>
<TR>
<TD class=3DsmallText align=3Dright>154 members have =
rated this=20
article. Result:</TD>
<TD>
<TABLE cellSpacing=3D0 cellPadding=3D0 border=3D2>
<TBODY>
<TR>
<TD><IMG height=3D5=20
=
src=3D"http://www.codeproject.com/script/images/red.gif"=20
width=3D20 border=3D0></TD>
<TD><IMG height=3D5=20
=
src=3D"http://www.codeproject.com/script/images/red.gif"=20
width=3D20 border=3D0></TD>
<TD><IMG height=3D5=20
=
src=3D"http://www.codeproject.com/script/images/red.gif"=20
width=3D20 border=3D0></TD>
<TD><IMG height=3D5=20
=
src=3D"http://www.codeproject.com/script/images/red.gif"=20
width=3D20 border=3D0></TD>
<TD><IMG height=3D5=20
=
src=3D"http://www.codeproject.com/script/images/red.gif"=20
width=3D18 border=3D0><IMG height=3D5=20
=
src=3D"http://www.codeproject.com/script/images/white.gif"=20
width=3D2 =
border=3D0></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD class=3DsmallText align=3Dright colSpan=3D2><A=20
title=3D"Calculated as rating x Log10(# votes)"=20
=
href=3D"http://www.codeproject.com/script/articles/top_articles.asp?st=3D=
2">Popularity:=20
10.73</A>. Rating: <B>4.9</B> out of=20
5.</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD vAlign=3Dtop width=3D"100%">
<DIV id=3Dcontentdiv><!-- Article Starts -->
<UL class=3Ddownload>
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/WTL4MFC1/WTL4MFC1_demo.zip">Downlo=
ad=20
demo project - 24K</A> </LI></UL><!-- Add the rest of your HTML =
here -->
<H2>Contents</H2>
<UL>
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#readme">README.TXT</A=
>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#seriesintro">Introduc=
tion=20
to the Series</A>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#intopart1">Introducti=
on=20
to Part I</A>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#atlbackground">ATL=20
Background</A>=20
<UL>
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#atlhistory">ATL and=20
WTL history</A>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#atltemplates">ATL-sty=
le=20
templates</A> </LI></UL>
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#atlwindowing">ATL=20
Windowing Classes</A>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#windowimpl">Defining =
a=20
Window Implementation</A>=20
<UL>
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#msgmap">Filling in=20
the message map</A> </LI></UL>
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#advmsgmap">Advanced=20
Message Maps and Mix-in Classes</A>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#exestructure">Structu=
re=20
of an ATL EXE</A>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#dialogs">Dialogs in=20
ATL</A>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#whereswtlman">I'll =
Get=20
to WTL, I Promise!</A>=20
<LI><A=20
=
href=3D"http://www.codeproject.com/wtl/wtl4mfc1.asp#revisionhistory">Revi=
sion=20
History</A> </LI></UL>
<H2><A name=3Dreadme></A>README.TXT</H2>
<P>This is the stuff I want you to read first, before proceeding =
on or=20
posting messages to this article's discussion board.</P>
<P>You need the Platform SDK. You can't use WTL without it. You =
can use=20
the online <A=20
=
href=3D"http://www.microsoft.com/msdownload/platformsdk/sdkupdate/">SDK=20
Update</A> site, or <A=20
=
href=3D"http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-fu=
ll.htm">download=20
the CAB files</A> and run the setup locally. Be sure you use the =
utility=20
to add the SDK include and lib directories to the VC search path. =
You can=20
find this in the <I>Visual Studio Registration</I> folder in the =
Platform=20
SDK program group.</P>
<P>You need WTL. <A=20
=
href=3D"http://download.microsoft.com/download/VisualStudioNET/Install/7.=
0/WXP/EN-US/WTL70.exe">Download=20
version 7</A> from Microsoft. See the articles <A=20
=
href=3D"http://www.codeproject.com/wtl/wtlintro1.asp">"Introduction to =
WTL -=20
Part 1"</A> and <A =
href=3D"http://www.codeproject.com/wtl/wtlinst.asp">"Easy=20
installation of WTL"</A> for some tips on installing the files. =
Those=20
articles are rather out-of-date now, but still contain some good =
info. One=20
thing which I don't think is mentioned in those articles is how to =
tell VC=20
to search the WTL include directory. In VC 6, click =
<I>Tools|Options</I>=20
and go to the <I>Directories</I> tab. In the <I>Show directories =
for</I>=20
combo box, select <I>Include files</I>. Then add a new entry that =
points=20
to the directory where you put the WTL header files.</P>
<P>You need to know MFC, and know it well enough that you =
understand=20
what's behind the message map macros, and can edit the code marked =
"DO NOT=20
EDIT" with no problems.</P>
<P>You need to know Win32 API programming, and know it well. If =
you=20
learned Windows programming by going straight into MFC, without =
learning=20
how messages work at the API level, you are unfortunately going to =
have=20
trouble in WTL. If you don't know what a message's =
<CODE>WPARAM</CODE> and=20
<CODE>LPARAM</CODE> mean, you should read other articles (there =
are lots=20
of them here at CodeProject) so you understand.</P>
<P>You need to know C++ template syntax. See the <A=20
=
href=3D"http://www.codeproject.com/cpp/cppforumfaq.asp#other_cpp">VC =
Forum=20
FAQ</A> for links to C++ FAQs and template FAQs.</P>
<P>I will only be covering VC 6 features, but as far as I know =
everything=20
should work on VC 7. Since I don't use VC 7, I won't be able to =
help with=20
VC 7 problems. However, feel free to post VC 7 questions, as other =
readers=20
might be able to help.</P>
<H2><A name=3Dseriesintro></A>Introduction to the Series</H2>
<P>WTL rocks. It does. It has a lot of the power of MFC's GUI =
classes, yet=20
produces substantially smaller executables. If you're like me, and =
learned=20
GUI programming with MFC, you've become quite comfortable with all =
the=20
control wrappers MFC provides, as well as with the flexible =
message=20
handling built into MFC. If you're also like me and don't relish =
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -