🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

How to use GlobalDosAlloc()?

#3102
From: Don Wilcox
Date: Thu, 06 Jun 1991 20:04
22 lines
1540 bytes
Another question on talking to TSRs.  I have attempted to use a block of
memory allocated by GlobalDosAlloc() as follows:
    I allocated the memory, and separated the paragraph from the descriptor.
    I used WinExec() to start a DOS program which will fill this new buffer.
        The program takes on command-line parameter which is the HIWORD of the
        values returned from GlobalDosAlloc().
    When I have discovered that the DOS program has done its work, I GlobalLock
        the LOWORD from GDA() (not necessary since I am in 386Enh, but I do it
        anyways), and attempt to display the data using StretchDIBits().

The data is not in the buffer.  In fact, further investigation shows that the
2 buffers do not point to the same part of memory.  Anyone know what I am
doing wrong?  Just so you know, I am shifting the paragraph value 4 bits left
before trying to use it as an address in the DOS program.

Thanks for listening and helping (I love you all),

Don

Don Wilcox                         | "Hear, O Israel, the Lord your God, the
Washington University in St. Louis |     Lord is One."
email: wilcox@cs.wustl.edu         |
Technical Details
Message-ID: <1991Jun6.200400.10453@cec1.wustl.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!wuarchive!cec2!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!wuarchive!cec2!news
From: wilcox@wucs1.wustl.edu (Don Wilcox)
Newsgroups: comp.windows.ms.programmer
Subject: How to use GlobalDosAlloc()?
Message-ID: <1991Jun6.200400.10453@cec1.wustl.edu>
Date: 6 Jun 91 20:04:00 GMT
Organization: Washington University, St. Louis MO
Lines: 22