Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hplabs!hpfcdc!hpgrla!jerryd From: jerryd@hpgrla.HP.COM (Jerry Donovan) Newsgroups: comp.windows.ms Subject: Re: Spawning in Windows Message-ID: <13500006@hpgrla.HP.COM> Date: 31 May 89 00:47:07 GMT References: <1989May19.112713.17785@ziebmef.uucp> Organization: Hewlett-Packard, Greeley, CO Lines: 22 > Recently I posted an article asking for help spawning other apps from > within a Windows app. I received a number of mail responses and I tried > out all of the suggestions. Since I've seen others asking the same question > as I did I thought I would present my findings. ... > 3 - the winning suggestion was received from Microsoft, and confirmed by > someone from hDC (sorry I forget your name). >Here goes: > /* reliable Windows spawn code */ > GlobalCompact((DWORD)-1); /* compact the global heap */ > LockData(0); /* lock down your data segment */ > spawnl(P_NOWAIT, "newapp.exe", "newapp", NULL); > UnlockData(0); /* unlock your data segment */ > > The interesting bits are the GlobalCompact - to give yourself some room, > and the LockData - stop data pointers from becoming orphans. Does this work for libraries? (where DS!=SS) if so, then what exactly does LockData do? if not, then what would work there? Thanks,