🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #7665

Re: DrawTextEx

#7665
From: Jonathan Benedicto
Date: Tue, 04 Jan 2005 18:54
42 lines
1895 bytes
I don't know if I'm being stupid, but what about this code ?

TRect r;

r.Left = 0;
r.Top = 0;
r.Right = lb->Width - 20;
r.Bottom = lb->ItemHeight;

if(!DrawText(lb->Canvas->Handle, cFileName.c_str(), cFileName.Length(), &r, 
DT_MODIFYSTRING | DT_PATH_ELLIPSIS))
    return;
else
    lb->Items->Add(cFileName);

-- 
Jonathan

"Petar Popara" <none> wrote in message 
news:41d5500e$1@newsgroups.borland.com...
>
>    I'm using this code:
>
> char a[200];
> strncpy(a, cFileName.c_str(), 199);
>
> RECT r;
> r.left   = 0;
> r.top    = 0;
> r.bottom = lb->ItemHeight;
> r.left   = lb->Width - 20;
>
> if (!DrawTextEx(lb->Handle, a, 199, &r, DT_MODIFYSTRING | 
> DT_PATH_ELLIPSIS,
> NULL))
>  return;
> else
>    lb->Items->Add(a);
>
>    But, it allways fails. "lb" it TListBox control. Am I doing something 
> wrong? I don't want to draw anything, just to format string.
> 
Technical Details
Message-ID: <41dae681$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!lnewsinpeer01.lnd.ops.eu.uu.net!emea.uu.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <41d5500e$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,42d3caa052e60398
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Jonathan Benedicto" <incorrect@no.server>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <41d5500e$1@newsgroups.borland.com>
Subject: Re: DrawTextEx
Date: Tue, 4 Jan 2005 13:54:59 -0500
Lines: 44
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 64.231.4.40
Message-ID: <41dae681$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1104864897 64.231.4.40 (4 Jan 2005 10:54:57 -0800)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsoutpeer01.lnd.ops.eu.uu.net!lnewsinpeer01.lnd.ops.eu.uu.net!emea.uu.net!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail