🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: GlobalDosAlloc not exported in libs?

#1340
From: James Seidman
Date: Thu, 14 Feb 1991 21:19
24 lines
1885 bytes
In article <1991Feb13.165724.18629@linus.mitre.org> dkb@bistromath.mitre.org (Daryl K. Baker) writes:
>Has anyone used GlobalDosAlloc and GlobalDosFree?  I tried linking
>my application which was using these rouintes and received
>unresolved externals. (A side note: if you do a "strings" on
>the library you can find references to these functions). Does
>anyone have any info on this problem?

The problem is that for some reason (which I won't even speculate about),
prototypes for those two functions are not included in windows.h. The reason
you need the prototype is because they, like almost all other API functions,
are declared using the _pascal calling convention.  Under this convention,
an underscore is not prepended to the name.  What's happening is that,
since you have no prototype, your OBJ has a reference to _GlobalDosAlloc
rather than GlobalDosAlloc and can't find it.

Just write your own function prototype (by looking at the SDK reference)
and make sure to declare it as a pascal-convention function, and it should
work just fine.

-- 
Jim Seidman (Drax), the accidental engineer.
"It doesn't have to work... they'll be paralyzed just from laughing at me."
							- Dr. Who, _Shada_
UUCP: ames!vsi1!hsv3!jls	         INTERNET: hsv3.UUCP!jls@apple.com
Technical Details
Message-ID: <7204@hsv3.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!vsi1!hsv3!jls
References: <1991Feb13.165724.18629@linus.mitre.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!bonnie.concordia.ca!clyde.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!vsi1!hsv3!jls
From: jls@hsv3.UUCP (James Seidman)
Newsgroups: comp.windows.ms.programmer
Subject: Re: GlobalDosAlloc not exported in libs?
Message-ID: <7204@hsv3.UUCP>
Date: 14 Feb 91 21:19:34 GMT
References: <1991Feb13.165724.18629@linus.mitre.org>
Reply-To: jls@hsv3.UUCP (James Seidman)
Organization: Video Seven / Headland Technology
Lines: 24