Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Yet another form flashes problem
Message
De
25/06/2007 11:53:46
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01235113
Message ID:
01235360
Vues:
15
Hi Naomi,
One last imposition on you if I may. The following code always throws an OLE error at the QUIT. Even if I don't call the form that pdfpicker can instantiate. Simply instantiating Viewer and closing the form as:
x=createobject('PDFViewer.Viewer')
x.loadfiles('123456')
and then closing the form throws the error. Any thoughts?

Thanks,

Gary
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,
>>The problem definitely is the object ref going out of scope. I was hoping SHOW() or SHOW(1) would stop it, but it doesn't. Setting a form level property works like a champ. Thanks.
>>
>>Gary
>>
>>
>
>You're welcome. You may need to clear the form's reference (set it to NULL) in form's destroy event.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform