x=createobject('PDFViewer.Viewer') x.loadfiles('123456')and then closing the form throws the error. Any thoughts?
DEFINE CLASS Viewer as Custom OLEPUBLIC PROCEDURE LoadFiles LPARAMETERS tcMemberID as String, tcSourceDir as String LOCAL oForm SET SAFETY OFF _screen.Visible = .F. oForm = CREATEOBJECT('PDFPicker', tcMemberID, tcSourceDir) IF TYPE('oForm') = 'O' oForm.Show() READ EVENTS && Works like a champ, PDFPicker stays visible ENDIF oForm = NULL RELEASE oForm *-- TYPE('oForm') = 'U' IF _vfp.StartMode > 0 *-- The next line throws the OLE error: *-- "OLE iDispatch exception code 0 from ?: ?..." QUIT ELSE _screen.Visible = .T. ENDIF ENDPROC ENDDEFINE>>Hi Naomi,