Thread View: comp.os.ms-windows.programmer.ole
2 messages
2 total messages
Started by Jon Shemitz
Wed, 18 Feb 1998 00:00
How to initiate "OLE DDE"? Part 2.
Author: Jon Shemitz
Date: Wed, 18 Feb 1998 00:00
Date: Wed, 18 Feb 1998 00:00
44 lines
2724 bytes
2724 bytes
I wrote:
> A customer wants me to write some code to continually export some of
> their app's state data, so that customers can write Excel spreadsheets
> to do more analysis than they provide. Both for marketing reasons, and
> because DDE can be slow (especially over a network), they want this to
> be "an OCX" (or at least use OLE).
[and]
> (1) In the deprecated old days of DDE, I would just put a topic
> description on the clipboard in "link" format, and users would Paste
> Special. What's the analogous process for IDataObject/IAdviseSink
> conversations?
At this point, I have a data object that represents (a mockup of) the
data I want to export. I can do a 'static paste' by using
OleSetClipboard() to put this on the clipboard; Excel then sees the CSV
format (but not the XlTable format?), and can paste it. Alas, this won't
cut it for a 'dynamic paste', because for reasons of their own Microsoft
makes a copy of my data object in OleSetClipboard(), and the copy does
not support DAdvise.
After spending a long time with Inside OLE trying to figure how to
initiate a dynamic paste, it looks like I'm supposed to put a data
object that offers to stream a moniker (the "Link Source" format) and to
copy an OBJECTDESCRIPTOR and a couple of strings (the "Link Source
Descriptor" format) to an HGLOBAL on the clipboard. I've written what
look like they should be working File and Item moniker objects, and have
a data object that offers the source and descriptor formats.
The thing is, when I do OleSetClipboard(), the data object gets asked
for the OBJECTDESCRIPTOR but not the moniker. Excel disables the Paste
and Paste Special options.
Is this the right approach? Am I just passing the wrong values in my
OBJECTDESCRIPTOR? Or have I gone down the wrong path?
--
http://www.midnightbeach.com - for info about me, my work, my writing,
and my homeschool resource pages.
Re: How to initiate "OLE DDE"? Part 2.
Author: Jon Shemitz
Date: Thu, 19 Feb 1998 00:00
Date: Thu, 19 Feb 1998 00:00
46 lines
3080 bytes
3080 bytes
After looking at what Excel and Word put on the clipboard, I realized
that (part of) what I have to do is to create a single data object that
offers both the static data AND the "ObjectLink" and "Link Source
Descriptor" (so far, I've resisted the temptation to write code that
refers to the LSD) formats. When I do this, Excel enables Paste Special
and its Paste Link options, and pasting creates something that looks
plausible in the formula: ClassName|ExeName!Item.
Thing is (things are?) (1) the data for the array all comes out as #REF!
(2) my file moniker is never created (yes, it >appears< to be in the
registry properly, and I can successfully create a copy via a routine
that (if I understand the framework dox properly) uses its class
factory) and (3) the "Link Source" format still never gets read.
What am I still doing wrong? Doesn't ANYONE KNOW? This is driving me
crazy!
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
I wrote:
> At this point, I have a data object that represents (a mockup of) the
> data I want to export. I can do a 'static paste' by using
> OleSetClipboard() to put this on the clipboard; Excel then sees the CSV
> format (but not the XlTable format?), and can paste it. Alas, this won't
> cut it for a 'dynamic paste', because for reasons of their own Microsoft
> makes a copy of my data object in OleSetClipboard(), and the copy does
> not support DAdvise.
>
> After spending a long time with Inside OLE trying to figure how to
> initiate a dynamic paste, it looks like I'm supposed to put a data
> object that offers to stream a moniker (the "Link Source" format) and to
> copy an OBJECTDESCRIPTOR and a couple of strings (the "Link Source
> Descriptor" format) to an HGLOBAL on the clipboard. I've written what
> look like they should be working File and Item moniker objects, and have
> a data object that offers the source and descriptor formats.
>
> The thing is, when I do OleSetClipboard(), the data object gets asked
> for the OBJECTDESCRIPTOR but not the moniker. Excel disables the Paste
> and Paste Special options.
--
http://www.midnightbeach.com - for info about me, my work, my writing,
and my homeschool resource pages.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads