🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Frontpage not recognizing HTML clipboard content (while outlook does)

#13092
From: Remy Lebeau (TeamB)
Date: Sun, 26 Oct 2003 20:35
41 lines
2678 bytes
"Kris" <myEmail@email.com> wrote in message
news:8genpv8c6stmgjkipugr5s8kbc0j82qfmq@4ax.com...

> HTML_hglbCopy= GlobalAlloc(GMEM_MOVEABLE,HTML_ClipboardData.Length());

As has already been pointed out to you earlier, you need to include the
terminating NULL character:

    HTML_hglbCopy = GlobalAlloc(GMEM_MOVEABLE,
HTML_ClipboardData.Length()+1);
...
    memcpy(HTML_lptstrCopy, HTML_ClipboardData.c_str(),
HTML_ClipboardData.Length()+1);

>    SetClipboardData(HTML_ClipboardID,HTML_hglbCopy);
>    GlobalUnlock(HTML_hglbCopy);

You should be unlocking the memory BEFORE you assign it to the clipboard:

    GlobalUnlock(HTML_hglbCopy);
    SetClipboardData(HTML_ClipboardID, HTML_hglbCopy);

> But I recently noticed that Frontpage (2003) does not pick the
> HTML content. In fact it always chooses the RichEdit content
> (and if that's not available it picks the plain text content), but it
> never picks my HTML content.

Are you putting the RTF content onto the clipboard at the same time as the
HTML content?  If so, then you have to keep in mind that when multiple
formats are available at a time, applications are free to choose whichever
format they want to work with.  It might just be that when RTF is available,
FP may *prefer* to work with the RTF before deciding to use any other
format.  As for why it would pick the plain text content over the HTML
content, I do not know.  Are you sure that "HTML Format" is the correct
register name for HTML content?  When you copy HTML to the clipboard
normally (not programmably), such as from FP itself, and then enumerate the
clipboard formats via EnumClipboardFormats(), what is actually returned?


Gambit
Technical Details
Message-ID: <3f9c2f64@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <8genpv8c6stmgjkipugr5s8kbc0j82qfmq@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,177767db8f4762b4
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-26 12:39:10 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <8genpv8c6stmgjkipugr5s8kbc0j82qfmq@4ax.com>
Subject: Re: Frontpage not recognizing HTML clipboard content (while outlook does)
Date: Sun, 26 Oct 2003 12:35:16 -0800
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.137.75
Message-ID: <3f9c2f64@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1067200356 67.22.137.75 (26 Oct 2003 12:32:36 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail