WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE and Outlook
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Redemption Causes WinBatch Studio to Crash


Question:

this code runs perfectly and finishes normally. It just gets the subject of the first message in the outlook inbox folder. But when I run this code once more winstudio crashes. Using winbatch 2004D. (2004C same problem) Looks like it has something to do with the use of the outlook redemption "Redemption.SafeMailItem" when I do similar stuff without it I don't have the problem.
PR_SUBJECT = 3604510 ; &H0037001E

oApp= createobject( "outlook.application" ) 
sItem = CreateObject("Redemption.SafeMailItem")
sItem.Item = oApp.Session.GetDefaultFolder(6).Items(1) 
s= sItem.Fields(PR_SUBJECT) ; ---> where it goes wrong

objectclose( sItem ) 
objectclose( oApp )
exit
I'm using the latest version (v3.4.0.325) of redemption. Outside winstudio there seems to be no problem and I'm able to run it over and over succesfully.

Any idea what is causing this or how I can prevent winbatch to crash?

Answer:

We are able to recreate the problem. It does only seems to occur when running in debug mode in WinBatch Studio.

Hmmm. When a WinBatch script exits, any unclosed handles or unreleased memory is freed by the system (hopefully) But in Studio, since studio does not exit, if you rerun the script it may conflict with the unclosed unfreed items from the previous run.

This problem was studied in great depth. Looks like a Redemption problem. Or maybe an Outlook problem. In any case we claim complete innocence. The general theory is that Redemption is making an unwarranted assumption about the environment that it is running in. I suspect that on the surface it may seem like a perfectly reasonable assumption...but not a correct one. And this leads to some assumption that really causes an ugly crash. It appears there is considerale stack corruption. Most of the crashes we could made required a reboot to get the system running again.

My advice is to either figure out how to email without Outlook, or use the usual debug once/Restart Studio approach.


Article ID:   W16589
File Created: 2005:02:18:12:21:34
Last Updated: 2005:02:18:12:21:34