为什么会从内部我的开发机器上的控制台应用程序工作,但没有其他COM自动化? [英] Why might COM automation from within a console application work on my development machine but not on another?

查看:352
本文介绍了为什么会从内部我的开发机器上的控制台应用程序工作,但没有其他COM自动化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于我使用COM自动化使用CorelDRAW项目的一部分。自动化是通过最终将通过Web服务而是尝试这背后的问题是运行作为计划任务来解决这一问题的目的而推出的控制台应用程序。这工作我的开发机(运行32位Windows Server 2003),但失败,COM错误80080005运行的机器上的64位Windows Server 2003。

As part of a project I am using COM automation with CorelDRAW. The automation is via a console application which will eventually be launched by a web service but for the purposes of trying to fix the issue behind this question is run as a scheduled task. This works on my development machine (running 32 bit Windows Server 2003) but fails with COM error 80080005 on a machine running 64 bit Windows Server 2003.

有没有出现在事件查看器日志中的任何附加信息[见下面编辑]。

There does not appear to be any extra information in the event viewer logs [see edit below].

如果我登录使用的运行计划任务的帐户和运行控制台应用程序,它按预期工作 - 所以我不认为这是一个32位的64位问题(但很高兴得到纠正)

If I log-in using the account which runs the scheduled task and run the console application, it works as expected – so I don’t think this is a 32 bit on 64 bit issue (but am happy to be corrected).

问题似乎是计划任务没有的方式,CorelDRAW中预计,登录/需要。如果是这样的问题,为什么它不是我开发的机器上发生的呢?是否有可能我自己的计算机上,以便让这个已经改变,但现在已经忘记了?一些设置。

The issue appears to be that the scheduled task does not "log-in" in a way that CorelDRAW expects / requires. If this is the problem why does it not happen on my development machine? Are there some settings that I may have changed on my development machine in order to allow this but have now forgotten about?

虽然研究类似的问题,在这里和其他地方,我已经尝试了一些事情,包括:

While researching similar issue, on here and elsewhere, I have tried a number of things including:

检查启动帐户登录作为服务和日志上的secpol.msc设置一个批处理文件。

Checking that the launching account has log on as a service and log on as a batch file set in secpol.msc.

检查该对象的CorelDRAW具有本地启动和本地激活DCOMCNFG设置。

Checking that the CorelDRAW object has local launch and local activation set in dcomcnfg.

通过添加启动用户机器的管理员组和审计失败的对象访问检查文件访问权限。

Checking file access permissions by adding the launching user to the machine’s administrators group and auditing failed object access.

删除从启动帐户的权限,我的机器上,以重现错误(我不能)。

Removing permissions from the launching account on my development machine in order to reproduce the error (which I can’t).

还有什么我应该尝试一下呢?

What else should I try?

修改

在一些挖那里似乎是在事件查看器日志中的额外信息。

After some more digging there does seem to be extra information in the event viewer logs.

有与对象ServiceActive事件ID 560审核失败。我能找到的Windows Server 2003 SP1的修复,但我在两台机器上运行SP2。我发现<一个href=\"http://social.msdn.microsoft.com/forums/en-US/windowstransactionsprogramming/thread/98683298-75da-4952-b2c1-057419c85501/\" rel=\"nofollow\">http://social.msdn.microsoft.com/forums/en-US/windowstransactionsprogramming/thread/98683298-75da-4952-b2c1-057419c85501/这表明使用 SC sdset ...

There is an audit failure with event ID 560 for object ServiceActive. I can find a fix for Windows Server 2003 SP1 but I am running SP2 on both machines. I found http://social.msdn.microsoft.com/forums/en-US/windowstransactionsprogramming/thread/98683298-75da-4952-b2c1-057419c85501/ which suggests using sc sdset ....

如果我想补充它运行计划任务到Administrators组我得到的帐户

If I add the account which runs the scheduled task to the Administrators group I get

The application, c:\Program Files (x86)\Corel\CorelDRAW Graphics Suite X5\Programs\CorelDRW.exe, generated an application error The error occurred on 03/19/2012 @ 08:20:25.869 The exception generated was c0000005 at address 65F6378B (CrlUtl!CrlUtl::WDictionaryIterator<IBaseBind,ATL::CStringT<wchar_t,StrTraitMFC_DLL<wchar_t,ATL::ChTraitsCRT<wchar_t> > > >::GetNext)

这表明它不能找到它希望找到

which suggests that it can't find something it expects to find.

推荐答案

您也越来越 CO_E_SERVER_EXEC_FAILURE 这表明COM服务器(在你的情况,我认为它是本地DCOM CoralDraw服务器)无法启动

You are getting CO_E_SERVER_EXEC_FAILURE which suggest the COM server (In your case, I assume it's the local DCOM CoralDraw server) failed to start.

我的猜测是,这是一种特权的问题。如果我理解正确的话,这不是开发机与生产机的问题,但交互式登录与计划任务的问题。

My guess is that this is a privilege issue. If I understand you correctly, this isn't a dev machine vs. production machine issue, but interactive login vs. scheduled task issue.

这是否正确?只是为了消除方面的问题,使suare CarolDraw运行与运行计划任务的用户帐户交互罚款,那么从命令行启动时控制台程序运行。

Is that correct? Just to eliminate side issues, make suare CarolDraw runs interactively fine with the user account that runs the scheduled task, and then that the console program run when launched from the command line.

您使用Windows的计划?我怀疑你是缺少NT AUTHORITY \\ INTERACTIVE或控制台登录组成员身份。为了验证这一假设,我们在命令行中转储组成员和当前令牌privilges(GetTokenInformation是API)和比较你会得到什么作为计划任务和命令行中运行时。

Are you using the Windows scheduled? I suspect you are missing the 'NT AUTHORITY\INTERACTIVE' or the 'CONSOLE LOGON' group membership. To verify this assumption, let the command line dump the group membership and privilges of the current token (GetTokenInformation is the API) and compare what you get when running as a scheduled task and from command line.

这篇关于为什么会从内部我的开发机器上的控制台应用程序工作,但没有其他COM自动化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