Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!ceres.physics.uiowa.edu!iowasp.physics.uiowa.edu!ns-mx!ccad.uiowa.edu!cadsi Newsgroups: comp.windows.ms.programmer Subject: Re: CreateWindows() with BC++ gives exception 13 / error 0 Message-ID: <1991Mar21.040239.20399@ccad.uiowa.edu> From: cadsi@ccad.uiowa.edu (CADSI) Date: 21 Mar 91 04:02:39 GMT References: <21311@shlump.nac.dec.com> Organization: CAD-Research, U. of Iowa, Iowa City, Iowa Lines: 20 From article <21311@shlump.nac.dec.com>, by wallis@sieras.enet.dec.com (Barry L. Wallis): > > > Thanks to all who helped. Using GlobalAlloc() is certainly the safest way. > However, yes I am using NEAR pointers. I am 400 miles from my PC so I cannot > verify the following: does castng an object pointer to LPSTR change it from > being a NEAR pointer to being a FAR pointer? Yup. Actually, all it does (casting to LPSTR) is add the currect data segment to the offset (near). For instance, if you make a call like: CreateWindow(....., (LPSTR)this); It just pushes the data segment in addition to the 'this' pointer, thus on the stack goes a FAR pointer. |----------------------------------------------------------------------------| |Tom Hite | The views expressed by me | |Manager, Product development | are mine, not necessarily | |CADSI (Computer Aided Design Software Inc. | the views of CADSI. | |----------------------------------------------------------------------------|