Merrik Posted October 6, 2011 Share Posted October 6, 2011 I'm getting the COM error below when attempting to SQL Insert from a script that uses the SERVICES UDF. I could really use some help with this one. AutoIt COM error check. We intercepted a COM Error ! err.description is: err.windescription: CoInitialize has not been called. err.number is: 80020009 err.lastdllerror is: 0 err.scriptline is: -1 err.source is: ADODB.Connection err.helpfile is: err.helpcontext is: 1240640 AutoIt COM error check. We intercepted a COM Error ! err.description is: err.windescription: CoInitialize has not been called. err.number is: 80020009 err.lastdllerror is: 0 err.scriptline is: -1 err.source is: ADODB.Connection err.helpfile is: err.helpcontext is: 1240640 Link to comment Share on other sites More sharing options...
arcker Posted October 7, 2011 Share Posted October 7, 2011 (edited) can you try this before calling objects ? $COINIT_APARTMENTTHREADED = 0x02 DllCall('ole32.dll', 'long', 'CoInitializeEx', 'ptr', 0, 'dword', $COINIT_APARTMENTTHREADED) Edited October 7, 2011 by arcker malcolmsearle 1 -- Arck System _ Soon -- Ideas make everything "La critique est facile, l'art est difficile" Projects :[list] [*]Au3Service : Run your exe as service V3 / Updated 29/07/2013 Get it Here [/list] Link to comment Share on other sites More sharing options...
malcolmsearle Posted April 5, 2013 Share Posted April 5, 2013 (edited) can you try this before calling objects ? $COINIT_APARTMENTTHREADED = 0x02 DllCall('ole32.dll', 'long', 'CoInitializeEx', 'ptr', 0, 'dword', $COINIT_APARTMENTTHREADED) arcker - just found this post after a bit of Googling. Wanted to say thanks. I was getting error -2147221008 when running DllCall("C:WINDOWSSome.DLL", "long", "DllRegisterServer"). I wanted to register 15 DLLs in an AutoIt script, but could only register 14 of them. My searches showed that this error is related to CoInitialize not being called. I added the line you specified, i.e. DllCall('ole32.dll', 'long', 'CoInitializeEx', 'ptr', 0, 'dword', $COINIT_APARTMENTTHREADED) before my call to DllRegisterServer and the error went away. Thank you!!! Edited April 5, 2013 by malcolmsearle Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now