How to open a VW-Application with a hyperlink in a MS-Word document

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to open a VW-Application with a hyperlink in a MS-Word document

Josef Springer
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 ?

Signature Any help is would be appreciated!

Best Regards,
Josef Springer

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: How to open a VW-Application with a hyperlink in a MS-Word document

Holger Guhl
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,,

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 ?

Signature Any help is would be appreciated!

Best Regards,
Josef Springer
_______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


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
Reply | Threaded
Open this post in threaded view
|

Re: How to open a VW-Application with a hyperlink in a MS-Word document

Holger Guhl
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,

thanks for quick answering.
I have attached the stacktrace.
It seems to be a problem of the working directory. If i run the application in a Command Promt from a foreign directory, i get the same reaction (Unhandled execption ERROR_FILE_NOT_FOUND). If i run the application in a Command Promt from its home directory, it works !
The big question is now:
How to set the current directory within the image ? I tried to do this in Filename class>>initialize. But this is not the right location.

Do you know, where i must set the current directory ?

Many thanks for your help,
Josef Springer

On 27.09.2013 18:20, Holger Guhl wrote:
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,,

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 ?

Signature Any help is would be appreciated!

Best Regards,
Josef Springer


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc