snsdk on win (once again)

Stojanovic, Marta Marta.Stojanovic@nrc.ca
Thu Aug 16 13:23:00 GMT 2001


Hi all !

I started working again on SN for Win and I'm doing my best to have this
thing working without bothering anyone, but I just can't see where the error
is .... I'll remind you of the problem : I try to execute my tcl script
using SN for Win, and it executes fine but it always ends by "The
instruction at "0x1008743f" referenced memory at "0x0000001c". The memory
could not be "read" " error. I'd like to get rid of it and have a clean
execution, but I am having problems there.

Here's the description of the problem (please correct me if I'm wrong
anywhere) :

SN has 2 related applications : hyper.exe (compiled from winMain.c + C code
for database API) which is in fact wish shell (along with db API), and
snsdk.exe which is compiled from winCon.c, and which is just a wrapper for
wish, so that we can use stdin/stdout/stderr. Hyper.exe with the present SN
distribution won't in fact execute (Error in startup: CreateProcess failed:
The system cannot find the file specified.). But if you rebuild it with
APPNAME=\"hyper.exe\" and not \"..\\bin\\hyper.exe\" (defined in Makefiles
in SN452-source\snavigator\snavigator\win directory), it'll work and execute
the script but end in an application error. 
(NOTE : in the first case, when you type snsdk and it gives you that error
message, it still calls hyper.exe, which rests in the background. I saw it
by trying to erase that folder, and it didn't give me the permission,
because hyper's files were in use. You have to go to Windows Task Manager to
kill hyper.exe process.)

I tried to debug snsdk.exe. It stops at the line :
WaitForSingleObject(endEvent, INFINITE); waiting for hyper.exe to finish
processing the script. When the script is finished, the error appears. When
you click OK, snsdk.exe resumes and finishes its execution. It's obvious
that hyper.exe creates the problem when exiting (of course, the error window
says "hyper.exe: Application Error" so it's obvious from there also).
Unfortunatelly, I don't get to debug hyper.exe, which is called from
snsdk.exe by CreateProcess. If you have an idea how to do it, please let me
know, I'm rather new to MS VC.

Then I saw that winCon.c (snsdk) was written by Kai Morich, so I tried to
find his original code. I found it under the name of wishCon
( http://www.neosoft.com/tcl/ftparchive/sorted/packages-7.6/devel/ ), and
downloaded it. It is written as an extension to Tcl8.0, so I downloaded it
also, and tried to see if it executes any tcl code, and it really does,
without any errors in the end (of course, it won't execute any tcl code from
SN examples, and it will correctly state that it doesn't recognize dbopen
command). I see that SN people used wishCon's winMain.c for their own
winMain.c (which is hyper's main), but it was changed. I'm not sure whether
those changes cause this error or it's something else (I tried to replace
winMain.c from SN with K. Morich's winMain.c, but it didn't work). 

winCon.c at the end has a reminder : "FIXME: get return code from wish", and
I suppose that it is related with this problem, but the error appears on the
line  WaitForSingleObject(endEvent, INFINITE); .... Maybe that call should
be changed to something else, but I'm not sure what ...

The version of SN is not important (those files are the same for 4.52 and
5.0), I work on Win 2000, with MS VC++ 6.0 compiler and cygwin 2.78.2.3 .

I'd really appreciate any help on this matter.

Thank tou very much in advance.

Kind regards,
Marta.




More information about the Sourcenav mailing list