ShellExecute and .pps

Started by
4 comments, last by Code Is Your Friend 15 years, 2 months ago
I am having trouble opening a .pps (powerpoint slide) file useing ShellExecute. I can open a text file, and a bitmap in the same folder using it, but it wont open the pps, does it need a special "verb"? thanks
Advertisement
Quote:Original post by Code Is Your Friend
I am having trouble opening a .pps (powerpoint slide) file useing ShellExecute. I can open a text file, and a bitmap in the same folder using it, but it wont open the pps, does it need a special "verb"?
Can we see your ShellExecute line? And what does ShellExecute() return?
ShellExecute

"Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values."

What error value are you getting?

"Because ShellExecute can delegate execution to Shell extensions (data sources, context menu handlers, verb implementations) that are activated using Component Object Model (COM), COM should be initialized before ShellExecute is called."

This might be the problem.

See also ShellExecuteEx
"I thought what I'd do was, I'd pretend I was one of those deaf-mutes." - the Laughing Man
Here is the line,

HINSTANCE hint;

hint = ShellExecute(NULL, "open", "\\Test.txt", NULL, "C:\\Program Files\\Pyrosoft\\Utilities", SW_MAXIMIZE);

it returns 0x00000002?
when it opens the txt it returns 0x00000002a

Matt

I called GetLastError and its 2 and 126.
Error code 0x00000002 is "file not found", so it looks like you're not specifying the right path to the text file you're trying to open.

For future reference the Win32 Error Codes are listed here, and you can also use FormatMessage to get a string description of the error code.
Well, I can open a .txt file in the same folder with that line, by swapping the file name, so I know the path is good. And the filename is Test.pps, so I dont know what else to add to the path to fix that?

Matt

This topic is closed to new replies.

Advertisement