It's posible to save and load data to the cluipboard via datatypes library,and I have the simples case working fine. SketchBlock now supports copying and pasteing layers via the clipboard.
Using DTST_CLIPBOARD as source type with NewDatatypeObject allows loading from any clipboard unit. I think I have that working too.
To write to the clipboard you need the DTM_CopY method as faras I can tell. I can't see a way of specifying unit for this.
Anyone know how?
I don't think it's possible currently. AFAIK SaveDTObject()/DTM_WRITE only allows writing to files even when using DTWM_IFF, although technically I don't see why this couldn't be extended to allow writing to clipboard (for IFF based datatypes only of course) by f.e. specifying DTA_SourceType (or a new DTA_DestType which could be an alias for DTA_SourceType) as DTST_CLIPBOARD in the taglist similar to how it's done for reading with NewDTObject().
Actually is is possible tocopy to the cluipboard allready using the DTM_COPY method. The method is not mentioned in the datatypes.libray autdoc but is mwentioned in the subclasses ie picture.datatype text.datatype etc.
Nowhere does it say how or whether you can choose the clipboard unit.
I doubt that you can select clipboard unit with DTM_COPY because the BOOPSI message structure for it is this:
The only way I can think of it would be possible is if there was OM_SET:able attribute that I don't know about for setting which clipboard unit to use.
Do you guys have any working example code how to do this ?
Reading from the clipboard is as easy as....
Writing to the clip is as follows
It would appear that sometime after starting this thread I learn't about those clip unit number options, but I've no recollection of where I found it!