WinNT : ShellExecute problem

WinNT : ShellExecute problem

Post by Tracy Thoma » Fri, 27 Apr 2001 01:42:40



Has anyone found problems with WindowsNT behaving properly with
ShellExecute?

We're having trouble opening the machine's default word processor to open a
RTF file. Any ideas?

TIA

--
Tracy Thomas

 
 
 

WinNT : ShellExecute problem

Post by Ginny Caughe » Fri, 27 Apr 2001 02:05:47


Hi Tracy,

If you double click on the file, does it open in the work processor ok? I
haven't encountered problems with ShellExecute myself and we use it to open
XLS files all the time.

Here's the code I use. Maybe it will give you some ideas:

METHOD LoadWks(cFilename AS STRING) AS VOID PASCAL CLASS CSIReportDialog
 LOCAL pRet AS PTR
 LOCAL dwRet AS DWORD
 LOCAL cError AS STRING

 pRet := ShellExecute(SELF:hWnd, null, PSZ(cFilename), null,
PSZ(GetDefault()), SW_SHOWMINIMIZED)
 dwRet := DWORD(_CAST, pRet)
 IF dwRet <= 32 // Error occurred
  DO CASE
   CASE dwRet = 0 .or. dwRet = SE_ERR_OOM
    cError := "Not enough memory"
   CASE dwRet = DWORD(ERROR_FILE_NOT_FOUND)
    cError := "File "+cFilename+" not found."
   CASE dwRet = SE_ERR_NOASSOC
    cError := "There is no application registered on this machine to handle
files ending in .XLS"
   OTHERWISE
    cError := "An error occurred processing "+cFilename
  END CASE
  MessageBox(0, PSZ(cError), PSZ("Error"), MB_OK)
 ENDIF
 RETURN

Ginny


> Has anyone found problems with WindowsNT behaving properly with
> ShellExecute?

> We're having trouble opening the machine's default word processor to open
a
> RTF file. Any ideas?

> TIA

> --
> Tracy Thomas



 
 
 

WinNT : ShellExecute problem

Post by Geoff Schalle » Fri, 27 Apr 2001 18:42:56


Does RTF have an official file association?

If not, explicitly CreateProcess() with the app you want rather than letting
"Open" decide it for you.


> Has anyone found problems with WindowsNT behaving properly with
> ShellExecute?

> We're having trouble opening the machine's default word processor to open
a
> RTF file. Any ideas?

> TIA

> --
> Tracy Thomas


 
 
 

WinNT : ShellExecute problem

Post by Tracy Thoma » Sat, 28 Apr 2001 07:17:35


Geoff & Ginny -

I'm having the site check for a file association to help eliminate
possibilities. Thanks for the tips - I'll surely call back if I can't find
an answer.

Regards,

Tracy

> Does RTF have an official file association?

> If not, explicitly CreateProcess() with the app you want rather than
letting
> "Open" decide it for you.



> > Has anyone found problems with WindowsNT behaving properly with
> > ShellExecute?

> > We're having trouble opening the machine's default word processor to
open
> a
> > RTF file. Any ideas?

> > TIA

> > --
> > Tracy Thomas


 
 
 

1. ShellExecute problem in XP

I have seen many messages in this thread and others complaining about
ShellExecute problems in XP.
I am trying to open a url from a C++ program using the default
browser.
My command is:
HINSTANCE hi =
                ShellExecute(
                        NULL,
                        "open",
                        "http://www.microsoft.com",
                        NULL,
                        NULL,
                        SW_SHOWNORMAL);

I compiled the executable in Visual.NET C++ on an XP machine.
When I run the executable on a Windows 2000 box, it pops up the
website just fine.
When I run it on XP, it does nothing for a while and then returns an
error code 29.

This is listed in ShellAPI.h as:   SE_ERR_DDEFAIL

Anyone know anything more useful about this?

Elliot Katz

2. ForeHelp .vs. RoboHelp

3. ShellExecute problem

4. Toolbar.opo

5. ShellExecute "mailto" problem

6. RC

7. WinNT - HP C6270 Scan-Jet ADF Problem

8. CAT5 minimum length?

9. SCSI Scanner & WinNT Problem

10. HP ScanJet 5370C / WinNT 4.0 / Problem with Lamp

11. HP Scanjet 5100C on PARALLEL and WinNT 4.0 - Problems running hpprscan.exe

12. umax 1200s and winnt problems

13. WinNT & arj compression problem