SHELLEXECUTEINFO sh={0};
sh.cbSize=sizeof(SHELLEXECUTEINFO);
sh.fMask=SEE_MASK_INVOKEIDLIST;
sh.lpVerb="properties";
sh.lpFile=(char*)params;
sh.nShow=SW_SHOW;
ShellExecuteEx(&sh);
It is pretty much exactly as how MSDN says to do it. Unless I put this exact
code in a thread, it crashes everytime on Windows XP, but on other operating
systems it doesn't need to be in a sep. thread. Anyhow "params" cannot be
NULL as i test it just before this code segment. Any ideas? This is driving
me crazy. Is there another way to grab the properties of a file without
going through this crash prone method?
-Jason-
I wrote your code, exacly as you had it (but with a real name instead of
params), and was unable to observe a crash under XP.
If you make a minimal program, which calls this stuff directly from
WinMain, can you make it crash in XP?
(My guess is that the rest of your procedure is corrupting the stack. By
creating it in a new thread you're giving a different stack so the
corruption doesn't spread.)
--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. www.wischik.com/lu
"Lucian Wischik" <ljw...@cus.cam.ac.uk> wrote in message
news:aqt92p$bc7$1...@pegasus.csx.cam.ac.uk...