首 页文章中心下载中心繁體中文
设为首页
加入收藏
联系我们
您当前的位置:开源盛世-源代码下载网 -> 文章中心 -> V B 专区 -> 文章内容 退出登录 用户管理
栏目导航
· VC++专区 · V B 专区
· GIS 专区 · PDA 专区
· 其他编程 · 网站开发类
· 数据库类 · 软件应用
· 网络安全 · 论文专区
· 综合资讯
热门文章
· Tab Control控件使用...
· 学生档案管理系统
· [图文] 排列组合公式
· UTF-8与GB2312之间的...
· DirectShow下载安装...
· Virtual PC 在PAE模...
· Windows2000终端服务...
· MapInfo上的GIS系统...
· Mapbasic参考手册索...
· MapX应用开发中文讲...
相关文章
VB6 自动编译组件
作者:佚名  来源:vscodes.com整理  发布时间:2005-12-16 13:48:25  发布人:Polaris

减小字体 增大字体

自动将文件中vbp提取,编译为dll,将如下存为.vbs 即可

'---------------------------------------------------------------------------------------
' Module    : VB compiler
' DateTime  : 03-5-30 15:45
' Author    : Hardy He
' Purpose   : VB6 dll 自动编译工具
'---------------------------------------------------------------------------------------
' sVBPath : VB6 运行目录, sOutpath: 输出dll 目录, sSourcePath: VB源文件目录(包括子文件夹)

Dim sVBPath, sOutpath, sSourcePath
sVBPath = "D:Program FilesMicrosoft Visual StudioVB98"
sOutpath = "E:719Com"
sSourcePath = "E:719"

Call SearchVbp(sSourcePath)
call DelTempFiles (sOutpath)

'//遍历目录得到vbp 工程文件并编译
Function SearchVbp(sPath)

   Dim fso, f, f1, fc, s, ff, ff1
   Set fso = CreateObject("s cripting.FileSystemObject")
   Set f = fso.GetFolder(sPath)
   Set fc = f.Files
   For Each f1 In fc
      If LCase(GetFileExtName(f1.Name)) = "vbp" Then
        MakeDll (f1.Path)       
      End If
   Next
   Set ff = f.Subfolders
   For Each ff1 In ff
        SearchVbp (ff1.Path)
   Next
  
End Function

'// 编译
Function MakeDll(sVBP)
    Dim oShell
    Set oShell = Ws cript.CreateObject("Ws cript.shell")
    'msgbox """" & sVBPath & "vb6"" /m """ & sVBP & """ /outdir """ & sOutpath & """"
    oShell.run """" & sVBPath & "vb6"" /m """ & sVBP & """ /outdir """ & sOutpath & """"
    Set oShell = Nothing
End Function

'//删除临时文件
Function DelTempFiles(sPath)
    Dim oShell
    Set oShell = Ws cript.CreateObject("Ws cript.shell")
    'msgbox "del /q/f " & sOutpath & "*.lib"
    oShell.run "cmd /c del /q/f " & sPath & "*.lib"
    oShell.run " cmd /c del /q/f " & sPath & "*.obj"
    oShell.run " cmd /c del /q/f " & sPath & "*.exp"
    oShell.run " cmd /c del /q/f " & sPath & "*.asp"
    Set oShell = Nothing
End Function

'//得到扩展名
Function GetFileExtName(sFileName)
    Dim ipos, ilen
    ipos = InStr(sFileName, ".")
    ilen = Len(sFileName)
    GetFileExtName = Right(sFileName, ilen - ipos)
End Function


End of《VB6 自动编译组件》

[] [返回上一页] [打 印] [收 藏]
上一篇文章:vb实现多线程!
 
∷相关“VB6 自动编译组件”文章评论∷
(评论内容只代表网友观点,与本站立场无关!) [更多评论...]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 网站目录 鄂ICP备06007162
开源盛世 版权所有Copyright © 2003-2005 VSCodes.Com. All Rights Reserved.