Application.Run()在Windows服务中

编程入门 行业动态 更新时间:2024-10-28 16:29:31
本文介绍了Application.Run()在Windows服务中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个多线程的Windows窗体应用程序,在调用Application.Run()之后运行很好。 COM组件需要Application.Run 我在应用程序中使用(消息循环需要)。我从VStudio 2005模板创建了一个windows 服务。什么是Windows服务更换 for Application.Run()?

I have a multi threaded windows form application that runs great after calling Application.Run(). Application.Run is required for a COM component I a using in the app (required for message loop). I have created a windows service from VStudio 2005 template. What is the windows service replacement for Application.Run()?

推荐答案

< msnews.microsoft写信息 新闻:Oc ************* @ TK2MSFTNGP06.phx.gbl ... <msnews.microsoftwrote in message news:Oc*************@TK2MSFTNGP06.phx.gbl... >我有一个多线程的Windows窗体应用程序,在调用Application.Run()之后运行得很好。 COM组件需要Application.Run 我在应用程序中使用(消息循环需要)。我已经从VStudio 2005模板创建了一个windows 服务。什么是Windows服务替换Application.Run()? >I have a multi threaded windows form application that runs great aftercalling Application.Run(). Application.Run is required for a COM componentI a using in the app (required for message loop). I have created a windowsservice from VStudio 2005 template. What is the windows servicereplacement for Application.Run()?

ServiceBase.Run(new service_class);也许, 但你必须用OnStart编写类(service_class)(这里你必须 调用你的主代码),OnPause,OnStop方法继承 System.ServiceProcess.ServiceBase D

ServiceBase.Run(new service_class); maybe, but you have to write class (service_class) with OnStart (here you must call your main code) , OnPause, OnStop methods that inherites System.ServiceProcess.ServiceBase D

非常感谢。不过我试过没试过。出于某种原因,这个com 组件只有在没有application.run的情况下才能运行...它不会在 赢得服务中工作。 " Dubravko Sever < Du ****************** @ foi.hrwrote in message news:f2 ********** @ news1 .carnet.hr ... Thanks a lot. I have tried, however, no luck. For some reason this com component just wont function without application.run... which wont work in the win service. "Dubravko Sever" <Du******************@foi.hrwrote in message news:f2**********@news1.carnet.hr... > < msnews.microsoftwrote in message 新闻:Oc ************* @ TK2MSFTNGP06.phx.gbl ... > <msnews.microsoftwrote in message news:Oc*************@TK2MSFTNGP06.phx.gbl... >>我有一个多线程在调用Application.Run()之后,windows表单应用程序运行良好。在应用程序中使用的COM 组件需要Application.Run(消息循环需要)。我已经从VStudio 2005模板创建了一个Windows服务。什么是Application.Run()的窗口服务替换? >>I have a multi threaded windows form application that runs great aftercalling Application.Run(). Application.Run is required for a COMcomponent I a using in the app (required for message loop). I havecreated a windows service from VStudio 2005 template. What is the windowsservice replacement for Application.Run()?

ServiceBase.Run(new service_class);也许, 但你必须用OnStart编写类(service_class)(这里你必须 调用你的主代码),OnPause,OnStop方法继承 System.ServiceProcess.ServiceBase D

ServiceBase.Run(new service_class); maybe, but you have to write class (service_class) with OnStart (here you must call your main code) , OnPause, OnStop methods that inherites System.ServiceProcess.ServiceBase D

你有没有检查您的帐户是否有足够的权限?尝试以管理员身份运行您的 服务以进行测试。 D < msnews.microsoft wrote in message news:eV ************** @ TK2MSFTNGP06.phx.gbl ... Have you check your account does it have enough permissions? Try to run your service as a administrator just for testing. D <msnews.microsoftwrote in message news:eV**************@TK2MSFTNGP06.phx.gbl... 非常感谢。不过我试过没试过。出于某种原因,这个com 组件在没有application.run的情况下才能运行...它不会在 赢得服务中工作。 " Dubravko Sever" < Du ****************** @ foi.hrwrote in message news:f2 ********** @ news1 .carnet.hr ... Thanks a lot. I have tried, however, no luck. For some reason this com component just wont function without application.run... which wont work in the win service. "Dubravko Sever" <Du******************@foi.hrwrote in message news:f2**********@news1.carnet.hr... >> < msnews.microsoft写信息新闻:Oc *** ********** @ TK2MSFTNGP06.phx.gbl ... >><msnews.microsoftwrote in messagenews:Oc*************@TK2MSFTNGP06.phx.gbl... >>>我有一个多线程的Windows窗体应用程序,在调用Application.Run()之后运行得很好。在应用程序中使用的COM 组件需要Application.Run(消息循环需要)。我已经从VStudio 2005模板创建了一个Windows服务。什么是Application.Run()的 Windows服务替换? >>>I have a multi threaded windows form application that runs great aftercalling Application.Run(). Application.Run is required for a COMcomponent I a using in the app (required for message loop). I havecreated a windows service from VStudio 2005 template. What is thewindows service replacement for Application.Run()?

ServiceBase.Run(new service_class);也许,但你必须用OnStart编写类(service_class)(这里你必须调用你的主代码),OnPause,OnStop方法继承 System.ServiceProcess.ServiceBase

ServiceBase.Run(new service_class); maybe,but you have to write class (service_class) with OnStart (here you mustcall your main code) , OnPause, OnStop methods that inheritesSystem.ServiceProcess.ServiceBaseD

更多推荐

Application.Run()在Windows服务中

本文发布于:2023-06-04 21:17:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/505226.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Application   Run   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!