Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   Installation / Documentation (http://www.xtremevbtalk.com/installation-documentation/)
-   -   problem with app.path (http://www.xtremevbtalk.com/installation-documentation/328723-app-path.html)

starmanMike 08-21-2017 09:02 AM

problem with app.path
Having compiled, and packaged everything with the P&DW, I installed my app, but when I actually ran it, I had an error message saying that "...VB98... is not a valid path". That was indeed equal to app.path on the PC I wrote it on, but I thought that app.path related to the installed path (otherwise obviously nothing would work other than on the coder's machine). I did a global search throughout all the project files for "VB98" and none was found (as I hoped!) so why is the version I installed looking for the VB98 folder at all? Help!

Flyguy 08-22-2017 07:54 AM

App.Path is indeed the path of where the EXE resides.

So something else must be wrong in your project.
You say you scanned all the project files, but do you also have something like INI files where a path might be stored from you runs/tests from within the IDE?

starmanMike 08-22-2017 01:53 PM

Thanks - I think you have pointed me in the right direction. No, no ini files but... When the app is first run, if there is no "starcharts.mdb" file present, it creates it under app.path. But I just realised that there was a file with that name on the PC that I installed the app on, so that could well be why it threw the error. But I still don't see why it's looking for the /VB98 folder. That was indeed the app.path on the development machine however, so in some way that folder was 'registering' I suppose. Just wonder if anyone else has had parallel problems of this sort!

loquin 08-25-2017 01:06 AM

There is an issue with app.path returning a \ character appended to the path, if the path folder is the root folder on the drive, but not otherwise. (and that may be reversed...) I always use a function to return the path, appending a trailing \ if it's not present.

starmanMike 08-25-2017 09:53 AM

Cheers Loquin - I knew about that, and there is an if...else that takes care of it as you mentioned (tested and works). Obviously somewhere in the various files that the PDW creates there must be a reference to where the files originally were (in this case, indeed in the /VB98 folder) otherwise there could be no other source for that reference, since the /vb98 folder exists only on the development PC.

All times are GMT -6. The time now is 12:56 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.