🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2711

Re: HELP! Calling fopen() in DLL (a little more info)

#2711
From: dxg
Date: Fri, 17 May 1991 07:43
31 lines
1646 bytes
In article <394.28314261@cai.com>, dxg@cai.com writes:
> 
> First some info: I am using MS-C 6.0a and MS-C 3.0a.

and we are doing our Windows development using the Large Memory Model.
I am new to the DOS world, (UNIX is my original home) so this
near/far pointer stuff is new to me.  Nevertheless, my understanding
is that with the Large Memory Model, everything is a far pointer.

> 
> I am calling a function from a .exe that is in a DLL.  This
> function does an fopen() and then returns a FILE *.  Within the DLL
> I am able to fprintf() to the file, but when I try to call
> fprintf() from my .exe it fails, with the following pop up box
> in CodeView: Trap 13 (0DH) - General Protection Fault
> 
> Am I doing something wrong or is impossible to call fopen() from within
> a DLL and return the FILE * to the exe?
> 

Or, should I call _lopen() and then the MS-C routine fdopen() to get my
FILE *, or is there something else that I should do?

Again, please mail me your responses, as I do not get to read news that often.
  
Thanks again,
-- 
Dean Grammas..............................................dxg@cai.com

   "All I ask is a chance to prove that money can't make me happy."
.....................................................................
Technical Details
Message-ID: <395.283389b3@cai.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!cai.com!dxg
References: <394.28314261@cai.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!uupsi!cai.com!dxg
From: dxg@cai.com
Newsgroups: comp.windows.ms.programmer
Subject: Re: HELP! Calling fopen() in DLL (a little more info)
Message-ID: <395.283389b3@cai.com>
Date: 17 May 91 07:43:47 GMT
References: <394.28314261@cai.com>
Organization: Computer Associates International
Lines: 31