Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
supernav Absent Member.
Absent Member.

MS Word, C$SLEEP and accept


We have a problem associated with multiple ActiveX Word objects. We use MS Word to allow our users to create new letters or display existing ones. We do this by setting up the appropriate document and then passing control to MS Word. In the event paragraph which we use we look for the @ApplicationQuit event and once detected we set a flag. Meanwhile the program is sat in a loop (accept omitted before 100) waiting for the flag to be set so that we know that Word has finished. If the user has two versions of the program running (different threads from the same parent program - a main menu if you will) and each has a version of Word open then when one is closed the other one hangs. I have spent the last few days expermineting and have discovered that the root cause of this problem is the accept in the wait loop. So I changed it to a C$SLEEP. This solved the problem, however, now, sometimes?!?! MS Word doesn't start up correctly and hangs both itself and the AcuCobol application.

Does anyone have any ideas what to do about this? (other than going to Microsoft's office and shooting everyone)


Nick Brook

Tags (1)
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.