batch file calling SGeMS

Eugênio Silva - Posted on 29 October 2010

Hi, I'm developing a C# application which calls SGeMS through a batch file. In Windows XP x86 it works right, but in Windows XP x64 or Windows 7 it returns the message: "This application has requested the Runtime to terminate it in an unusual way". Does someone know how to solve this problem? Thanks.
Interesting. Do you know if it failed when loading a file or when executing a gstat algorithm? After crashing, I would suggest to look in the log file (sgems_history.log) to see the last command that was executed. Finally, is it possible to try it with a 32bits windows7 to see if it is a OS (XP vs 7) or a precision (32 vs 64) problem?
On the environment where the problem happens, if I run SGeMS from the interface it works right, but it doesn't work with my application. After some testing on the environment where SGeMS is working right, I found an interesting behavior. When I run the SGeMS from the interface, it writes a log file, but when my application calls SGeMS through the batch file, it doesn't write a log file. On the Internet I found informations about problems with the version of some DLL's (MSVCRT.DLL, MSVCIRT.DLL, MSVCR71.dll, and so on) and compilation parameters of the Visual C++ 6.0. I have intalled MS Visual C++ 2005 Redistributable x86 and x64 and replaced the DLL's, but the problem remains.
I solved the problem. I created an environment variable named GSTLAPPLIHOME pointing to C:\Program Files (x86)\SGeMS. Now, SGeMS is working right.
Sorry, I should have thought about that. If you call SGeMS from outside its install directory you must set up the GSTLAPPLIHOME env variable. This allows sgems to find the plugins folder. If you add another sgems version, do not forget to change the path of that variable.
I have a similar problem, I need to call from an application that SGeMS eh created in visual basic 6.0 and throws me the following error: "no colormap could be found check that environment variable GSTLAPPLIHOME is set to where S-GeMS was installed or that directory plugins/colormaps definitions" I solve this problem? my OS is XP. Would like more detail about the environment variable to be created. Thanks Greetings
See the response in that thread. An environmental variable must be set through your XP command panel. The GSTLAPPLIHOME env. variable must point to wherever the plugins directory is located
- Added the system variable PATH, the path of SGeMS. Ex.: (C:\Program Files\SGeMS) - Restart the computer to make sure that the variable is loaded correctly or check the status in the DOS. - Call SGeMS in VB: Shell("sgems" AppWinStyle.NormalFocus).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.