Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Showing animation while sending e-mail
Message
 
 
To
22/04/2002 16:09:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00647673
Message ID:
00647892
Views:
18
Daniel,

I believe you made some typo in the shown syntax. I'm trying to figure out the correct syntax right now...

Ok, I figured this syntax, but this code didn't help. May be the time should be not 200, but less?

Should I also apply David's workaround for dovents()?

Ok, I tried it and it still doesn't work. Here is my current code in this print method. Do you have suggestions? I commented out timer's code since it didn't give a result.
*--------------------------------------------------------------------------
* -- Printing a Report from FilingDate table
*--------------------------------------------------------------------------
* Nadya Nosonovsky 02/26/2002 03:07:12 PM
local tmpSaveRecno, lcIssue, lcStateWeek, lnSelect, lcState, ldDate, ;
lcOlderWeek, lnTally, llAutoYield
llAutoYield = _VFP.AutoYield
*_VFP.AutoYield = .f.
private NumPages
set message to 'Wait while report is preparing...'
NumPages = "" && 0
lnSelect = select()
#define CRLF chr(13)+chr(10)
wait window nowait 'Wait while preparing data for the report...'
SET LIBRARY TO cppTimer.fll ADDITIVE
*-- initialize timer
*!*	lnMilliSecs = 200 && adjust
*!*	InitTimers(1, lnMilliSecs)
*!*	SetupTimer (1, lnMilliSecs, "DOEVENTS")  

*-- processing goes here

with thisform
	tmpSaveRecno = recno('BatchCntrl')
	lcStateWeek = .ThisState + .ThisIssue
	lcState = .ThisState
	lcIssue = .ThisIssue
	lcOlderWeek = m.lcState + '198001' && Hardcoded earliest possible date

	if ProduceFilingDateSQL(m.lcOlderWeek,m.lcStateWeek,m.lcState)
		wait window nowait 'Wait while PDF is being created...'
		set message to 'Wait while PDF is being created...'
		if not directory('\Redp\Output\Products\Intranet')
			md ('\Redp\Output\Products\Intranet')
		endif
		local lcPDF
		lcPDF = '\Redp\Output\Products\Intranet\' + .ThisState +"Filing.PDF"
		set printer to default
		if CreatePDF(m.lcPDF)
			local loControl, lcAviFile
			set message to 'Wait while PDF is being created...'
			report form MFilingDates to printer noconsole
			set printer to default
			loControl = newobject( "AnimationControl", 'CommCtrl.vcx')
			loControl.InStatusBar = .t.
			loControl.autoopen = .f.
&& .Move() doesn't work for "instatusbar" controls
			loControl.left = 200
			loControl.top = 5
			local lnReturn, lcText, lcUserName
			lcUserName = iif(vartype(oJC)='O' and !empty(oJC.UserName), ;
			oJC.UserName,'Nadya Nosonovsky')
			mouse at mrow(), mcol()
		    doevents()

			if file(m.lcPDF)
				if vartype(oJC)='O' and oJC.LiveSys && Don't FTP for Development&& File was produced ok
					set message to "Wait while sending the file through FTP..."
					wait window nowait "Wait while sending the file through FTP..."
