davidkim Posted December 11, 2010 Share Posted December 11, 2010 (edited) Before help step 1 download this file : http://erp.foxitsoftware.com/customer/pr...Bmb3hpdHNvZnR3YXJlLmNvbQ== step 2 download FoxitReader_AX_Std_Eval.OCX to Drive C:\FoxitReader_AX_Std_Eval.OCX step 3 regsvr32 c:\FoxitReader_AX_Std_Eval.OCX step 4 make this code Foxit_Reader_Error.au3 (1.15K) expandcollapse popup; Step 1 ; Download FoxitReader_AX_Std_Eval.OCX is c:\FoxitReader_AX_Std_Eval.OCX Save ; Step 2 ; regsvr32 c:\FoxitReader_AX_Std_Eval.OCX ; Window MSGBOX [FoxitReader_AX_Std_Eval.OCX DllRegisterServer OK] ; Step 3 running this script #include<GUIConstantsEx.au3> #include<WindowsConstants.au3> $PDFViewer = ObjCreate("Foxit.FoxitReaderSDKCtrl.3") If Not IsObj($PDFViewer) Then MsgBox(0,'','not') Exit EndIf $Gui = GUICreate ( "Foxit PDF Reader", 830, 580,(@DesktopWidth-830)/2, (@DesktopHeight-580)/2 , _ Bitor($WS_OVERLAPPEDWINDOW ,$WS_VISIBLE , $WS_CLIPSIBLINGS)) $GUIActiveX = GUICtrlCreateObj ( $PDFViewer, -1, -1, @DesktopWidth, @DesktopHeight) GUICtrlSetResizing ( $GUIActiveX, $GUI_DOCKAUTO) GUISetState () ; Step 4 Error $PDFViewer.OpenFile ("C:\test.pdf" ,"" ); ; <======= error ; ErrorMsg is ; Line29 (File "C:\Foxit_Reader_Error.au3"); ; $PDFViewer.OpenFile ("C:\test.pdf"); ; $PDFViewer.OpenFile ("C:\test.pdf")^ERROR ; Error: The requested action with this object has failed. While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop Wend GUIDelete() FoxitActiveX30_guide.pdf.... /////////////////////////////////////////////////////////////////////////// Tutorials The Foxit Reader SDK ActiveX control comes with a single OCX file. To install it, please use command "regsvr32 foxitreader_ax.ocx". You may need to specify the proper path if foxitreader_ax.ocx is not stored in current directory. The ActiveX control handles user interface for you. It also supplies multiple properties and methods so that your application is able to control the ActiveX. The following is a example, suppose we had already created an ActiveX control called FoxitReaderSDK. 1) Open a PDF File We will open a PDF document named “testdoc.pdf” // NOTE: If you are evaluating ActiveX, you don’t need to unlock it, // then evaluation marks will be shown on all PDF pages. // For paid customers, please unlock the ActiveX first. FoxitReaderSDK.UnLockActiveX(“license_id”,”unlock_code”); FoxitReaderSDK.OpenFile(“testdoc.pdf”,””); ////////////////////////////////////////////////////////////////////////////////////////////// step 5 run this script file step 6 error msg: Error: The requested action with this object has failed. step 7 help me.... Edited December 12, 2010 by davidkim I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks. Link to comment Share on other sites More sharing options...
trancexx Posted December 11, 2010 Share Posted December 11, 2010 That's why smart people thought ObjEvent function would be good addition to AutoIt. Use it and you will be much smarter, at least regarding this. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
davidkim Posted December 12, 2010 Author Share Posted December 12, 2010 (edited) reply not delete... this reply edit Edited December 12, 2010 by davidkim I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks. Link to comment Share on other sites More sharing options...
davidkim Posted December 12, 2010 Author Share Posted December 12, 2010 (edited) Currently it records the (Reply) by mistake and it stands and to Delete the Reply elimination which wants does not become. It eliminates the (Reply) how. It informs and it requests Edited December 12, 2010 by davidkim I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks. Link to comment Share on other sites More sharing options...
Zedna Posted December 12, 2010 Share Posted December 12, 2010 Use this: $PDFViewer.OpenFile("C:\test.pdf","") instead of this: $PDFViewer.OpenFile("C:\test.pdf") Also add error handler to see detailed error description as was said. Just add this at begin of your script: $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) Endfunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
davidkim Posted December 12, 2010 Author Share Posted December 12, 2010 (edited) Use this: $PDFViewer.OpenFile("C:\test.pdf","") instead of this: $PDFViewer.OpenFile("C:\test.pdf") Also add error handler to see detailed error description as was said. Just add this at begin of your script: $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) Endfunc Thank's Zedna $PDFViewer = ObjCreate("Foxit.FoxitReaderSDKCtrl.3") Func MyErrFunc() Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & hex($oMyError.number,8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) Endfunc This code insert ....... Error msg: error msg : It is an error which is fatal this code insert...... error msg: $PDFViewer.OpenFile ("C:\test.pdf" ); FoxitReader_AX_Std_Eval.OCX was Menual ----------------------------------------------------------- Tutorials The Foxit Reader SDK ActiveX control comes with a single OCX file. To install it, please use command "regsvr32 foxitreader_ax.ocx". You may need to specify the proper path if foxitreader_ax.ocx is not stored in current directory. The ActiveX control handles user interface for you. It also supplies multiple properties and methods so that your application is able to control the ActiveX. The following is a example, suppose we had already created an ActiveX control called FoxitReaderSDK. 1) Open a PDF File We will open a PDF document named “testdoc.pdf” // NOTE: If you are evaluating ActiveX, you don’t need to unlock it, // then evaluation marks will be shown on all PDF pages. // For paid customers, please unlock the ActiveX first. FoxitReaderSDK.UnLockActiveX(“license_id”,”unlock_code”); FoxitReaderSDK.OpenFile(“testdoc.pdf”,””); --------------------------------------------------------------------------------- Edited December 12, 2010 by davidkim I interest am many quite in AutoitScript.From that is [http://cafe.naver.com/autoitscript[/color]] Korea of cafe(blog) to be operating, [size="2"][color="#ff00ff"]English cannot well[/size].Many help it requests.To read, it stands it thanks. Link to comment Share on other sites More sharing options...
trancexx Posted December 12, 2010 Share Posted December 12, 2010 You can't use it before you register it. Every method you call before successfully calling UnLockActiveX will cause Catastrophic failure error. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Zedna Posted December 12, 2010 Share Posted December 12, 2010 Don't use $PDFViewer.OpenFile ("C:\test.pdf" ); Read my previous post! Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now