I m trying to open a file using shellexecute command my code is
ShellExecute(NULL,NULL,itemPath,NULL,NULL,SW_SHOW);
or
ShellExecute(NULL,L"open",itemPath,NULL,NULL,SW_SHOW);
I have used both ways but when I m giving path of a folder it opens a folder but when I m giving a full specified path of a file it doesn't work.
one thing more if I m giving a hardcode path like for example
ShellExecute(NULL,L"open",L"E:\abc.xlsx",NULL,NULL,SW_SHOW);
than it opens this file. can any one explain why it is happening.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…