Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!apple!well!al From: al@well.sf.ca.us (Alfred Fontes) Newsgroups: comp.windows.ms Subject: Re: C++ and Windows 3.0 Programming Message-ID: <20687@well.sf.ca.us> Date: 21 Sep 90 06:25:38 GMT References: <1990Sep13.212524.25488@efi.com> <1990Sep19.034207.24313@chinet.chi.il.us> Lines: 27 patrickd@chinet.chi.il.us (Patrick Deupree) writes: >> inside the public section of the object. With Windows, I supposely >> get "handle" instead of pointer. Does that mean that I should avoid >> having public section at all ?? >... I see no reason why you'd need to change what you declare as >public to private. You should be able to use C++ more or less normally. You could use something like: #include ... void *Object::operator new( size_t size, HANDLE handle ) ... which would GlobalLock() the memory and return its address. You would probably want to overload delete accordingly. You could also try something like: #include ... ptr = new ( GlobalLock(handle) ) Object; ... assuming that the proper amount of memory is tagged by the handle. This will place the new object at the address returned by GlobalLock(). Either of these two methods should allow you to treat the objects more or less in the standard way.