msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Service & WithEvents SHDocVw automation - "automation error"

 
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE Automation
Author Message
Bob



Joined: 04 Oct 2007
Posts: 17

PostPosted: Sat May 12, 2007 10:46 am    Post subject: Service & WithEvents SHDocVw automation - "automation error" Reply with quote

I have a VB app that i run from a service (The app run at winsta0\\default).
The app runs under the localsystem account.

In my app i have:
Private WithEvents winShell As SHDocVw.ShellWindows

and then in one of the functions:
set winShell = new SHDocVw.ShellWindows
When it came to that set line, i get this error in a popup dialog:
"automation error" -2147220990 (80040202)

Some points:
1)When i run the app not from the service, everything is working fine
2)When i remove the WithEvents, i do not get that error (but as you can
understand it worthless without the Events).
3)When the app is not running under localsystem then everything is ok.

The problem is related to the combination of the app that runs under the
system account, automation and the WithEvents keyword.

I tried to make the service interactive by going to the service manager,
right click properties, and checking that box - it did not solve it.

Any suggestions?
(the app must stay running from the systemaccount - i can not change it)
I run it on XP pro.

Thanks

Archived from group: microsoft>public>vb>ole>automation
Back to top
View user's profile Send private message
Tony Proctor



Joined: 04 Oct 2007
Posts: 1051

PostPosted: Sun May 13, 2007 2:44 pm    Post subject: Re: Service & WithEvents SHDocVw automation - "automation er Reply with quote

The LocalSystem account is a special account Bob, and has no corresponding
NT login. That means it doesn't really have a user profile. I suspect
ShellWindows requires a prevailing user profile.

Using ShellWindows also implies your Service is expected to interact with
the desktop. There is a special setting for this but I believe it's not
really a recommended practise

Tony Proctor

"Bob" wrote in message@microsoft.com...
> I have a VB app that i run from a service (The app run at
winsta0\\default).
> The app runs under the localsystem account.
>
> In my app i have:
> Private WithEvents winShell As SHDocVw.ShellWindows
>
> and then in one of the functions:
> set winShell = new SHDocVw.ShellWindows
> When it came to that set line, i get this error in a popup dialog:
> "automation error" -2147220990 (80040202)
>
> Some points:
> 1)When i run the app not from the service, everything is working fine
> 2)When i remove the WithEvents, i do not get that error (but as you can
> understand it worthless without the Events).
> 3)When the app is not running under localsystem then everything is ok.
>
> The problem is related to the combination of the app that runs under the
> system account, automation and the WithEvents keyword.
>
> I tried to make the service interactive by going to the service manager,
> right click properties, and checking that box - it did not solve it.
>
> Any suggestions?
> (the app must stay running from the systemaccount - i can not change it)
> I run it on XP pro.
>
> Thanks
Back to top
View user's profile Send private message
Bob



Joined: 04 Oct 2007
Posts: 17

PostPosted: Tue May 15, 2007 6:21 pm    Post subject: Re: Service & WithEvents SHDocVw automation - "automation er Reply with quote

Thats what keep bother me.
If it does not have access to the shell windows then why when i remove the
withevent, i can get the shellwindows collection and watch them in the
debugger from that system account.

As i see it, it can or can not access the shell windows from the system
account, and as i saw, it can have access to them since these lines without
the withevents give me access to the shellwindows:
Private winShell As SHDocVw.ShellWindows
Private ie As SHDocVw.InternetExplorer

set winShell = new SHDocVw.ShellWindows
set ie=winShell (1)//i can get the iexplorer here - so the system account
does have access.

And my service does interact with desktop.

"Tony Proctor" wrote:

> The LocalSystem account is a special account Bob, and has no corresponding
> NT login. That means it doesn't really have a user profile. I suspect
> ShellWindows requires a prevailing user profile.
>
> Using ShellWindows also implies your Service is expected to interact with
> the desktop. There is a special setting for this but I believe it's not
> really a recommended practise
>
> Tony Proctor
>
> "Bob" wrote in message
> @microsoft.com...
> > I have a VB app that i run from a service (The app run at
> winsta0\\default).
> > The app runs under the localsystem account.
> >
> > In my app i have:
> > Private WithEvents winShell As SHDocVw.ShellWindows
> >
> > and then in one of the functions:
> > set winShell = new SHDocVw.ShellWindows
> > When it came to that set line, i get this error in a popup dialog:
> > "automation error" -2147220990 (80040202)
> >
> > Some points:
> > 1)When i run the app not from the service, everything is working fine
> > 2)When i remove the WithEvents, i do not get that error (but as you can
> > understand it worthless without the Events).
> > 3)When the app is not running under localsystem then everything is ok.
> >
> > The problem is related to the combination of the app that runs under the
> > system account, automation and the WithEvents keyword.
> >
> > I tried to make the service interactive by going to the service manager,
> > right click properties, and checking that box - it did not solve it.
> >
> > Any suggestions?
> > (the app must stay running from the systemaccount - i can not change it)
> > I run it on XP pro.
> >
> > Thanks
>
>
>

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Error 438 on Automation Good evening, all. I have an Outlook Add In that uses a DLL to do it's crypto work. We wrote the DLL. This code works on 99 machines. The 100th is a Win2000 box and this code will not run. Set objCrypto = If Not o

Automation error Hi everyone, I encountered the error message Automation error" Pls help. Tks Hui Hua

Automation Error going from VB app to VC++ app Need help correcting an Automation Error after 10 minutes. Our C++ application starts a VB application and passes an LPDISPATCH pointer into the VB application. The VB app then uses the LPDISPATCH pointer to access functions in the C++ app. This mechani

Automation Error i am opening ms word document with vb, few weeks ago it was fine, i opened that file with vb several time and no error from last week its giving that problem Runtime Error -2147319779 and saying object library not register. i am uinsg vb6 and msword 9.0 t

Automation Error going from VB app to VC++ app Need help correcting an Automation Error after 10 minutes. Our C++ application starts a VB application and passes an LPDISPATCH pointer into the VB application. The VB app then uses the LPDISPATCH pointer to access functions in the C++ app. This mechani
Post new topic   Reply to topic    msvisual.com Forum Index -> OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group