Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cornell!rochester!bbn.com!apple!netcom!mojo From: mojo@netcom.UUCP (Morris Jones) Newsgroups: comp.windows.ms Subject: Re: No free MS support for SDK; How to use lots of mem in a Win program? Message-ID: <12438@netcom.UUCP> Date: 23 Aug 90 06:57:23 GMT References: <1990Aug19.132046.24146@eng.umd.edu> Organization: Netcom- The Bay Area's Public Access Unix System {408 241-9760 guest} Lines: 28 Yes you can use large chunks of memory in Windows 3.0. I've been doing it successfully for a while now. To allocate chunks larger than 64K, use GlobalAlloc(), and lock to a pointer declared as "huge". The C compiler (at least Microsoft's) will properly increment the pointer using a external variable named __ahincr to increment the selector number to point to the next 64K chunk. Just don't try doing pointer comparisons or convert a Selector:Offset address into a physical address. (They call this selector tiling.) You can also use 32-bit programs in Windows 3.0 using the WINMEM32 DLL. Course, this requires a true 32-bit compiler such as Watcom or Metaware. If you want to write some assembler to do memory references, you can allocate some 32-bit memory using WINMEM32 and use 32-bit offsets to reference it. Or use Global16PointerAlias() to get a 16-bit selector into 32-bit memory. The possibilities are endless. But if all you've done in the past is DOS programs, I highly recommend Intel's 80386 Programmer's Guide. Get familiar with how this stuff works. Mojo Caere Corp. -- mojo@netcom.UUCP Site Coordinating Instructor, San Jose South Morris "Mojo" Jones Skilled Motorcycling And Rider Training (S.M.A.R.T.) Campbell, CA 800-675-5559 ... 800-CC-RIDER