Re: Embed Adobe Reader
- Posted by mattlewis (admin) Feb 01, 2012
- 1956 views
buzzo said...
Matt,
have this in AcroPDF.ew
global function pdf_LoadFile( atom obj, sequence fileName ) --puts(1,w32ToString(obj) & " " & w32ToString(fileName)) in console this returns obj as 1 ... correct path and filename atom bstr, result bstr = alloc_bstr( fileName ) result = invoke( obj, {AcroPDF_m_LoadFile}, {bstr}, {VT_BSTR}, DISPATCH_METHOD ) free_bstr( bstr ) print_com_error(1) this returns the console stuff I sent earlier return result end function
If I comment out print_com_error(1), there is no console error generated. I get a message box generated by AcroView.exw:
VOID = message_box( "Unable to load file:\n" & filename, "AcroView Error", MB_ICONEXCLAMATION )
You don't need print_com_error() there, and the way you're using it is an error. You need to call com_err_out(1) somewhere before you start calling COM routines. That should result in some stuff being printed in the console.
Matt