[comp.windows.ms] Problem with Windows programming

mikael@vall.dsv.su.se (Mikael Kindborg) (10/11/89)

------
I am being terrorized by a very nasty bug. The problem is
as follows. As soon as a call a routine in the standard C
library (e.g time(), chdir(), getcwd()) my progam dies.
This error occured after I had added some code to my
working program. Step by step I removed the new code, but
the error still remained. I then compiled and linked the
very basic functions only (i.e the "shell"), with a call to
time(). That worked ok. I then relinked that .obj file with
the rest of my .obj files (no calls to this code however).
Believe it or not, but the program freaks out. It seems as
if there is an error in the linking process. Any suggestions
concerning the possible cause of these bugs will be highly
appreciated.

Mikael Kindborg
Department of Computer Science
University of Stockholm Sweden

mathu@sssab.se (Mats Hultqvist) (10/12/89)

mikael@vall.dsv.su.se (Mikael Kindborg) writes:

>------
>I am being terrorized by a very nasty bug. The problem is
>as follows. As soon as a call a routine in the standard C
>library (e.g time(), chdir(), getcwd()) my progam dies.
>This error occured after I had added some code to my
>working program. Step by step I removed the new code, but
>the error still remained. I then compiled and linked the
>very basic functions only (i.e the "shell"), with a call to
>time(). That worked ok. I then relinked that .obj file with
>the rest of my .obj files (no calls to this code however).
>Believe it or not, but the program freaks out. It seems as
>if there is an error in the linking process. Any suggestions
>concerning the possible cause of these bugs will be highly
>appreciated.

I hwe had a simular problem with time(), but the problem did turn out to
be in the functions _dos_getcwd and _dos_setdir (and posible som
of the other _dos_* stuff) how was responsible.
This was du to a bug in Microsoft C-compiler 5.0, that we discowerd
in a book abot Windows programing (it was 'Grafic Window Programming'
or someting simular to that i think)

And i used the funktion DlgDirList() to change directory.

bturner@hpcvlx.cv.hp.com (Bill Turner) (10/12/89)

> I am being terrorized by a very nasty bug. The problem is
> as follows. As soon as a call a routine in the standard C
> library (e.g time(), chdir(), getcwd()) my progam dies.

The only thing I can think of is that you've compiled your code with one
memory model and linked to a library of a different model.  Something like
compiling with /AM and linking with slibc.lib.

--Bill Turner (bturner@hp-pcd.hp.com)
HP Corvallis Information Systems