加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

调试VB6应用程序时如何设置工作目录?

发布时间:2020-12-17 00:10:28 所属栏目:大数据 来源:网络整理
导读:我正在调试一个VB6可执行文件.运行时,可执行文件会从当前目录载入dll和文件.当在调试器中运行时,当前目录似乎是VB6的目录. 如何设置VB6的工作目录? 这似乎并不是一个“开箱即用”的解决方案. 取自The Old Joel On Software Forums Anyways.. to put this to
我正在调试一个VB6可执行文件.运行时,可执行文件会从当前目录载入dll和文件.当在调试器中运行时,当前目录似乎是VB6的目录.

如何设置VB6的工作目录?

这似乎并不是一个“开箱即用”的解决方案.

取自The Old Joel On Software Forums

Anyways.. to put this topic to rest..
the following was my VB6 solution: I
define 2 symbols in my VB project
“MPDEBUG” and “MPRELEASE” and call the
following function as the first
operation in my apps entry point
function.

Public Sub ChangeDirToApp()
#If MPDEBUG = 0 And MPRELEASE = 1 Then
  ' assume that in final release builds the current dir will be the location
  ' of where the .exe was installed; paths are relative to the install dir
  ChDrive App.path
  ChDir App.path
#Else
  ' in all debug/IDE related builds,we need to switch to the "bin" dir
  ChDrive App.path
  ChDir App.path & BackSlash(App.path) & "..bin"
#End If
End Sub

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读