&& Updated:NN: 03/07/02 - will try to send it through ftp to our Intranet
					local lcUserID, lcPassword, lcFtpAddr, lcFtpPath
					loControl.Recreate()
					lcAviFile = addbs(justpath(fullpath('CommCtrl.vcx')))+'AVIs\Move.avi'
					loControl.open(m.lcAviFile)
					.oAnimation = m.loControl
					if ftpOption (m.lcUserID,m.lcPassword,m.lcFtpAddr,m.lcPDF,justfname(m.lcPDF),m.lcFtpPath, .f.)<>".T." && Error occurs
						wait window nowait 'Wait while sending e-mail to Tim, since FTP failed...'
						set message to 'Wait while sending e-mail to Tim, since FTP failed...'
						lcText = "Hi Tim, " +  CRLF + CRLF + ;
							"File "+ m.lcPDF + " was just produced." + CRLF + CRLF + ;
							"You now need to place it on the company Intranet." + CRLF + CRLF + CRLF + ;
							"Sincerely yours, " + CRLF + m.lcUserName + CRLF + CRLF + CRLF + ;
							iif(vartype(oJC)='O' and oJC.LiveSys,"Live","This is just a test")
						lnReturn = IDSEMail('Geiss','Wellcome new Filing Dates file',m.lcText)
					endif
					.oAnimation.close()
					.oAnimation.visible = .f.
					.oAnimation = null
				endif
				if m.lcState = "MA" && For now do it for MA only
					wait window nowait 'Wait while sending e-mail...'
					set message to 'Sending e-mail...'
*					loControl.AutoPlay = .T.
					loControl.Recreate()
					lcAviFile = addbs(justpath(fullpath('CommCtrl.vcx')))+'AVIs\SndMail2.avi'
					loControl.open(m.lcAviFile)
					loControl.Play( 0, -1, -1)
					.oAnimation = m.loControl
					.oAnimation.visible = .t.

					lcText = 'Hi everybody, '+ CRLF + CRLF+ ;
						"Attached please find Filing Dates Report " +  CRLF + CRLF + CRLF + ;
						"Sincerely yours, " + CRLF + m.lcUserName + CRLF + CRLF + CRLF + ;
						iif(vartype(oJC)='O' and oJC.LiveSys,"","This is just a test")
					local lcUsersAddresses
					if vartype(oJC)='O' and oJC.LiveSys
						lcUsersAddresses = 					else
						lcUsersAddresses = [Nosonovsky]
					endif
					lnReturn = IDSEMail(m.lcUsersAddresses, ;
						m.lcState+' Filing Dates report for Issue '+ m.lcIssue, ;
						m.lcText, m.lcPDF)
*					=inkey(0)	
					.oAnimation.close()
					loControl.close()
					.oAnimation.visible = .f.
					.oAnimation = null
				endif
			endif
			set message to ""
			dodefault()  && Nadya Nosonovsky 01/09/2002 03:36:45 PM Causes problems, so I commented it out for now
		endif
	endif
	use in curPrint
	select (m.lnSelect)
	if between(m.tmpSaveRecno,1,reccount('BatchCntrl'))
		goto m.tmpSaveRecno in BatchCntrl
	endif
endwith
 _VFP.AutoYield = m.llAutoYield
*-- Stop timer
*!*	StopTimer(1)
*!*	KillTimers()
>Nadya,
>
>Ok. I think the following should work:
>1. Download Bela's cppTimer
>2. Wrap your processing as follows:
>
>SET LIBRARY TO cppTimer.fll ADDITIVE
>*-- initialize timer
>lnMilliSecs = 200 && adjust
>InitTimers(1, lnMilliSecs, "DOEVENTS")
>
>*-- processing goes here
>
>*-- Stop timer
>StopTimer(1)
>KillTimers()
>
>
>I use this approach to provide the possibility to cancel processes. Bela's timer works really great. In VFP6 there's a problem with DOEVENTS. It can slow down processing. David Frankenbach has provided a workaround which you can find on the wiki.
>
>HTH
>>>Nadya,
>>>
>>>Is the problem related to the AVI you're trying to display or is it related to the process you're running? With other words, does the AVI play correctly if you instantiate the object *without* IDSMail?
>>>
>>
>>Yes, if I comment out IDSEMail program call, but just put =inkey(0), it works fine. The program eats all resources...
>>
>>>>Hi everybody,
>>>>
>>>>I'm trying to show some animation while I'm sending e-mail (using IDSMail) in VFP. However, the AVI is just shown, but not playing. I think, if I would be able to run this process of sending e-mails in the background, the animation will work correctly... What would be your thoughts and suggestions here?
>>>>
>>>>Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform