HINSTANCE hExec;
hExec =
ShellExecute(MyhWnd,"open",buffer,clbuffer,dirbuffer,SW_NORMAL);
Under Win95 it works fine but now I have moved to Windows Me
it crashes
Can anyone help, please
-----------------------------
Michael Cowan
MCo...@fujisan.demon.co.uk
http://www.fujisan.demon.co.uk
Nottingham NG7 1JY UK
-----------------------------
Can you post a self contained code segment that reproduces the problem?
Something that can be put straight into a compiler would be good.
Just a guess, maybe you have have unterminated strings or something?
Jason
Thanks Jason.
In fact it would have crashed anyway under W95 with an
unterminated string but your 'something' got me there:
under Win95 a buffer length of 127 seems to have been OK for
the path which is what I was using. I changed it to 255 and
it worked. I suppose Win Me must allow longer paths?
Cheers
Michael
>Jason W <jaso...@crosswinds.net> wrote:
>>> hExec =
>>> ShellExecute(MyhWnd,"open",buffer,clbuffer,dirbuffer,SW_NORMAL);
>>> Under Win95 it works fine but now I have moved to Windows Me
>>> it crashes
>In fact it would have crashed anyway under W95 with an
>unterminated string but your 'something' got me there:
>under Win95 a buffer length of 127 seems to have been OK for
>the path which is what I was using. I changed it to 255 and
>it worked. I suppose Win Me must allow longer paths?
No: All Win32 versions allow path nanes of 260-chars (MAX_PATH).
If you happen to call it with shorter path always - by chance - you
may get away with a smaller buffer. But the odds are against you.
Someday someone will use a lohger pathname - crash - bingo. This may
happen on Win95 _or_ Win98 _or_ WinME _or_ WinNT _or_ Win2000 _or_
WinXP. The limit of a MS-DOS pathname has been 63 chars IIRC. But if
you do not use the 8.3 alias names in your path (C:progra~1\....)
youmust keep the buffer sizes to MAX_PATH (32 bit). Even if you use a
8.3 alias name path you may get into problems wih deeply neted folder
names since the 63 char limit is not enforced, only optionally checks
by scandisk - this pathname is to long for some 16 bit progs - or
similar -.
HTH, Frank