tag:blogger.com,1999:blog-11772075.post1817922406557625642..comments2023-07-05T09:02:00.033+01:00Comments on DelphiDabbler's Blog: Delphi XE and ShellExecute glitchDelphidabblerhttp://www.blogger.com/profile/04753825418913482066noreply@blogger.comBlogger16125tag:blogger.com,1999:blog-11772075.post-47225262403990273082018-06-23T15:33:50.502+01:002018-06-23T15:33:50.502+01:00nothing seems to work. resorted to use createproce...nothing seems to work. resorted to use createprocess with commandline path to document.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11772075.post-89904382081059626572018-06-21T20:26:35.831+01:002018-06-21T20:26:35.831+01:00Definitely from my showmessage experiments, I thin...Definitely from my showmessage experiments, I think the problem is with PChar() function as Jose points out. Let's see.Tiger Jaktnoreply@blogger.comtag:blogger.com,1999:blog-11772075.post-3750903959408575662018-06-21T20:24:43.573+01:002018-06-21T20:24:43.573+01:00I am also facing a shellexecute glitch with XE5 in...I am also facing a shellexecute glitch with XE5 in win7. Sometimes it executes sometimes crashes the application without executing an else error message block. I tried showmessage(path) each time. no problem with path each time but shellexecute becomes unpredictable.Tiger Jaktnoreply@blogger.comtag:blogger.com,1999:blog-11772075.post-43297640657281564582017-03-02T19:06:26.106+00:002017-03-02T19:06:26.106+00:00Thx
I'll try that.Thx<br /><br />I'll try that.Delphidabblerhttps://www.blogger.com/profile/04753825418913482066noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-68213104884893429582017-03-02T14:49:47.298+00:002017-03-02T14:49:47.298+00:00the problem is, Delphi no convertion String Type t...the problem is, Delphi no convertion String Type to PChar is Wrong<br /><br />this code work fine on Windows 10 with Compile with delphi XE8<br /><br />var<br /> s : WideString;<br />begin<br /> s := VariablePathString;<br /> ShellExecuteW(Handle, PWideChar('open'), PWideChar(s), nil, nil, SW_SHOWNORMAL);<br />end;Jose Ozunahttps://www.blogger.com/profile/01787309510765028759noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-4383763717444008552016-01-13T03:40:14.227+00:002016-01-13T03:40:14.227+00:00Glad it'snot me then!
I'd also be interes...Glad it'snot me then!<br /><br />I'd also be interested in any solution.Delphidabblerhttps://www.blogger.com/profile/04753825418913482066noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-40587749365024876532016-01-06T17:20:33.084+00:002016-01-06T17:20:33.084+00:00Problem is in ShellExecute!!! This problem of Shee...Problem is in ShellExecute!!! This problem of SheelExecute - only in Windows 10. In XP, Windows7, Windows8 - everything is normal.... Who does that know how to correct it?KeeperWorldhttps://www.blogger.com/profile/16957086853102644434noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-27977115191448469312015-10-21T22:49:41.091+01:002015-10-21T22:49:41.091+01:00Problem is in ShellExecute. I'm intercepting a...Problem is in ShellExecute. I'm intercepting any links clicked in TWebBrowser and handling them myself.<br /><br />Haven't had chance to try any other threading models yet.Delphidabblerhttps://www.blogger.com/profile/04753825418913482066noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-91201334915916238732015-10-21T19:08:36.412+01:002015-10-21T19:08:36.412+01:00The problem is in ShellExecute or it do really nee...The problem is in ShellExecute or it do really need a TWebBrowser to reproduce?EMBnoreply@blogger.comtag:blogger.com,1999:blog-11772075.post-52954487478368459652015-10-07T14:24:39.327+01:002015-10-07T14:24:39.327+01:00Did you test the different threading models?Did you test the different threading models?Lars Fosdalhttps://www.blogger.com/profile/05635001623287214775noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-53956214602829468862015-10-07T11:53:05.861+01:002015-10-07T11:53:05.861+01:00Tried calling CoInitializeEz as suggested Lars, bo...Tried calling CoInitializeEz as suggested Lars, both in FormCreate and FormDestroy for the main form and in the BeforeBrowser and AfterBrowse events of a TBrowseURL component and no luck - the program still hangs in the IDE when the action is triggered while it works fine when run outside the IDE.Delphidabblerhttps://www.blogger.com/profile/04753825418913482066noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-56778202560560815962015-10-06T09:18:08.843+01:002015-10-06T09:18:08.843+01:00The reason is that some shellexecutes may cause CO...The reason is that some shellexecutes may cause COM activation, and that will fail if you don't do CoInit/CoUnInit.<br />I will be curious to see if it helps for your problem?Lars Fosdalhttps://www.blogger.com/profile/05635001623287214775noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-53821267363097569632015-10-05T20:13:05.357+01:002015-10-05T20:13:05.357+01:00I'm not sure if I did call CoInitialize - I...I'm not sure if I did call CoInitialize - I'll check and try it if not.<br /><br />I know some parts of the code do call it, but there may (should) be a matching CoUnintialize to those calls.<br /><br />Thanks.Delphidabblerhttps://www.blogger.com/profile/04753825418913482066noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-8381063227249294332015-10-05T14:43:58.279+01:002015-10-05T14:43:58.279+01:00Do you call CoInitialize before ShellExecute?
CoIn...Do you call CoInitialize before ShellExecute?<br />CoInitializeEx(nil, COINIT_APARTMENTTHREADED or COINIT_DISABLE_OLE1DDE);Lars Fosdalhttps://www.blogger.com/profile/05635001623287214775noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-27082179463396172562015-10-05T10:35:10.718+01:002015-10-05T10:35:10.718+01:00Glad someone else has seen it. I was thinking I...Glad someone else has seen it. I was thinking I'd broken something!Delphidabblerhttps://www.blogger.com/profile/04753825418913482066noreply@blogger.comtag:blogger.com,1999:blog-11772075.post-88027662063791102492015-10-05T10:04:12.912+01:002015-10-05T10:04:12.912+01:00I know that one but never tracked it down. It occu...I know that one but never tracked it down. It occurred even on Windows XP for me sometimes.Thomas Muellerhttp://blog.dummzeuch.denoreply@blogger.com