Page 1 of 1
istream -> imoniker (ShowHTMLDialog)
Posted: Sun Jan 20, 2008 6:53 pm
by bingo
it is no problem to show any html popup with ShowHTMLDialog
http://msdn2.microsoft.com/en-us/librar ... S.85).aspx .
but the imoniker is a url only (CreateURLMoniker or CreateURLMonikerEx) . it is possible to read from "about:..." or from resource (res:...) directly .
but i can not found any way to stream the html to this imoniker directly
1. create istream from html (in memory)
2. create imoniker
3. bind istream to imoniker

Posted: Sun Jan 20, 2008 7:57 pm
by SFSxOI
can't you only create IStream's for files and objects?
Posted: Sun Jan 20, 2008 8:40 pm
by bingo
Code: Select all
Import "mshtml.lib"
ShowHTMLDialog(hwndParent.l,pMk.l,pvarArgIn.l,pchOptions.p-unicode,pvarArgOut.l)
EndImport
Import "urlmon.lib"
CreateURLMonikerEx(pMkCtx.l,szURL.p-unicode,ppmk.l,dwFlags.l)
EndImport
#URL_MK_LEGACY = 0
VarResult.VARIANT
pMoniker.IMoniker
CreateURLMonikerEx(0,"about:123",@pMoniker,#URL_MK_LEGACY)
ShowHTMLDialog(0,pMoniker,0,"dialogHeight:100px;dialogWidth:250px;help:no;status:0;unadorned:0",@VarResult)
pMoniker\release()
End
mshtml.lib ...
http://kyf.net/tmp/mshtml.zip
this all is simple and useful in pb ! but how can "patch" this imoniker with any streams from
CreateStreamOnHGlobal_(my_html_in_memory,#True,@HtmlStream.IStream) ?
Posted: Sun Jan 20, 2008 11:20 pm
by SFSxOI
hmmm...I don't think CreateStreamOnHGlobal will do what you want. IStream is a storage object and CreateStreamOnHGlobal creates a stream object for a physical file that already exists and the result stream is stored in global memory....what you seem to want to do is put a stream in memory from something exisitng in memory already?
maybe a simple:
CopyMemory_(in_Destination, in_Source, in_ Length) ???
maybe:
http://msdn2.microsoft.com/en-us/librar ... tream.aspx
if you can convert it (its in .Net).
or maybe something on the C++ side for one of the stream functions:
http://msdn2.microsoft.com/en-us/librar ... S.80).aspx
Or...write it to disk first then stream the file with CreateStreamOnHGlobal ??
Posted: Mon Jan 21, 2008 9:00 am
by bingo