Application.DoEvents在模块中? [英] Application.DoEvents in a module?

查看:102
本文介绍了Application.DoEvents在模块中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




是否有等同于Application.Doevents的信息。模块中的方法或

Windows服务?

我想创建一个调用DLL的Windows服务。 DLL将拥有我所有的

函数,并且它将完成所有工作,但是我正在使用的某些函数需要调用类似于Application的函数。 .Doevents"并且我不能使用这个因为DLL模块不是应用程序。


有解决方法吗?

Hi,

Is there an equivalent to the "Application.Doevents" method in modules or
Windows services?

I want to make a Windows service that calls a DLL. The DLL would have all my
functions and it would be doing all the job, but some of the functions that
I''m using require calling something like "Application.Doevents" and I can''t
use this because the DLL module is not an application.

Is there a workaround?

推荐答案

Windows服务没有像Windows窗体那样的用户事件 - 所以

它能处理什么?

也许你可以在你的函数中传递一个标志,让它知道它是否应该调用application.doevents。 Windows应用程序可以将它传递给

为true,它将被调用,所有其他应用程序将传递为false。


Amjad <上午*** @ discussions.microsoft.com>在消息中写道

news:61 ********************************** @ microsof t.com ...
A windows service doesn''t have user events like a windows form would - so
what could it process?

Perhaps you can pass a flag into your function to let it know whether it
should call application.doevents or not. Windows application can pass it in
as true, and it will get called, all other applications will pass in false.

"Amjad" <Am***@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...


是否有相当于Application.Doevents的东西。模块中的方法或Windows服务?

我想创建一个调用DLL的Windows服务。 DLL将具有所有
我的功能,它将完成所有工作,但是我正在使用的一些功能需要调用类似应用程序的功能.Doevents"并且我不能使用它,因为DLL模块不是应用程序。

是否有解决方法?
Hi,

Is there an equivalent to the "Application.Doevents" method in modules or
Windows services?

I want to make a Windows service that calls a DLL. The DLL would have all
my
functions and it would be doing all the job, but some of the functions
that
I''m using require calling something like "Application.Doevents" and I
can''t
use this because the DLL module is not an application.

Is there a workaround?



Marina,


我没有提及用户事件。我的DLL模块引发了其他事件。我的所有

函数都在DLL模块中,因此我无法在任何

函数中运行Application.Doevents。


我想在我的DLL模块中处理来自

的消息队列中的所有Windows消息。我知道如何在WindowsForm中执行此操作(使用

Application.Doevents),但我不知道如何以模块形式执行此操作。


" Marina"写道:
Marina,

I didn''t mention "user events". My DLL module raises other events. All my
functions are in the DLL module, so I cannot run Application.Doevents in any
of my functions.

I want to process all Windows messages currently in the message queue from
within my DLL module. I know how to do it in a WindowsForm (using
Application.Doevents), but I don''t know how to do it in a module form.

"Marina" wrote:
Windows服务没有像Windows窗体那样的用户事件 - 所以它可以处理什么呢?

也许你可以将一个标志传递给你的函数,让它知道它是否应该调用application.doevents。 Windows应用程序可以将其作为true传递给它,并且它将被调用,所有其他应用程序将被传递为false。

Amjad <上午*** @ discussions.microsoft.com>在消息中写道
新闻:61 ********************************** @ microsof t.com。 ..
A windows service doesn''t have user events like a windows form would - so
what could it process?

Perhaps you can pass a flag into your function to let it know whether it
should call application.doevents or not. Windows application can pass it in
as true, and it will get called, all other applications will pass in false.

"Amjad" <Am***@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...


是否有相当于Application.Doevents的东西。模块中的方法或Windows服务?

我想创建一个调用DLL的Windows服务。 DLL将具有所有
我的功能,它将完成所有工作,但是我正在使用的一些功能需要调用类似应用程序的功能.Doevents"并且我不能使用它,因为DLL模块不是应用程序。

是否有解决方法?
Hi,

Is there an equivalent to the "Application.Doevents" method in modules or
Windows services?

I want to make a Windows service that calls a DLL. The DLL would have all
my
functions and it would be doing all the job, but some of the functions
that
I''m using require calling something like "Application.Doevents" and I
can''t
use this because the DLL module is not an application.

Is there a workaround?




关键是你从windows中调用dll中的方法

服务因此没有窗口而且,ergo,有没有窗口消息

队列,所以在调用Application.Doevents时没有品脱。


如果你想放弃剩下的时间片

当前线程让其他线程可以'看看''然后你需要

看看Thread.Sleep。


Amjad <上午*** @ discussions.microsoft.com>在消息中写道

新闻:FD ********************************** @ microsof t.com ...
The point is that you are calling the methods in the dll from a windows
service therfore there is no window and, ergo, there is no window message
queue, so there is no pint in calling Application.Doevents.

If you are looking to relinquish the remainder of the time slice for the
current thread so that other threads can ''get a look in'' then you need to
have a look at Thread.Sleep.

"Amjad" <Am***@discussions.microsoft.com> wrote in message
news:FD**********************************@microsof t.com...
Marina,

我没有提及用户事件。我的DLL模块引发了其他事件。我的所有
函数都在DLL模块中,所以我无法在我的任何函数中运行Application.Doevents。

我想要处理当前所有的Windows消息在我的DLL模块中来自
的消息队列中。我知道如何在WindowsForm中使用(使用
Application.Doevents),但我不知道如何以模块形式完成它。

Marina写道:
Marina,

I didn''t mention "user events". My DLL module raises other events. All my
functions are in the DLL module, so I cannot run Application.Doevents in
any
of my functions.

I want to process all Windows messages currently in the message queue from
within my DLL module. I know how to do it in a WindowsForm (using
Application.Doevents), but I don''t know how to do it in a module form.

"Marina" wrote:
Windows服务没有像Windows窗体那样的用户事件 - 所以它可以处理什么呢?

也许你可以将一个标志传递给你的函数,让它知道它是否应该调用application.doevents。 Windows应用程序可以在
中传递它,如果它是真的,它将被调用,所有其他应用程序将传入
false。

Amjad <上午*** @ discussions.microsoft.com>在消息中写道
新闻:61 ********************************** @ microsof t.com。 ..
A windows service doesn''t have user events like a windows form would - so
what could it process?

Perhaps you can pass a flag into your function to let it know whether it
should call application.doevents or not. Windows application can pass it
in
as true, and it will get called, all other applications will pass in
false.

"Amjad" <Am***@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
>
>
>是否有相当于Application.Doevents的东西。模块中的方法
>或
> Windows服务?
>
>我想制作一个调用DLL的Windows服务。 DLL会有
>所有
>我的
>功能,它将完成所有工作,但一些功能
>
>我正在使用需要调用类似Application.Doevents的东西。和我
>不能
>使用它是因为DLL模块不是应用程序。
>
>有解决方法吗?
> Hi,
>
> Is there an equivalent to the "Application.Doevents" method in modules
> or
> Windows services?
>
> I want to make a Windows service that calls a DLL. The DLL would have
> all
> my
> functions and it would be doing all the job, but some of the functions
> that
> I''m using require calling something like "Application.Doevents" and I
> can''t
> use this because the DLL module is not an application.
>
> Is there a workaround?




这篇关于Application.DoEvents在模块中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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