Hello Smalltalk people,,
I have some problems starting a VisualWorks-Application with a hyperlink in MS-Word: I have build a VisualWorks--Application with the RuntimePacker as exe. I inserted a hyperlink, giving the name of the exe, in a MS-Word document (e.g. <the path>\OfficeTalk.exe). When i click on the hyperlink, the application is started (the splashscreen is displayed) But after a short time, i get the messagebox "<criticalTitle> - Unhandled execption ERROR_FILE_NOT_FOUND" (Double clicking the application in the Filemanager at its place works as expected.) I a using Windows Vista and MS-Word 2000. The application is made with VisualWorks 7.7.1. Does anybody have an idea ? Best Regards, Josef Springer _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Isn't there an exception stack dump to show more of the error, in
particular which file is not found?
The typical reason for an application not finding files is that the "current directory" or "working directory" is not where the application file is stored. This is not special to VisualWorks. The default on Windows (and linux) is that the working directory is the one where the start command was made from. E.g. if you open a shell, cd to "\" and start a VisualWorks image "C:\applicationpath\deepinhierarchy\image.im", then the working directory is "C:\". One possible solution could be to start with a script which first changes to the image home directory, then starts the application. An alternative could be to change the image working directory to the image home directory (before reading application files): ObjectMemory imageDirectory beCurrentDirectory Am 27.09.2013 16:14, schrieb Josef Springer: Hello Smalltalk people,, Holger Guhl -- Senior Consultant * Certified Scrum Master * [hidden email] Tel: +49 231 9 75 99 21 * Fax: +49 231 9 75 99 20 Georg Heeg eK Dortmund Handelsregister: Amtsgericht Dortmund A 12812 _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
This is what I said: Starting the program in its home directory
means that the working directory is the one that your program seems
to expect. If you start it from somewhere else, then the working
directory is different and all relative file names are relative to
the non-home-directory.
The best point to change the working directory is at any place which is called before you read the first relative file name. So if you have a Subsystem subclass (typically a UserApplication subclass) which starts your application, then you can place "ObjectMemory imageDirectory beCurrentDirectory" there. If you don't have that you can implement a CommandLineInterest method to trigger the change. See the documentation or CommandLineInterest class>>example for details. An alternative is always avoiding relative file names and always construct the absolute path. This approach is best if the code for accessing "local" files is not spread over the entire application. Cheers, Holger Am 28.09.2013 13:34, schrieb Josef Springer: Hi Holger, _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |