I'm working on a project that allows users to open any type of file they want from webspeed. currently they are able to open .doc, .rtf, .jpg, (ect.), but when they try opening a .xls or .txt excel or notepad only open part way and then just freeze. Here is the code i'm using to open the files, it's the same code that i use in my GUI's to view the files, and it works there.
RUN ShellExecuteA(0, "open", V-TEMP-FILENAME, "", "", 1, OUTPUT hInstance).
PROCEDURE ShellExecuteA EXTERNAL "shell32.dll".
DEF INPUT PARAMETER hwnd AS LONG.
/* Handle to parent window */
DEF INPUT PARAMETER lpOperation AS CHAR.
/* Operation to perform: open, print */
DEF INPUT PARAMETER lpFile AS CHAR.
/* Document or executable name */
DEF INPUT PARAMETER lpParameters AS CHAR.
/* Command line parameters to executable in lpFile */
DEF INPUT PARAMETER lpDirectory AS CHAR.
/* Default directory */
DEF INPUT PARAMETER nShowCmd AS LONG.
/* whether shown when opened:
0 hidden, 1 normal, minimized 2, maximized 3,
0 if lpFile is a document */
DEFINE RETURN PARAMETER hInstance AS LONG.
/* Less than or equal to 32 */
END PROCEDURE.
RUN ShellExecuteA(0, "open", V-TEMP-FILENAME, "", "", 1, OUTPUT hInstance).
PROCEDURE ShellExecuteA EXTERNAL "shell32.dll".
DEF INPUT PARAMETER hwnd AS LONG.
/* Handle to parent window */
DEF INPUT PARAMETER lpOperation AS CHAR.
/* Operation to perform: open, print */
DEF INPUT PARAMETER lpFile AS CHAR.
/* Document or executable name */
DEF INPUT PARAMETER lpParameters AS CHAR.
/* Command line parameters to executable in lpFile */
DEF INPUT PARAMETER lpDirectory AS CHAR.
/* Default directory */
DEF INPUT PARAMETER nShowCmd AS LONG.
/* whether shown when opened:
0 hidden, 1 normal, minimized 2, maximized 3,
0 if lpFile is a document */
DEFINE RETURN PARAMETER hInstance AS LONG.
/* Less than or equal to 32 */
END PROCEDURE.