isosrl Posted May 2, 2016 Share Posted May 2, 2016 Hi, I have a project (unigui 0.99.90.1291) with ADO components and Indy IMAP component that when compiled as Windows StandAlone works correctly; when I compile it as Windows Service and start the service it stops; in log a read the error "CoInitialize has not been called". I have set ServerModule->AutoCoInitializa to True. I run the service on my pc but the sql server is on another pc, so I try to change in Windows Service the account from "Local Service" to "Network Service", still the problem. Any ideas ? Thanks, Francesco Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 2, 2016 Administrators Share Posted May 2, 2016 Can you please send a sample project? Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 2, 2016 Administrators Share Posted May 2, 2016 Can you please specify where your ADO components reside? MainModule? DataModules? Quote Link to comment Share on other sites More sharing options...
isosrl Posted May 3, 2016 Author Share Posted May 3, 2016 Hi Farshad, ADO components, Indy IMAP, UniThreadTimer reside in ServerModule since I need to pool IMAP server and when I found new emails they are copied into SQL database for later use. Main form is used only for SQL database and IMAP configuration, protected by the Login form. Attached you can find the project. It is not necessary to configure SQL and IMAP access, since if they are empty the project runs but does nothing. Eventually password for login form is admin. The project will pool the folder INBOX/RichiesteArticoli of the imap user. GetMailRichiesteArticoli.zip Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 3, 2016 Administrators Share Posted May 3, 2016 Hi, Since you are using your components it inside a ThreadTimer you must take care of all threading related stuff. Such as calling CoInitializeEx and etc. Quote Link to comment Share on other sites More sharing options...
isosrl Posted May 3, 2016 Author Share Posted May 3, 2016 Ciao, I will check CoInitializeEx and etc. Thanks. Quote Link to comment Share on other sites More sharing options...
isosrl Posted May 3, 2016 Author Share Posted May 3, 2016 Hi again, I cannot get to run as WindowsService, I tried different use of CoInitialize/Ex with no success... I came back to normal Windows standalone program, not a big issue. Thanks for the support. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 3, 2016 Administrators Share Posted May 3, 2016 I found the problem in your issue. Problem here is that Ado components are placed on servermodule. I will try find a workaround for it. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted May 3, 2016 Administrators Share Posted May 3, 2016 I will add a workaround in next build. Quote Link to comment Share on other sites More sharing options...
isosrl Posted May 4, 2016 Author Share Posted May 4, 2016 Thank's ! Quote Link to comment Share on other sites More sharing options...
CCH4UNIGUI Posted February 13, 2021 Share Posted February 13, 2021 Hi Farshad Mohajeri An Exception has occured in application: CoInitialize has not been called I am using Delphi Community 10.3.3 & the unigui downloaded trial ADO connections/ ADoDataset are on the Sever Module What was the workaround ? Quote Link to comment Share on other sites More sharing options...
CCH4UNIGUI Posted February 13, 2021 Share Posted February 13, 2021 Hi I have tried placing the ADO components on the ServerModule/MainForm/Data Module. Can compile as a stanalone with no error but get the CoInitialize has not been called then localhost:8077 How can I solve this problem ? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted February 14, 2021 Share Posted February 14, 2021 9 hours ago, CCH4UNIGUI said: Hi I have tried placing the ADO components on the ServerModule/MainForm/Data Module. Can compile as a stanalone with no error but get the CoInitialize has not been called then localhost:8077 How can I solve this problem ? Hello Which version and build are you using? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted February 14, 2021 Share Posted February 14, 2021 Hello, 13 hours ago, CCH4UNIGUI said: Can compile as a stanalone with no error but get the CoInitialize has not been called then localhost:8077 UniServerModule -> AutoCoInitialize = True ? Quote Link to comment Share on other sites More sharing options...
CCH4UNIGUI Posted February 14, 2021 Share Posted February 14, 2021 2 hours ago, Sherzod said: Hello, UniServerModule -> AutoCoInitialize = True ? Yup, that solves the problem. I am now able to display LIVE MSSQL Express data to localhost:8077 via a UniDBGrid :-) Quote Link to comment Share on other sites More sharing options...
CCH4UNIGUI Posted February 14, 2021 Share Posted February 14, 2021 6 hours ago, Hayri ASLAN said: Hello Which version and build are you using? Latest Trialv ersion available from Unigui Downloads Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.