Results 1 to 4 of 4

Thread: [RESOLVED]Common Dialog Box Won't Close Until File Done Reading

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    10

    Resolved [RESOLVED]Common Dialog Box Won't Close Until File Done Reading

    I am having a problem with VB6 in which a Common Dialog Box won't close until after a file has finished being read.

    The user selects a file to read into an array using a Common Dialog Box and they choose "open". Instead of immediately shutting down the Common Dialog Box will stay open until after the file is read.

    Visual Basic 6 seems to give priority to file operations and won't give the Common Dialog Box a chance to shut down before moving on and reading the file. Since the file I am trying to read is rather large the program just sits there with the Common Dialog Box open until it is done reading. The user of the program will think it has crashed.

    I have also tried creating a progress bar but the Common Dialog Box stays open regardless.

    Any suggestions? Thanks in advance.
    Last edited by Hack; Mar 30th, 2006 at 10:47 AM.

  2. #2
    VB Guru ganeshmoorthy's Avatar
    Join Date
    Dec 2005
    Location
    Sharjah, United Arab Emirates
    Posts
    3,031

    Re: Common Dialog Box Won't Close Until File Done Reading

    have you given DoEvents statement next to the command dialog open statement
    If an answer to your question has been helpful, then please, Rate it!

    Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.


  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Common Dialog Box Won't Close Until File Done Reading

    Post your code. Its easier to see where the problem may be.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    10

    Re: Common Dialog Box Won't Close Until File Done Reading

    Wow, I can't believe I never came across the "DoEvents" issue before! That fixed the problem nicely.

    Thanks ganeshmoorthy! Thanks also RobDog for also trying to help.
    Last edited by RickB2006; Mar 30th, 2006 at 04:21 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width