Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Yet another form flashes problem
Message
 
 
À
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:
01235364
Vues:
17
This message has been marked as a message which has helped to the initial question of the thread.
How are you compiling this class? As an exe? And why do you need quit there? Just comment this line out.

>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.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform