🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Clipbored and Unicode

#1954
From: Bob Gonder
Date: Mon, 14 May 2007 19:44
21 lines
1606 bytes
Remy Lebeau (TeamB) wrote:

>        try
>        {
>            void *pData = GlobalLock(hData);
>            memcpy(pData, pStr, ulSize);
>            GlobalUnlock(hData);
>            cb->SetAsHandle(CF_UNICODETEXT, (int) hData);
>        }
>        __finally {
>            GlobalFree(hData);

Are you sure you want to do that ( GlobalFree )?
From BDS help:
Do not delete a handle after passing it to SetAsHandle. The handle
belongs to the clipboard, which will free it.
From MSDN:
The application may not write to or free the data once ownership has
been transferred to the system, 
http://msdn2.microsoft.com/en-us/library/ms649051.aspx
 
Technical Details
Message-ID: <6deh43h7sivjtn2e614s6hj3ss6217dok1@4ax.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <qdde43trid2dep05rjl9pu2k2ohufnguf1@4ax.com> <46489979$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,eee29c0be9200ce9
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bob Gonder <notbg@notmindspring.invalid>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Clipbored and Unicode
Date: Mon, 14 May 2007 12:44:06 -0700
Organization: MindSpring Enterprises, Inc.
Reply-To: notbg@notmindspring.invalid
Message-ID: <6deh43h7sivjtn2e614s6hj3ss6217dok1@4ax.com>
References: <qdde43trid2dep05rjl9pu2k2ohufnguf1@4ax.com> <46489979$1@newsgroups.borland.com>
X-Newsreader: Forte Agent 1.93/32.576 English (American)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 67.77.147.10
X-Trace: newsgroups.borland.com 1179171845 67.77.147.10 (14 May 2007 12:44:05 -0700)
Lines: 22
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail