ShellExecute and .pps
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
Quote:Original post by Code Is Your FriendCan we see your ShellExecute line? And what does ShellExecute() return?
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"?
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
"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
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.
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement