|
-
Aug 31st, 2011, 07:10 AM
#1
Thread Starter
New Member
Visual Basic 6 on Windows 7, Directory List Box Not functioning properly
Hi all
The vb6 application i am working on is supposed to be migrated to windows 7.
When i am trying to run the source code , the directory list box is taking windows/system32 instead of current application which is causing my application to fail.
The installer is working fine. But Installed application is also not working properly
Please help
Thanx in advance
-
Aug 31st, 2011, 07:20 AM
#2
Re: Visual Basic 6 on Windows 7, Directory List Box Not functioning properly
Welcome to the forums 
 Originally Posted by ankit.kaushal
the directory list box is taking windows/system32 instead of current application which is causing my application to fail.
What is the exact code you are using and what does "fail" mean?
What error message is being generated?
-
Aug 31st, 2011, 07:21 AM
#3
Re: Visual Basic 6 on Windows 7, Directory List Box Not functioning properly
You can control that via code:
Code:
Option Explicit
Private Sub Form_Load()
Dir1.Path = App.Path
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path '<<< filelistbox - comment it if you don't use it
End Sub
-
Aug 31st, 2011, 07:47 AM
#4
Re: Visual Basic 6 on Windows 7, Directory List Box Not functioning properly
People seem to forget that the current directory setting is as relevant in Windows as it was in DOS. With no other direction CreateProcess() sets the CD to the application path, but many callers of CreateProcess() do set a different CD. For example Shell Links ("shortcuts") can specify one.
When running in the IDE test runs inherit the CD of the VB6 IDE, which means depending on how you started the IDE it might have different values.
I'm getting a strong whiff of "this app was never cleaned up for Vista" here. Lots of sloppy things you got away with under XP, especially as a local admin, don't work quite the same way now that security is tighter. Writeable data in App.Path is one of the no-nos. Windows 7 only made a few more changes, but often Win7 is the first time a lot of code will have to run under WOW64, which brings issues of its own as well.
Such Rip Van Winkle code needs a thorough review or you're likely to bump into issue after issue, often after deployment.
-
Sep 1st, 2011, 12:05 AM
#5
Thread Starter
New Member
Re: Visual Basic 6 on Windows 7, Directory List Box Not functioning properly
@Hack
the problem was that files are not present in that directory and it throws a file not found run time error '53'
@Rhino bull
thats a good suggestion , but that will mean changing code. Which i will have to do eventually after running out of oher options.
i think in vb tutorials they clearly say that dirListBox points to current directory by default .
I think this is exactly what microsoft mean when they say VBE IDE is no longer supported.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|