Thanks for your reply.
a) What version of Clarion
Clarion version does not appear to make a difference. Confirmed to occur with both Clarion 6 and 9.1.
Windows version could be more relevant. The error started to appear on Windows Server 2008/ 2012 in autumn 2014. Our software was unchanged since the end of 2013 (and been in development and use several years prior to that). Of course there is a chance we didn't notice it before, but I suspect some sort of change in these versions of Windows caused this. Since changing the user the service runs under sometimes help it makes me think that some sort of resources are running out - but this is just speculation.
b) What version of NetTalk
NetTalk 4.58 is used in production. I have upgraded to NetTalk 8 in development. But so far the error has only occured on the production version.
Please note that I don't suspect that the NetTalk windows in particular have anything to do with the problem - the error fires on the first OPEN(Window) in the program and so far that has not been the NetTalk windows. The error has also occured in a pure source-code project without NetTalk.
c) "How" are you making the program a Service? (SelfService or something else?)
SelfService yes. I should mention that I have seen one (1) occurrence of the error when the app was running as a regular program, but that could have been a different reason of course (the error description "Unable to open window" is pretty generic).
d) Have you played with the PROP:Threading property at all - like setting PROP:Threading to false?
No, but I can try that. This app has no MDI window. Why do you think that could make a difference?
>>windows are not primarily there for "inter thread communication" but rather because they process events. In other words if you have "event driven" code then you need an ACCEPT loop and by implication a WINDOW.
Well, in our own code that was really the only purpose of the windows. We used Event:Notify and GUTS was fine for replacing that.
>>The app one isn't really "hidden" - although of course when running as a service you can't see it.
I know it's not by default - but I have hidden it
>> Is this at all possible to do -
no.
>>Unfortunately that's not an option.
Okay, thanks for clearing that up. I will probably move NetTalk so a separate app.
>>Perhaps the real question to ask is why you are getting this effect with your app, but everyone else who is running Clarion programs as Windows services has not noticed it?
Even though this error happens often enough that we want to find a solution it is still pretty rare. On machines that are frequently rebooted you would probably never notice it. Then error tends to reappear on the same machine, but there could be months in between. For 95% of our clients (very rough estimation) it does not happen at all.
The error might not always be identified though since we only recently added LibHook to the services - this makes it possible to output the error message to a file. Previously the service would just freeze on OPEN(Window) (because the Clarion runtime attempted to open a message box).