Article View: borland.public.cppbuilder.nativeapi
Article #13096Re: Frontpage not recognizing HTML clipboard content (while outlook does)
From: Kris
Date: Sun, 26 Oct 2003 21:47
Date: Sun, 26 Oct 2003 21:47
86 lines
4641 bytes
4641 bytes
On Sun, 26 Oct 2003 12:35:16 -0800, "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> wrote: >As has already been pointed out to you earlier, you need to include the >terminating NULL character: Yes, I know and I understood that. I already fixed that. Unfortunately the code sample I posted was slightly outdated and still without the +1. Unfortunately the extra byte doesn't solve the problem. >You should be unlocking the memory BEFORE you assign it to the clipboard: Thanks. That fix is now also in place. However, the problem is also still present. >Are you putting the RTF content onto the clipboard at the same time as the >HTML content? Yes. I'm putting Text, RTF and HTML on the clipboard at the same time. >It might just be that when RTF is available, >FP may *prefer* to work with the RTF before deciding to use any other >format. It would be strange that FP, being an HTML editor, would prefer other content over HTML-content. But you never know. So I already had put only HTML content on the clipboard (and thus no text and RTF content). In that case Frontpage does enable the PASTE command but nothing gets pasted. But Outlook and Outlook express are able to recognize that HTML content and paste it properly. >Are you sure that "HTML Format" is the correct >register name for HTML content? When you copy HTML to the clipboard Pretty sure. If you do a search in google for RegisterClipboardFormat AND "HTML format" you get lots of hits. Also since Outlook is recognizing this content it is probably the correct name. >and then enumerate the >clipboard formats via EnumClipboardFormats(), what is actually returned? I'll give that a try. Thanks for the tip (but I'm expecting to get the same value since other applications (oulook) do pick up the HTML content). But I'll check it out anyway. Kris > >"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:
<5teopvcme541s9i5u32k81o0a45lbrv9k3@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<8genpv8c6stmgjkipugr5s8kbc0j82qfmq@4ax.com> <3f9c2f64@newsgroups.borland.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 14:01:55 PST From: Kris <myEmail@email.com> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Frontpage not recognizing HTML clipboard content (while outlook does) Date: Sun, 26 Oct 2003 22:47:50 +0100 Message-ID: <5teopvcme541s9i5u32k81o0a45lbrv9k3@4ax.com> References: <8genpv8c6stmgjkipugr5s8kbc0j82qfmq@4ax.com> <3f9c2f64@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: 81.11.136.135 X-Trace: newsgroups.borland.com 1067204859 81.11.136.135 (26 Oct 2003 13:47:39 -0700) Lines: 87 Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newshosting.com!news-xfer2.atl.newshosting.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail