Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Yet another form flashes problem
Message
From
25/06/2007 11:53:46
Gary Foster
Pointsource Consulting LLC
Chanhassen, Minnesota, United States
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01235113
Message ID:
01235360
Views:
16
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform