Opendialog error in IDE and Delphi XE

Hi,
I have observed several times now that when calling an opendialog in Delphi XE from the IDE the program fails.  The executable directly works fine and this code has also worked fine in Delphi 2006, from the IDE.

Has anything changed that I should be aware of?  I am running Delphi XE and Windows 7 (32 bit)

{code}
  FName := '';
  OdMyData.InitialDir := ApplicationRootPath;
  try
    if OdMyData.Execute then
      FName := OdMyData.FileName;
    if FName <> '' then
      edIconPath.text := FName;
  finally
    imgIcon.Picture.Bitmap.LoadFromFile(FName);
  end;
{code}
Thanks
0
Bennie
6/20/2011 12:55:18 PM
embarcadero.delphi.ide 3925 articles. 0 followers. Follow

4 Replies
2132 Views

Similar Articles

[PageSpeed] 7

> {quote:title=Bennie Coetzer wrote:}{quote}
> I have observed several times now that when calling an opendialog in Delphi XE from the IDE the program fails.  The executable directly works fine and this code has also worked fine in Delphi 2006, from the IDE.
> Has anything changed that I should be aware of?  I am running Delphi XE and Windows 7 (32 bit)
> 
> {code}
>   FName := '';
>   OdMyData.InitialDir := ApplicationRootPath;
>   try
>     if OdMyData.Execute then
>       FName := OdMyData.FileName;
>     if FName <> '' then
>       edIconPath.text := FName;
>   finally
>     imgIcon.Picture.Bitmap.LoadFromFile(FName);
>   end;
> {code}

Your "finally" section will be called to load an image even when you may not have specified one with the openfiledialog (FName is still blank, you cancelled the dialog). Why?
--
Mark Jacobs
www.dkcomputing.co.uk
0
Mark
6/21/2011 10:18:24 AM
Hello,

Bennie Coetzer wrote:

> Hi, I have observed several times now that when calling an opendialog
> in  Delphi XE from the IDE the program fails. The executable directly
> works fine and this code has also worked fine in Delphi 2006, from the IDE.

You did not tell us how the program fails. Any error messages?

There was a posting on 2011-05-18 by Andreas Hausladen, which might be 
related to your problem:

> https://forums.embarcadero.com/thread.jspa?messageID=354333&tstart=0#354333


Achim
0
Achim
6/21/2011 11:12:26 AM
I am experiencing a similar problem with Delphi XE running on Windows 7. 

Under the compatabilty options in the properties of the shortcut to launch Delphi XE I have disabled the visual themes. Since doing this the Open and Save As dialogs do nothing in the Delphi IDE.  

I disabled the visual themes so that the form designer would no longer use my windows theme when displaying the forms... I want to see the forms in the designer with the controls showing the colour set in the control's property and not being overridden by the colour from my windows theme.

Edited by: Andrew Grant on Aug 17, 2011 7:03 PM
0
Andrew
8/18/2011 2:04:04 AM
Here's the problem: TOpenDialog.Execute fails, generating a "XXX application file has stopped working" window, with only one "Close Program" button. The problem only happens when debugging the program inside the IDE.

I found the problem happens when the Windows Aero Glass interface is OFF: 
Control Panel / All Control Panel Items / Personalization / Windows 7 BASIC

Turning Aero back on fixes the problem:
Control Panel / All Control Panel Items / Personalization / Windows 7

I'm using Windows 7, 64-bit, Delphi 2010, Update 5.

Edited by: David Eisler on Dec 18, 2011 10:21 AM

Never mind, the fix didn't stick.
0
David
12/18/2011 6:21:29 PM
Reply:

Similar Artilces:

