Author | Topic: CreateObject lock up. | |
---|---|---|
Jack Duijf | CreateObject lock up. on Wed, 11 Jan 2012 18:27:35 +0100 Hello, If i run the code as part of as an application from the desktop, all works ok. If i run the code as part of as an service, all works NOT ok. When started as a service, the last line in the logfile = "Start loading OPC Client". The service is multi-thread, and all threads keep on running (exept this one). I set service account to Local System account, and to administrator, same result. Is seems to me as CreateObject("OPCLabs.EasyDAClient.5.1") locks completly, and never returns. What am i missing here? Regards, Jack Duijf ::AddToLog("Start loading OPC Client") BEGIN SEQUENCE ::oOpc := CreateObject("OPCLabs.EasyDAClient.5.1") ::AddToLog("OPCLabs.EasyDAClient.5.1") ::AddToLog("LastComError: " + ComLastError() + " " + ComLastMessage()) RECOVER USING oError ::AddToLog("OPCLabs.EasyDAClient.5.1 is not installed") ::AddToLog("Fatal error: " + ComLastError() + " " + ComLastMessage()) ::AddToLog("Xbase error: " + oError:description) END SEQUENCE ErrorBlock(bError) if ValType(::oOpc) == "O" ::AddToLog("OPC Client loaded") else ::AddToLog("OPC Client not loaded") endif ... The function ::AddToLog() ads a text to a logfile | |
Pascal Boivin | Re: CreateObject lock up. on Wed, 11 Jan 2012 19:37:42 +0100 Just a guess... Is it possible object "OPCLabs.EasyDAClient.5.1" try to display something and wait for an answer? In the service property, set a real user and put a checkmark in the box "Allow the service to interact with the desktop". Start a Windows session with the same user name, and run your service. Maybe you'll see something... | |
Jack Duijf | Re: CreateObject lock up. on Wed, 11 Jan 2012 22:41:31 +0100 Hello Pascal, Thank you for the reply. I did what ou suggested. 1. I tried as "Local System account", and "Allow service to interact with desktop" enabled. 2. I tried as "This account", user = administrator, There is no interaction on the screen, whatever the settings are. I know for shure, the service starts properlty (i create a log file at startup). The service Freeze on CreateObject("OPCLabs.EasyDAClient.5.1"), Processor utilisaion = 0% The PC is Win-XP SP-3. If same code is run in GUI app, all works ok. Suggestions ar e welcome. Regards, Jack Duijf "Pascal Boivin" schreef in bericht news:xn0hsz0drd400u000@news.alaska-software.com... > Just a guess... Is it possible object "OPCLabs.EasyDAClient.5.1" try to > display something and wait for an answer? > > In the service property, set a real user and put a checkmark in the box > "Allow the service to interact with the desktop". > > Start a Windows session with the same user name, and run your service. > Maybe you'll see something... |