Click here to Skip to main content
15,889,909 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
Randor 3-Oct-20 3:07
professional Randor 3-Oct-20 3:07 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
OriginalGriff3-Oct-20 4:00
mveOriginalGriff3-Oct-20 4:00 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
Randor 3-Oct-20 4:24
professional Randor 3-Oct-20 4:24 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
Nelek4-Oct-20 10:16
protectorNelek4-Oct-20 10:16 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
Randor 4-Oct-20 10:38
professional Randor 4-Oct-20 10:38 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon4-Oct-20 19:12
markrlondon4-Oct-20 19:12 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
Randor 4-Oct-20 19:47
professional Randor 4-Oct-20 19:47 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 2:03
markrlondon6-Oct-20 2:03 
Randor wrote:
Sounds like you are one of those guys that think that when you download an EXE, AVI, MP3 or whatever that the browser decides what to do... based on the file extension. That would be wrong, browsers use a MIME type sent by the webserver to determine what to do with the file. MHT/MHTML files have a MIME type. (I am leaving out MIME sniffing for brevity)

No, I am the kind of guy who understands the context and realises that downloading via HTTP has nothing whatsoever to do with what is happening here.

For the avoidance of doubt, the context here is that Outlook (the local program I understand, see my postscript) has already received an email and is storing it locally for viewing. When the user clicks to view it in a browser, the email is saved as a MHT file locally and a web browser is opened to view the local file.

There is no download. HTTP is not involved. MIME types are not involved.

This is (or should be) a purely a non-COM shell operation.

In terms of which web browser (or other program) is opened to view the locally saved MHT file, it depends on how Outlook chooses to do it. There are two ways that do not require COM at all. (1) It could pass the path of the MHT file to the shell and allow the Windows shell to open whatever program is associated with MHT files. The file extension counts, not the MIME type (there is no MIME type in this scenario). By default, Internet Explorer is still the default handler for MHT file extensions. (2) Or Outlook could look up the associated program in the registry and then explicitly run the program, passing the MHT file to the program on the command line (again, no MIME type is involved).

Neither of these approaches needs or uses COM. These are the ways that most software uses to pass a file to another program for opening in my experience.

Randor wrote:
You say this then give an accurate (and very good) description of how MHT files would be opened. Which results in the same default HKEY_CLASSES_ROOT\CLSID\{3050F3D9-98B5-11CF-BB8200AA00BDCE0B} handler being invoked provided he hasn't overridden the ftype handler. You are saying the same thing as me here.

The CLSID is not used -- or certainly *should* not be used. It is irrelevant in this context. COM is irrelevant in this context. You do not need COM to either pass a file to the Windows shell to be opened by another program or to run a program and pass a file path to it on the command line.

I did not mention COM or the CLSID key in my "very good" description of how a program usually passes a file to another program for opening via the shell because COM and the CLSID key are utterly irrelevant to this process, or should be irrelevant. They aren't needed.

Yes, I am sure that it is possible to run a program and pass it a file to open using what remains of DDE or what there is of COM (in which case you'd need the CLSID key of course) but it is completely unnecessary in this context. It would add complication for no benefit. There is no need to do it. The Windows shell provides a complete mechanism that utterly avoids any recourse to COM in this context. Most programs neither need COM to do this nor use COM to do this.

Randor wrote:
You have no idea how much COM is used in Windows. It's not going away. After an internal review it was decided COM is actually a good/stable framework and we built new system services in Windows 10 on top of it.

(a) More to the point, I know when COM does not or should not have anything to do with the issue at hand.
(b) I have said nothing either for or against COM because it is unnecessary and irrelevant in this context.
(c) If by "we" you mean you work for Microsoft, then you should surely be more aware of how programs in real life on Windows can pass a file to another program using the shell but without touching, using, or needing COM to do it.


Try it... I have. I've never written anything as err... 'clever' as Outlook but I have written Windows software that both calls other programs to handle a file and receives files at the command line from other programs, and in no cases did I ever use or need COM! In other words, I have directly matched the scenario in question here. One program can trivially run another program and pass it a file to be opened, even if the CLSID key of the target program has been deleted or never existed at all. This is because COM is just not needed in this context. COM need not be used to open the target program. Opening at the command line is all that is needed and the required information is stored in the registry (as I described) for precisely this (non-COM-related) purpose.

P.S. When you wrote "I would hazard a guess that the display problem @OriginalGriff is having is caused by Outlook generating a MHT file with the MIME type set to 'Content-Type: text/plain'", were you thinking it was online Outlook? I rather think @OriginalGriff was referring to the local program. This seems to me to perhaps be why you thought that the MIME types and HTTP downloads were involved when they are not (assuming from the context that he did mean the local program).

modified 6-Oct-20 11:55am.

GeneralRe: Oh come on Microsoft ... get your act together. Pin
Randor 6-Oct-20 5:15
professional Randor 6-Oct-20 5:15 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 5:50
markrlondon6-Oct-20 5:50 
AnswerRe: Oh come on Microsoft ... get your act together. Pin
Randor 6-Oct-20 6:10
professional Randor 6-Oct-20 6:10 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 6:38
markrlondon6-Oct-20 6:38 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
Randor 6-Oct-20 7:00
professional Randor 6-Oct-20 7:00 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 7:19
markrlondon6-Oct-20 7:19 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 7:11
markrlondon6-Oct-20 7:11 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 7:34
markrlondon6-Oct-20 7:34 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 7:50
markrlondon6-Oct-20 7:50 
QuestionRe: Oh come on Microsoft ... get your act together. Pin
Randor 6-Oct-20 9:56
professional Randor 6-Oct-20 9:56 
AnswerRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 10:47
markrlondon6-Oct-20 10:47 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
Randor 6-Oct-20 10:58
professional Randor 6-Oct-20 10:58 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 11:37
markrlondon6-Oct-20 11:37 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
Randor 6-Oct-20 11:54
professional Randor 6-Oct-20 11:54 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 13:08
markrlondon6-Oct-20 13:08 
GeneralRe: Oh come on Microsoft ... get your act together. Pin
markrlondon6-Oct-20 10:22
markrlondon6-Oct-20 10:22 
PraiseRe: Oh come on Microsoft ... get your act together. Pin
Randor 6-Oct-20 10:53
professional Randor 6-Oct-20 10:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.