problems with my program installed on Vista

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Dec 2008
Posts: 8
Reputation: kodak is an unknown quantity at this point 
Solved Threads: 0
kodak kodak is offline Offline
Newbie Poster

problems with my program installed on Vista

 
0
  #1
Dec 5th, 2008
I have developed a program in an XP enviroment using Borland Builder 6. It has since been installed on a computer with Vista. The program opens text files which are stored in the root directory of the program. The pathname is set in global constants like "name.txt". This works fine in XP but in Vista the program runs OK at first, then loses the files when required a second time. I have traced all the files and they reside in the same directory as the exe file so the impression I have now is that Vista must be running the exe file from another position. At one point even data in the DB was disappearing and returning later, which suggests there were two instances of the database running, however I am still confused as to how this could happen, and haven't been able to recreate this problem yet to investigate further. I suppose my questions are has anyone else experienced something similar, is my compiler outdated for the Vista enviroment, have I forgotten something fundamental regarding streaming text files. I am not sure which direction to take to look for a solution. Regards Nev.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: problems with my program installed on Vista

 
0
  #2
Dec 5th, 2008
If you define relative file name (not full path - for example, "name.txt" only) then it's not a Vista problem. At run-time the current directory is not the same as exe module directory so the program can't access external files via relative file names.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 8
Reputation: kodak is an unknown quantity at this point 
Solved Threads: 0
kodak kodak is offline Offline
Newbie Poster

Re: problems with my program installed on Vista

 
0
  #3
Dec 5th, 2008
Thanks, however hardcoding a full pathname doesn't seem to be a very elegant solution. I haven't experienced this before in XP where I have distributed several programs using relative pathnames without incident. Currently the problem is only appearing on the Vista platform and runs perfectly on my XP. How would I stream a file from an unknown directory? And I still don't comprehend why the program finds the file in the first instance and then loses it subsequently until I close and rerun the program. I shall investigate more so I can refine the symptoms better.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 978
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 208
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: problems with my program installed on Vista

 
0
  #4
Dec 5th, 2008
It appears as if you might have stumbled upon the virtualization feature of Windows Vista. Try looking it up on the MSDN.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 8
Reputation: kodak is an unknown quantity at this point 
Solved Threads: 0
kodak kodak is offline Offline
Newbie Poster

Re: problems with my program installed on Vista

 
0
  #5
Dec 5th, 2008
Hey Thanks,
you may be onto something here so I shall do what you suggest. I haven't had a lot to do with Vista. Further to my prior posts, I have now borrowed a laptop with vista installed, installed my program and it seems to run fine so far. The only other thing I can think of is the program corrupted somehow during the install, but I do not have access to the computer to test this theory currently. I think I'll mark this as solved, thanks to you both for giving me direction. Much appreciated.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: problems with my program installed on Vista

 
0
  #6
Dec 5th, 2008
Better use GetModuleFileName Windows API function to get exe module full path. In that case you can safely access all files placed in the same directory. It's a classical approach (a very elegant solution )...
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 8
Reputation: kodak is an unknown quantity at this point 
Solved Threads: 0
kodak kodak is offline Offline
Newbie Poster

Re: problems with my program installed on Vista

 
0
  #7
Dec 5th, 2008
ArkM, Although using GetModuleFileName won't help in this case. Unless I misunderstood the reams I read last night, Vista virtualization copies my text file to a virtual folder, so it turns out I was reading the original and writing to the copy, hence my thoughts about two instances running at once! I don't think it is supposed to work like that but in my case it certainly appeared to be. Once I get hold of the Vista laptop I can see if in fact this is the case.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC