如何在 vb6 中重新运行我的程序? [英] How to rerun my program in vb6?

查看:45
本文介绍了如何在 vb6 中重新运行我的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 vb6 中重新运行(关闭然后运行)我的程序

How to rerun (close then run) my program in vb6

推荐答案

执行此操作的最佳方法可能是创建一个观察者"应用程序,在终止它之前在主应用程序中启动该应用程序.

The best way to do this is probably to create a "watcher" application that you launch in your main app before terminating it.

首先,主应用程序应在启动时创建互斥锁或信号量.当您想要重新启动应用程序时,请让主应用程序启动观察程序.观察者应用程序应该等到主应用程序互斥锁/信号量消失,然后重新启动主应用程序.

First, the main app should create a mutex or semaphore upon launch. When you want to do the app restart, have the main app launch the watcher. The watcher application should wait until the main application mutex/semaphore is gone, then re-launch the main application.

我最近发布了一个用 VB6 编写的信号量类,它将处理一些艰苦的工作:http://www.vbforums.com/showthread.php?t=634635

I recently released a semaphore class written in VB6 which would take care of some of the hard work: http://www.vbforums.com/showthread.php?t=634635

这篇关于如何在 vb6 中重新运行我的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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