Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!gatech!bloom-beacon!eru!hagbard!sunic!news.funet.fi!funic!santra!fuug!tuura!risto From: risto@tuura.UUCP (Risto Lankinen) Newsgroups: comp.windows.ms Subject: Re: Simple file IO in Windows3.0 Message-ID: <805@tuura.UUCP> Date: 10 Oct 90 07:47:51 GMT References: <8807@milton.u.washington.edu> Distribution: all Organization: Nokia Data Systems Oy Lines: 28 efowler@milton.u.washington.edu (Eric Fowler) writes: >I have recently been trying to write a file IO routine that simply opens >a file of ASCII text and reads it in one line at a time. In vanilla C, >this is a trivial task with the fgets() function. However, using >fgets() with the SDK earns me an instantaneous UAE in windows. Hi! My suggestion is that the following were checked: - The proper header (.H) file is #included - The header file declares the function as _cdecl or _pascal (in the case of standard C libraries, it probably should be _cdecl). The explicit calling convention declaration is the important thing, not that which it is. All Windows programs are compiled with _pascal calling convention. If the compiler lacks the declaration info, it will default to using _pascal even if the function expects using _cdecl (as the standard C libraries in most cases do). Terveisin: Risto Lankinen -- Risto Lankinen / product specialist *************************************** Nokia Data Systems, Technology Dept * 2 2 * THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME! Now working on 2 +1 * replies: risto@yj.data.nokia.fi ***************************************