winforms - DataObject GetDataPresent(format) returns true, and GetData(format) return null -
here's full setup i'm trying do: have activex control on web page (ugh), , want save it's view image, , post server. activex control not support directly, have take more round-about method.
the platform: ie8, windows 7, uac/ie protected mode off.
this method sending activex control message copy current view clipboard. once has done that, launch application via protocol handler (e.g. app:clipboard/blah/blah). program supposed grab data off clipboard right format (jpeg), , post url.
the code i'm using testing this:
var dataobject = clipboard.getdataobject(); trace.writeline("data formats on clipboard: " + dataobject.getformats().aggregate(" ",(s,v)=>s+v+ " ")); foreach (var fmt in dataobject.getformats()) { trace.writeline("getdatapresent on " + fmt + ": " + dataobject.getdatapresent(fmt)); trace.writeline("getdata on " + fmt +": " + !(dataobject.getdata(fmt,true)==null)); }
which results in following output when run handler:
data formats on clipboard: enhancedmetafile metafilepict getdatapresent on enhancedmetafile: true getdata on enhancedmetafile null: true getdatapresent on metafilepict: true getdata on metafilepict null: true
now, @ absolute loss why getdatapresent returns true, , getdata on same format string returns null. added bonus, know data making clipboard, can turn around , go paint.net , paste, , there's image.
any 1 run similar?
i have no clue going on managed api. ended p/invoking winapi functions.
Comments
Post a Comment