Windows服务MFC不以库开头 [英] Windows service MFC not starting with library

查看:59
本文介绍了Windows服务MFC不以库开头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在c ++中有一个窗口服务运行良好,直到我使用我从朋友收到的库中的函数。它会安装,但拒绝开始给我一个错误1067.我不确定它是我还是库。我是c ++,visual studio和mfc的新手,所以它可以是任何东西。有什么想法吗?



我尝试了什么:



我确定了我正确地包括了库,它似乎是包含的,因为它在构建时没有给我任何错误。当我用库函数注释掉代码时,它会运行。我也确定它是x64,因为我在x64平台上制作它。我也搞乱了项目的属性,但似乎没有任何效果。

I have a window service in c++ that runs fine until I use functions from a library I received from a friend. It will install, but refuses to start giving me a error 1067. I'm not sure if it's me or the library. I'm new to c++, visual studio and mfc so it could be anything. Any ideas?

What I have tried:

I made sure I was including the library correctly and it appears to be include as it doesn't give me any errors when building. When I comment out the code with the library functions, it runs. I also made sure it was the x64 as I'm making this on a x64 platform. I've also messed around with the properties of the project, but nothing seems to work.

推荐答案

如果没有更多细节,这是无法回答的。



但是看起来库代码存在一些问题,导致服务终止(错误1067是 ERROR_PROCESS_ABORTED )。这意味着它不是构建问题,而是代码问题(运行时故障)。



您可以尝试在正常(命令行)应用程序中使用该库来调用同样的方法,看它是否也失败了。如果是这样,您可以调试该应用程序以找出发生的情况。对于这样的调试,最好有库源或至少DLL的调试版本。



如果从命令使用库时没有失败在线应用程序中,问题可能来自于从库中调用需要资源的功能,这些服务不需要桌面/ GUI或登录用户等服务。
This can't be answered without more details.

But it looks like there is some problem with the library code which lets your service terminate (error 1067 is ERROR_PROCESS_ABORTED). That means it is not a build problem but a code problem (runtime failure).

You can try to use the library within a normal (command line) application calling the same methods to see if it fails there too. If so, you can debug that application to find out what happens. For such debugging it would be good to have the library sources or at least a debug version of the DLL.

If there are no failures when using the library from a command line application, the problem may be sourced by calling functions from within the library that require resources that are not present with services like a desktop / GUI, or a logged in user.


这篇关于Windows服务MFC不以库开头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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