Delphi Xe IDE error [Edit]
Hi, Getting the error: "Error in module : Declaration of class T_changeMeBack_s is missing or incorrect" when creating a new project as: New -> Other -> ActiveX Library Then adding New -> Other -> Active Form with the Include about box checked Project is created but the About1.pas file is not visible in the project manager (but a reference to it is found in the uses clause of the created unit and _TLB.pas files Edited by: mark buller on Nov 30, 2012 5:45 PM ...

Delphi XE IDE code parser error ?!? [Edit]
After adding a IdUDPServer to my form and trying to put some code into the OnUDPRead event, I'm not able to add any component to my form at design time, nor can I run the application. here is the error i got: http://i54.tinypic.com/2j5jl0p.jpg i`ve asked about this on StackOverflow and Mike Justin suggested to +remove the +System.+ from +TArray<System.Byte>+ (in the interface and implementation)+, even so then OnUDPRead event doesn`t trigger. To test this i have made a simple app which uses 2 IdUDPServer comps, one to broadcast and one to Listen, works as expected in Delph...

Setup.exe error when starting Delphi XE IDE on Win 7 with UAC
when I start Delphi XE on Win 7 Ultimate 64bit with UAC switched on I get the following displayed in the messages section of the screen Error executing 'C:\ProgramData\{7DE921C9-42C8-4DA3-8A44-043C3349FD1D}\Setup.exe': The requested operation requires elevation Should it try and run setup every time I open the IDE? Roy Sharp wrote: > when I start Delphi XE on Win 7 Ultimate 64bit with UAC switched on I > get the following displayed in the messages section of the screen > > Error executing > 'C:\ProgramData\{7DE921C9-42C8-4DA3-8A44-043C3349FD1D}\Setup...

VS ide / delphi ide key map
I'm quit lost in VS ide, F9 run, F8 / F7 Ctrl+Alt+P for tool pallet and the fast find when you type component name F11 to switch to code view / object inspector, the ability to navigate in the object inspector with tab and writing property name. Will someone make a Delphi to VS guide? -- Henning Swiboda wrote: > I'm quit lost in VS ide, F9 run, F8 / F7 > Ctrl+Alt+P for tool pallet and the fast find when you type component > name > F11 to switch to code view / object inspector, the ability to navigate > in the object inspector with tab and writing propert...

Error on Delphi 6 but not on Delphi Xe for Ftp
I am Experimenting with get a file from our webside server via Ftp. I have 2 Machines 1 a laptop runing XP Delphi 6 Indy 10.5.8.0 An a machine runing Window 7 Delphi XE2 with Indy 10.5.8.0. I am using the Same Code on Both. procedure TFrmMain.ProcessItemDalySpecial; var PathDest : String; FileName : String; begin with FrmTb2 do begin if ReadIniBoolean(IniCfg,'FTP','UseFtpDaly') then begin Ftp.Host := ReadIniStr(IniCfg,'FTP','HostDaly'); Ftp.Port := ReadIniInt(IniCfg,'FTP'...

Delphi 2006 vs Delphi 2009 IDE stability
Hello, all. I have medium sized project which includes about 20Mb of source code (just size of *.pas files). I use Delphi 2006. There are third party component suites JVCL, DevExpress Bars, Pegasus Imaging. All updates applied. The main problem is IDE stability. About four..five times a day IDE become unstable after intensive usage of code insight functions (most often I press Ctrl+Space key). The best outcome is that I have to save everything and restart the IDE. The worst outcome is when IDE stalls or falls into endless loop of error messages and any unsaved work is lost. OS...

XE is the last Delphi IDE that is usable
XE is the last Delphi version that doesn't mess the version information. Now I only use XE3 occasionally to check 64-bit related code. When it comes to compilation, I just use the DCC64 command line. For tasks as trivial as setting the version information, the Delphi XE3 IDE handles it in such a clumsy/buggy way. It really disappoints me. Am 02.03.2013 10:35, schrieb Simon Lau: > For tasks as trivial as setting the version information, the Delphi XE3 IDE handles it in such a clumsy/buggy way. This is mostly related to projects migrated from earlier versions. After t...

Delphi IDEs
Is it possible to write applications for Android and touch sensitive screens with Delphi XE4 or later versions of Delphi? Is it possible to write applications for Windows 8 and touch sensitive screens with Delphi XE4 and later versions of Delphi? Pier Pier wrote: > Is it possible to write applications for Android and touch sensitive > screens with Delphi XE4 or later versions of Delphi? iOS support was added in XE4. Android support was added in Delphi XE5. > Is it possible to write applications for Windows 8 and touch sensitive > screens with Delphi XE4 an...

Delphi 2009 error starting IDE
Hi all, When I try to start my D2009 I always get the same error. "Stream read error" I've already tried to reinstall using the administrator account, doesn't work. Thanks all > {quote:title=Hendrik Declercq wrote:}{quote} > Hi all, > > When I try to start my D2009 I always get the same error. > > "Stream read error" > > I've already tried to reinstall using the administrator account, doesn't work. > > Thanks all Have you installed D2009 alongside another version of Delphi. Or on a system that has h...

Comparison between Visual Studio 2008 IDE and Delphi 2010 IDE?
Hi, I wonder which is more programmer friendly. Especially for syntax highlighting and fast code writting, viewing.. Thanks.. Mehmet Fide wrote: > Hi, > > I wonder which is more programmer friendly. Especially for syntax > highlighting and fast code writting, viewing.. > > > Thanks.. See "RAD Studio 2010 vs. Visual Studio 2010" in non-technical group. -- Warm Regards, Lee ...

IDE Hanging issue
Hi, I'm running Windows 7 Ultimate, Delphi XE (and Delphi 2010). I have a largish project group that I've upgraded from Delphi 2010 into Delphi XE, it seemed to be working ok initially but now when I open it in Delphi XE I'm finding that the IDE just locks up shortly after I do anything in the project, for example I can start Delphi XE load my project (only the main form is open - not data modules or anything) and simply press F12 to change the Form/Source view and the IDE locks up, when I look at my WIndow s Task Manager it shows that BDS.EXE is utilising ~50% or my CPU reso...

Re: Where is data form wizard in Delphi 2009? [pubic.delphi.ide]
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_21560.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" Sample picture showing drag and drop from persistent fields edit window. (Any TField in any TDataset should work, TSomeKindofTable, or TSomeKindofQuery. Warren --JivePart=_21560.zeB8CwDOH5aMJzMl Content-Type: image/jpeg; name="drag_and_drop_from_persistent_fields_editor.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; ...

Help Delphi 2010 IDE
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_3d58a.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" See delphi.documentation thread with same subject. -- Cesar Romero http://www.cesarromero.com.br --JivePart=_3d58a.zeB8CwDOH5aMJzMl Content-Type: image/png; name="Delphi2010HelpError.png" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Delphi2010HelpError.png" iVBORw0KGgoAAAANSUhEUgAAAcEAAAEuCAIAA...

Delphi XE
Hi, with Delphi XE every time i run a program in the IDE (with oder without Debugger) the executable is locked for a few minutes. In this time i can't recompile my project. I get the error F2039 - cannot open outputfile. The installation is on the same machine as my Delphi 2010 - here it works without any problem (Win 7 Ultimate). No VirusScanner is active and every service who can lock the file is stopped. Has Somebody the same problem or an idea? Thanks Robert I have this on D2010. Each time I run a program I have to build or compile twice because it always f...

Web resources about - Opendialog error in IDE and Delphi XE - embarcadero.delphi.ide

Wazapp for Nokia N9 gets major update. Bumped to version 0.9.12.
It has been long since we covered some Nokia N9 related news on our blog. But can’t resist reporting this. Wazapp the fruit of hard work put ...

Kiwix - enabling offline copies of wikimedia projects
I have blogged before about kiwix - this article is an effort to tell other people how to do the same. Kiwix is a cross-platform reader of zim ...

Radio Prague - Czech detention of Russian citizen fuels campaign for reform of Interpol
We return to the case of Russian citizen Tatiana Paraskevich who was detained for 22 months in the Czech Republic on what human rights organisations ...

The Green Party of the United States
2012 Green Party Platform adopted July 2012, Baltimore, Maryland II. SOCIAL JUSTICE Historically, America led the world inestablishing a society ...

Mark Finkle’s Weblog » XPCOM
If you’ve developed applications or extensions using the Mozilla platform, you know that there are tons of services and APIs available. We use ...

Resources last updated: 12/21/2015 5:43:17 AM