Click here to Skip to main content
15,895,011 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: peephole optimization (compiler) Pin
Stuart Dootson14-May-09 10:09
professionalStuart Dootson14-May-09 10:09 
GeneralRe: peephole optimization (compiler) Pin
Member 372529714-May-09 10:24
Member 372529714-May-09 10:24 
GeneralRe: peephole optimization (compiler) Pin
BobInNJ14-May-09 10:47
BobInNJ14-May-09 10:47 
GeneralRe: peephole optimization (compiler) Pin
Member 372529714-May-09 10:55
Member 372529714-May-09 10:55 
GeneralRe: peephole optimization (compiler) Pin
BobInNJ14-May-09 11:22
BobInNJ14-May-09 11:22 
GeneralRe: peephole optimization (compiler) Pin
Member 372529714-May-09 19:05
Member 372529714-May-09 19:05 
GeneralRe: peephole optimization (compiler) Pin
BobInNJ15-May-09 4:16
BobInNJ15-May-09 4:16 
QuestionDoes windows XP use COM to determine file associations? Pin
kinar14-May-09 7:53
kinar14-May-09 7:53 
I've got an app that uses a ShellExecute to launch the default web browser via

ShellExecute(NULL, "open", "http://somewebsite.com", NULL, NULL, SW_SHOWNORMAL);

On XP, sometimes it works and other times it doesn't resulting in an Error code 5 being returned from the ShellExecute (error code 5 = SE_ACCESS_DENIED) indicating that the OS refused to launch the default web browser.

From the MSDN documentation for ShellExecute, I noticed the bit about if what you are launching uses COM, you will need to initialize COM in your app before calling ShellExecute. When I add the CoInitialize(NULL) at app startup (and the CoUninitialize at the close), it fixes the problem and the page launches every time.

This is all great...but why does it work? the only thing I can come up with is that Windows uses COM to determine what app should open html files. Except that doesn't make sense as to why it sometimes works...

What am I missing?

Oh, and Vista/win7 works. This behavior is only seen on XP
AnswerRe: Does windows XP use COM to determine file associations? Pin
David Crow14-May-09 8:04
David Crow14-May-09 8:04 
QuestionRe: Does windows XP use COM to determine file associations? Pin
CPallini14-May-09 9:28
mveCPallini14-May-09 9:28 
Joke[OT] Re: Does windows XP use COM to determine file associations? Pin
David Crow14-May-09 9:32
David Crow14-May-09 9:32 
QuestionInserting Tuples in MS Access Pin
birat14-May-09 6:36
birat14-May-09 6:36 
AnswerRe: Inserting Tuples in MS Access Pin
David Crow14-May-09 6:44
David Crow14-May-09 6:44 
GeneralRe: Inserting Tuples in MS Access Pin
birat14-May-09 7:55
birat14-May-09 7:55 
QuestionRe: Inserting Tuples in MS Access Pin
David Crow14-May-09 8:03
David Crow14-May-09 8:03 
Questiondatabase [modified] Pin
vital_parsley200014-May-09 6:24
vital_parsley200014-May-09 6:24 
AnswerRe: database Pin
David Crow14-May-09 6:45
David Crow14-May-09 6:45 
QuestionRe: database Pin
vital_parsley200014-May-09 20:13
vital_parsley200014-May-09 20:13 
AnswerRe: database Pin
David Crow15-May-09 2:36
David Crow15-May-09 2:36 
QuestionLib Linking warning [modified] Pin
transoft14-May-09 6:14
transoft14-May-09 6:14 
AnswerRe: Lib Linking warning Pin
Stuart Dootson14-May-09 9:03
professionalStuart Dootson14-May-09 9:03 
GeneralRe: Lib Linking warning Pin
transoft14-May-09 10:49
transoft14-May-09 10:49 
GeneralRe: Lib Linking warning Pin
Stuart Dootson14-May-09 13:13
professionalStuart Dootson14-May-09 13:13 
QuestionHow to find input array index from sorted output? Pin
Jaguks14-May-09 5:43
Jaguks14-May-09 5:43 
AnswerRe: How to find input array index from sorted output? Pin
CPallini14-May-09 6:59
mveCPallini14-May-09 6:59 

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.