Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2005
    Location
    Flanders - Belgium
    Posts
    17

    No DialogEx.Close

    Hi all,

    when I use this code, the Office program does open the file,
    but the Dialog won't close...
    I'm I doing something wrong?

    File.Open("C:\\TOOLS\\EigenTEKST.rtf", "", SW_SHOWNORMAL);
    Result = DialogEx.Close(0);

  2. #2
    Join Date
    Mar 2005
    Location
    Indianaoplis, IN USA
    Posts
    127
    I could be wrong, as I don't have the latest version yet, but I believe that DialogEx.Close is used for a Dialog Windows that is created by a DialogEX function.

    I wouldn't expect it to have any effect at all on a regular window.

  3. #3
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Confirmed here. I think the problem is that the dialog loses focus and once that happens, no more code is executed. This focus problem was reported in another thread.
    Dermot

    I am so out of here

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    i had found a bug in the dialog, but in all my tests i could always close the dialog window and useing the code like below

    Code:
    File.Open("AutoPlay\\Docs\\-20070416.log", "", SW_SHOWNORMAL);
    Result = DialogEx.Close(0);
    it opens the log file and the dialog closes with no problems

    Dermot, you have confirmed this bug but it works fine for me, on what system did you test, i tested on Vista home premium

    below is the apz i used to test
    Last edited by RizlaUK; 02-01-2009 at 11:34 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  5. #5
    Join Date
    May 2006
    Posts
    5,380
    scrap that, i changed the code to

    Code:
    File.Open("AutoPlay\\Docs\\-20070416.log", "", SW_SHOWNORMAL);
    Application.Sleep(1000)
    Result = DialogEx.Close(0); 
    result = Dialog.Message("Notice", "Your message here.", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);

    and now it dose not close the dialog at all, but the message dialog dose show ok, so the code is still getting executed, its the DialogEx.Close that is not executeing if the dialog loses focus, i will report this as a seprate bug
    Last edited by RizlaUK; 10-21-2008 at 04:21 AM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  6. #6
    Join Date
    Mar 2005
    Location
    Indianaoplis, IN USA
    Posts
    127
    Ahhh... I misunderstood the question... I thought he was trying to use the DioalogEX.Close to close the window with the RTF file. (instead of the Dialog that had the "open" button for the RTF file)

    Seems, smarter people than I, are already on the case.... carry on gentlemen.

  7. #7
    Join Date
    Nov 2005
    Location
    Flanders - Belgium
    Posts
    17
    Hello guys,
    thanks for the thinking and efforts.

    Very strange... it works when I take another file to open, like:

    File.Open("AutoPlay\\Docs\\Letters.TXT", "", SW_SHOWNORMAL);
    Result = DialogEx.Close(0);

    (Here the file is opened by f.e. Editpad Lite)


    It does NOT work when Office (=Word) opens a file, as in my first example.

  8. #8
    Join Date
    May 2006
    Posts
    5,380
    yes, it worked for me useing notepad, but if there is a delay and the dialog loses focus before the close command then it fails, notepad and editpad both load quicker than word so the File.Open is executed faster and it jumps right on to the close command before it loses focus, simulate a lodeing delay with Application.Sleep and it will fail.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  9. #9
    Join Date
    Jun 2000
    Location
    Indigo Rose Software
    Posts
    1,943
    Hi Everyone,

    This is he result of a bug in the dialog code that is causing problems when the dialog looses focus.

    We're on the case and hopefully we'll have a fix out for everyone shortly.

    Thanks for your patience.
    MSI Factory The Next Generation Intelligent Setup Builder

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts