Re: extra long filenames and WTL
"'Konstantin Mironovich' [email protected] [wtl]" <[email protected]> Tue, 1 Nov 2016 13:50:21 +0300
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Organization | ixbt.com |
| Message-ID | <967CB0A8FAA44B3A8920FF3BCEC66D22@KLM64> |
------=_NextPart_000_006A_01D23446.E46CB410
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: 8bit
Hi,
personally I use CString.
but I thing using CHeapPtr<TCHAR> is more preferable. CHeapPtr class is more
simple than CString and has less dependencies.
the code looks like
CHeapPtr<TCHAR> buf;
DWORD len = _MAX_PATH;
do { buf.Reallocate(len); ... } while ( ... )
-km
----- Original Message -----
From: [email protected] [wtl]
To: [email protected]
Sent: Sunday, October 16, 2016 1:09 PM
Subject: [wtl] extra long filenames and WTL
with extra long filenames becoming a reality there needs to be some
dusting off with WTL headers that specify MAX_PATH constant. Instead of
fixed buffers we'd better off using CStrings everywhere. See here
www.zabkat.com/blog/long-8.3-path-names.htm
------=_NextPart_000_006A_01D23446.E46CB410
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<head>
<style type=3D"text/css">
<!--
/* start of attachment style */
.ygrp-photo-title{
clear: both;
font-size: smaller;
height: 15px;
overflow: hidden;
text-align: center;
width: 75px;
}
div.ygrp-photo{
background-position: center;
background-repeat: no-repeat;
background-color: white;
border: 1px solid black;
height: 62px;
width: 62px;
}
div.photo-title=20
a,
div.photo-title a:active,
div.photo-title a:hover,
div.photo-title a:visited {
text-decoration: none;=20
}
div.attach-table div.attach-row {
clear: both;
}
div.attach-table div.attach-row div {
float: left;
/* margin: 2px;*/
}
p {
clear: both;
padding: 15px 0 3px 0;
overflow: hidden;
}
div.ygrp-file {
width: 30px;
valign: middle;
}
div.attach-table div.attach-row div div a {
text-decoration: none;
}
div.attach-table div.attach-row div div span {
font-weight: normal;
}
div.ygrp-file-title {
font-weight: bold;
}
/* end of attachment style */
-->
</style>
</head>
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dutf-8" http-equiv=3DContent-Type>
<META name=3DGENERATOR content=3D"MSHTML 8.00.6001.19727"></HEAD>
<BODY style=3D"BACKGROUND-COLOR: #fff" bgColor=3D#ffffff>
<!-- |**|begin egp html banner|**| -->
<br><br>
<!-- |**|end egp html banner|**| -->
<DIV><FONT face=3DCalibri>Hi,</FONT></DIV>
<DIV><FONT face=3DCalibri>personally I use CString.</FONT></DIV>
<DIV><FONT face=3DCalibri>but I thing using CHeapPtr<TCHAR> is more=20
preferable. CHeapPtr class is more simple than CString and has less=20
dependencies.</FONT></DIV>
<DIV><FONT face=3DCalibri>the code looks like</FONT></DIV>
<DIV><FONT face=3DCalibri>CHeapPtr<TCHAR> buf;</FONT></DIV>
<DIV><FONT face=3DCalibri>DWORD len =3D _MAX_PATH;</FONT></DIV>
<DIV><FONT face=3DCalibri>do { buf.Reallocate(len); ... } while ( ...=
=20
)</FONT></DIV>
<DIV><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT face=3DCalibri></FONT><FONT face=3DCalibri></FONT> </DIV>
<DIV><FONT size=3D2>-km<BR></FONT></DIV>
<BLOCKQUOTE=20
style=3D"BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: =
0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV=20
style=3D"FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>Fro=
m:</B>=20
<A [email protected]=20
href=3D"mailto:[email protected] [wtl]">[email protected] [wtl]</A> <=
/DIV>
<DIV style=3D"FONT: 10pt arial"><B>To:</B> <A [email protected]=
=20
href=3D"mailto:[email protected]">[email protected]</A> </DIV>
<DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Sunday, October 16, 2016 1:0=
9=20
PM</DIV>
<DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [wtl] extra long filename=
s and=20
WTL</DIV>
<DIV><BR></DIV><SPAN style=3D"DISPLAY: none"> </SPAN>=20
<DIV id=3Dygrp-text>
<P>
<P><SPAN>with extra long filenames becoming a reality there needs to be s=
ome=20
dusting off with WTL headers that specify MAX_PATH constant. Instead of f=
ixed=20
buffers we'd better off using CStrings everywhere. See here</SPAN></P><SP=
AN>
<DIV><BR></DIV>
<DIV><A href=3D"http://www.zabkat.com/blog/long-8.3-path-names.htm" rel=
=3Dnofollow=20
target=3D_blank>www.zabkat.com/blog/long-8.3-path-names.htm</A></DIV>
<P><BR class=3Dyui-cursor></P></SPAN>
<P></P></DIV><!-- end group email -->
<!-- |**|begin egp html banner|**| -->
<br>
<br>
<!-- |**|end egp html banner|**| -->
<div width=3D"1" style=3D"color: white; clear: both;"/>__._,_.___</div>
=20=20=20=20=20=20
=20=20
=20=20=20=20
<div id=3D"fromDMARC" style=3D"clear:both; margin-top: 10px;">
<hr style=3D"height:2px ; border-width:0; color:#E3E3E3; backgroun=
d-color:#E3E3E3;">
Posted by: "Konstantin Mironovich" <[email protected]>=
; <hr style=3D"height:2px ; border-width:0; color:#E3E3E3; backgrou=
nd-color:#E3E3E3;">
</div>
<!-- Start Recommendations -->
<!-- End Recommendations -->
<!-- |**|begin egp html banner|**| -->
<img src=3D"http://geo.yahoo.com/serv?s=3D97476590/grpId=3D488621/grpspId=
=3D1705006764/msgId=3D16723/stime=3D1477997430" width=3D"1" height=3D"1"> <=
br>
<!-- |**|end egp html banner|**| -->
=20=20=20=20
<!-- |**|begin egp html banner|**| -->
<br>
=20=20=20
=20=20=20=20=20
=20
<!-- |**|begin egp html banner|**| -->
<div id=3D"ygrp-vital" style=3D"background-color: #f2f2f2; font-fam=
ily: Verdana; font-size: 10px; margin-bottom: 10px; padding: 10px;">
<span id=3D"vithd" style=3D"font-weight: bold; color: #333; text-tr=
ansform: uppercase; "><a href=3D"https://groups.yahoo.com/neo/groups/wtl/in=
fo;_ylc=3DX3oDMTJkNHNiM3RiBF9TAzk3MzU5NzE0BGdycElkAzQ4ODYyMQRncnBzcElkAzE3M=
DUwMDY3NjQEc2VjA3Z0bARzbGsDdmdocARzdGltZQMxNDc3OTk3NDMw" style=3D"text-deco=
ration: none;">Visit Your Group</a></span>
<ul style=3D"list-style-type: none; margin: 0; padding: 0; display: in=
line;">
</ul>
</div>
<div id=3D"ft" style=3D"font-family: Arial; font-size: 11px; margin-top: 5p=
x; padding: 0 2px 0 0; clear: both;">
<a href=3D"https://groups.yahoo.com/neo;_ylc=3DX3oDMTJjN3AxdjVwBF9TAzk3ND=
c2NTkwBGdycElkAzQ4ODYyMQRncnBzcElkAzE3MDUwMDY3NjQEc2VjA2Z0cgRzbGsDZ2ZwBHN0a=
W1lAzE0Nzc5OTc0MzA-" style=3D"float: left;"><img src=3D"http://l.yimg.com/r=
u/static/images/yg/img/email/new_logo/logo-groups-137x15.png" height=3D"15"=
width=3D"137" alt=3D"Yahoo! Groups" style=3D"border: 0;"/></a>
<div style=3D"color: #747575; float: right;"> • <a href=3D"https://i=
nfo.yahoo.com/privacy/us/yahoo/groups/details.html" style=3D"text-decoratio=
n: none;">Privacy</a> • <a href=3D"mailto:wtl-unsubscribe@yahoogroups.=
com?subject=3DUnsubscribe" style=3D"text-decoration: none;">Unsubscribe</a>=
• <a href=3D"https://info.yahoo.com/legal/us/yahoo/utos/terms/" style=
=3D"text-decoration: none;">Terms of Use</a> </div>
</div>
<!-- |**|end egp html banner|**| -->
</div> <!-- ygrp-msg -->
=20=20=20
<br>
<!-- |**|end egp html banner|**| -->
<div style=3D"color: white; clear: both;"/>__,_._,___</div>
</BODY></HTML>
------=_NextPart_000_006A_01D23446.E46CB410--