Discussion:
VFP: Task Scheduler
Desmond Lloyd
2018-06-11 21:33:27 UTC
Permalink
Good afternoon,

Going nuts down here, have a simple executable generated from a single
program. Runs fine by itself. Grabs s few records then sends out an email
via Outlook automation. Which, btw, does Outlook have to be open to
run, or not? In any event if I run it in the task schedule it shows that
it is running, but it never stops or returns to the ready status????

Regards,
Desmond


--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAAJXvaO0kHRYFCZHNnTi0zoF51WxciALC9b_Cp-***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Tracy Pearson
2018-06-11 22:15:22 UTC
Permalink
Do you have an error handler?
It should not present a UI, that causes an error and could hang the
executable.
You might want to exit with the ExitProcess api when there is an error.

DECLARE ExitProcess IN WIN32API Integer ExitCode

I usually use a negative number when something didn't work right.
ExitProcess(-1)

HTH,
Tracy


-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of Desmond
Lloyd
Sent: Monday, June 11, 2018 5:33 PM
To: ***@leafe.com
Subject: VFP: Task Scheduler

Good afternoon,

Going nuts down here, have a simple executable generated from a single
program. Runs fine by itself. Grabs s few records then sends out an email
via Outlook automation. Which, btw, does Outlook have to be open to
run, or not? In any event if I run it in the task schedule it shows that
it is running, but it never stops or returns to the ready status????

Regards,
Desmond


--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/000601d401d1$b13d1530$13b73f90$@powerchurch.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Fred Taylor
2018-06-11 22:35:27 UTC
Permalink
If you're using drive letter mappings, those mappings do not exist for the
Task Scheduler. Won't find any data.

You can do the mappings in a batch file,

Fred
Post by Desmond Lloyd
Good afternoon,
Going nuts down here, have a simple executable generated from a single
program. Runs fine by itself. Grabs s few records then sends out an email
via Outlook automation. Which, btw, does Outlook have to be open to
run, or not? In any event if I run it in the task schedule it shows that
it is running, but it never stops or returns to the ready status????
Regards,
Desmond
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAJCBksode8fxd6TUkX6G8GjfukKUOr7wX-aMbDbvkyxN-***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Ted Roche
2018-06-12 10:44:05 UTC
Permalink
Post by Fred Taylor
If you're using drive letter mappings, those mappings do not exist for the
Task Scheduler. Won't find any data.
You can do the mappings in a batch file,
Or you could use UNC drive pathing.

Also, there's an option to set the user context in which to run the
job, if you need permissions to access resources.

You should have a config file included in the EXE where you set OFF
talk, resource, help, etc. so you don't get console or locate dialogs
on startup.

And you need logs, of course. Good possibility there's a USE or file
function that's popping up a dialog.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Ricardo Molina
2018-06-12 14:05:16 UTC
Permalink
If it's a modal dialog, then you can use SYS(2335) Unattended Server Mode
and trap it.

Ricardo.
Post by Ted Roche
Post by Fred Taylor
If you're using drive letter mappings, those mappings do not exist for
the
Post by Fred Taylor
Task Scheduler. Won't find any data.
You can do the mappings in a batch file,
Or you could use UNC drive pathing.
Also, there's an option to set the user context in which to run the
job, if you need permissions to access resources.
You should have a config file included in the EXE where you set OFF
talk, resource, help, etc. so you don't get console or locate dialogs
on startup.
And you need logs, of course. Good possibility there's a USE or file
function that's popping up a dialog.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAJeZx3k5SgTQT71EbLd0oNCBLUJFN-ci1hA3v-***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Desmond Lloyd
2018-06-12 16:39:00 UTC
Permalink
Thanks everyone! If I run the executable it dos popup a window, it's
empty and quickly goes away.....
So I can add a config.fpw file to the project to set screen off etc.?

Regards,
Desmond
Post by Ricardo Molina
If it's a modal dialog, then you can use SYS(2335) Unattended Server Mode
and trap it.
Ricardo.
Post by Ted Roche
Post by Fred Taylor
If you're using drive letter mappings, those mappings do not exist for
the
Post by Fred Taylor
Task Scheduler. Won't find any data.
You can do the mappings in a batch file,
Or you could use UNC drive pathing.
Also, there's an option to set the user context in which to run the
job, if you need permissions to access resources.
You should have a config file included in the EXE where you set OFF
talk, resource, help, etc. so you don't get console or locate dialogs
on startup.
And you need logs, of course. Good possibility there's a USE or file
function that's popping up a dialog.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAAJXvaOM5Dk6J9zfyXVhC3enWL9D-5T=hcQH0Q3YyjY-***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Alan Bourke
2018-06-12 07:44:20 UTC
Permalink
Post by Desmond Lloyd
Which, btw, does Outlook have to be open to
run, or not?
No, the automation will fire it up if it's not running.
Post by Desmond Lloyd
In any event if I run it in the task schedule it shows that
it is running, but it never stops or returns to the ready status????
And does the comprehensive logging to text file that you've put into your EXE indicate how far it's getting? ;)
--
Alan Bourke
alanpbourke (at) fastmail (dot) fm

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@webmail.messagingengine.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Dave Crozier
2018-06-12 08:29:08 UTC
Permalink
Desmond,
Beware if using different versions of outlook as Createobject() and Getobject() behave in differing ways to what you would expect.

