查看: 129  |  回复: 0
  VB6 判断程序在IDE还是EXE运行
楼主
发表于 2024年9月29日 22:14
Private Sub Command1_Click()
    MsgBox App.LogMode '0=ide 1=exe
End Sub

如果在 DLL中使用 app.logmode    如果你在 IDE 中 调用这个 DLL,会提示 在 EXE 中 而不提示在 IDE 中。

如果不是做 DLL 完全可以用简单高效的 App.LogMode。

更加好的办法:

Private Sub Command1_Click()
    MsgBox f_CheckIDE
End Sub

Private Function f_CheckIDE() As Boolean
    Debug.Assert f_MakeTrue(f_CheckIDE)
End Function

Private Function f_MakeTrue(ByRef blnualue As Boolean) As Boolean
    blnualue = True
    f_MakeTrue = True
End Function


您需要登录后才可以回帖 登录 | 立即注册
【本版规则】请勿发表违反国家法律的内容,否则会被冻结账号和删贴。
用户名: 立即注册
密码:
2020-2024 MaNongKu.com