得到错误-2147220472(无法启动Quickbooks)

 自由常飞_337 发布于 2023-02-06 18:37

我尝试连接到Quickbooks时收到错误-2147220472.该应用程序由Windows服务执行.日志文件如下:

I   8788    RequestProcessor    ========= Started Connection =========
I   8788    RequestProcessor    Request Processor, QBXMLRP2 v12.0
I   8788    RequestProcessor    Connection opened by app named 'QBWatcher'
I   8788    RequestProcessor    OS: Microsoft Professional (build 9200), 64-bit
I   8788    RequestProcessor    Current Process is elevated
I   8788    RequestProcessor    Current User is in AdminGroup
I   8788    RequestProcessor    Current Process is ran as Admin
I   8788    RequestProcessor    Current Process Integrity Level : 3000
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
I   8788    RequestProcessor    Previous instance of QB is going down..! Wait and retry to get a new instance.
E   8788    RequestProcessor    Could not find or create an instance of QuickBooks using InstanceFinder
I   8788    RequestProcessor    Connection closed by app named 'QBWatcher'
I   8788    RequestProcessor    ========== Ended Connection ==========
I   8788    CertVerifier    The file does not contain an Authenticode signature.

这实际上有时会起作用,但我看不到模式.可能是什么导致了这个?

简而言之,用于连接的代码如下:

qbxmlConn.OpenConnection2(filename, "QBWatcher", QBXMLRP2Lib.QBXMLRPConnectionType.localQBD);
QBXMLRP2Lib.IAuthPreferences qbAuthPrefs = qbxmlConn.AuthPreferences;                                   
qbAuthPrefs.PutPersonalDataPref(QBXMLRP2Lib.QBXMLRPPersonalDataPrefType.pdpNotNeeded);
qbAuthPrefs.PutUnattendedModePref(QBXMLRP2Lib.QBXMLRPUnattendedModePrefType.umpOptional);
ticket = qbxmlConn.BeginSession(filename, QBXMLRP2Lib.QBFileMode.qbFileOpenDoNotCare);

Keith Palmer.. 8

这是这个问题的关键:

该应用程序由Windows服务执行.

由于QuickBooks的工作方式,尝试从Windows服务(例如,在后台运行的小程序而不是带有GUI的最终用户程序)连接到QuickBooks将永远无法可靠地工作.

QuickBooks使用GUI消息泵为SDK供电 - 因此,如果没有可用的GUI(例如,即使在没有用户登录到计算机的情况下运行的Windows服务中也是如此),则SDK/API将不可用.

关于这些坏消息我很遗憾.: - /

您是否可以使您的程序具有简单的GUI并且仅在用户登录时运行(如果他们需要离开计算机则锁定屏幕)?

1 个回答
  • 这是这个问题的关键:

    该应用程序由Windows服务执行.

    由于QuickBooks的工作方式,尝试从Windows服务(例如,在后台运行的小程序而不是带有GUI的最终用户程序)连接到QuickBooks将永远无法可靠地工作.

    QuickBooks使用GUI消息泵为SDK供电 - 因此,如果没有可用的GUI(例如,即使在没有用户登录到计算机的情况下运行的Windows服务中也是如此),则SDK/API将不可用.

    关于这些坏消息我很遗憾.: - /

    您是否可以使您的程序具有简单的GUI并且仅在用户登录时运行(如果他们需要离开计算机则锁定屏幕)?

    2023-02-06 18:38 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有