CreateObject() will attach itself to the running version of Outlook rather than starting a new instance which you would expect. In effect is is just as though you had issued a GetObject().

This can have an effect on your program flow if the user uses the instance of Outlook whilst you are controlling it in code - worst scenario is to close outlook completely of course!

Office 2003 and versions prior did not suffer from this problem and CreateObject() always used to start a new instance.

Dave



---------------------------------------------------------------
This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any
attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.

It is the responsibility of the recipient to ensure that they have adequate virus protection.

Flexipol Packaging Ltd.
Unit 14 Bentwood Road
Carrs
Industrial Estate
Haslingden
Rossendale
Lancashire
BB4 5HH

Tel:01706-222792
Fax: 01706-224683
www.Flexipol.co.uk
---------------------------------------------------------------

Terms & Conditions:

Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time

-----Original Message-----
From: ProFox <profox-***@leafe.com> On Behalf Of Desmond Lloyd
Sent: 11 June 2018 22:33
To: ProFox Email List <***@leafe.com>
Subject: VFP: Task Scheduler

Good afternoon,

Going nuts down here, have a simple executable generated from a single program. Runs fine by itself. Grabs s few records then sends out an email
via Outlook automation. Which, btw, does Outlook have to be open to
run, or not? In any event if I run it in the task schedule it shows that it is running, but it never stops or returns to the ready status????

Regards,
Desmond


--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CAAJXvaO0kHRYFCZHNnTi0zoF51WxciALC9b_Cp-***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@EX2010-A-FPL.FPL.LOCAL
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Desmond Lloyd
2018-06-12 16:35:04 UTC
Permalink
Is there a work around? Am using O365 Outlook in my testing, actual
environment will be Office 2016 using a "real" exchange server?

Thank You!
Regards,
Desmond
Post by Dave Crozier
Desmond,
Beware if using different versions of outlook as Createobject() and
Getobject() behave in differing ways to what you would expect.
CreateObject() will attach itself to the running version of Outlook rather
than starting a new instance which you would expect. In effect is is just
as though you had issued a GetObject().
This can have an effect on your program flow if the user uses the instance
of Outlook whilst you are controlling it in code - worst scenario is to
close outlook completely of course!
Office 2003 and versions prior did not suffer from this problem and
CreateObject() always used to start a new instance.
Dave
---------------------------------------------------------------
This communication and the information it contains is intended for the
person or organisation to whom it is addressed. Its contents are
confidential and may be protected in law. If you have received this e-mail
in error you must not copy, distribute or take any action in reliance on
it. Unauthorised use, copying or disclosure of any of it may be unlawful.
If you have received this message in error, please notify us immediately by
telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise
the risk of virus transmission through email and therefore any files sent
via e-mail will have been checked for known viruses. However, you are
advised to run your own virus check before opening any
attachments received as Flexipol Packaging Ltd will not in any event
accept any liability whatsoever once an e-mail and/or any attachment is
received.
It is the responsibility of the recipient to ensure that they have
adequate virus protection.
Flexipol Packaging Ltd.
Unit 14 Bentwood Road
Carrs
Industrial Estate
Haslingden
Rossendale
Lancashire
BB4 5HH
Tel:01706-222792
Fax: 01706-224683
www.Flexipol.co.uk
---------------------------------------------------------------
Notwithstanding delivery and the passing of risk in the goods, the
property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or cleared
funds payment in full of the price of the goods and all other goods agreed
to be sold by the seller to the buyer for which payment is then due. Until
such time as the property in the goods passes to the buyer, the buyer shall
hold the goods as the seller's fiduciary agent and bailee and keep the
goods separate from those of the buyer and third parties and properly
stored protected and insured and identified as the seller's property but
shall be entitled to resell or use the goods in the ordinary course of its
business. Until such time as the property in the goods passes to the buyer
the seller shall be entitled at any time
-----Original Message-----
Sent: 11 June 2018 22:33
Subject: VFP: Task Scheduler
Good afternoon,
Going nuts down here, have a simple executable generated from a single
program. Runs fine by itself. Grabs s few records then sends out an email
via Outlook automation. Which, btw, does Outlook have to be open to
run, or not? In any event if I run it in the task schedule it shows that
it is running, but it never stops or returns to the ready status????
Regards,
Desmond
--- StripMime Report -- processed MIME parts --- multipart/alternative
text/plain (text body -- kept)
text/html
---
[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Loading...