Results 1 to 7 of 7

Thread: Something is holding my process

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2012
    Posts
    433

    Something is holding my process

    My VB6 program uses some ActiveX, timers...
    If I try terminate my program, something is holding my process.
    How could I find which ActiveX or timer is holding?
    Is there any tool to find it in the Visual Studio6?

    Thanks in advance.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,471

    Re: Something is holding my process

    Good question, but I doubt timers are the culprit. Timers are destroyed with the window they are assigned/attached to.

    However, odds are that one of those controls is holding a reference to something in your project (probably the form). Do any of the activex items ask you to pass the form (or any of its items) as a parameter or property? If not, could be a poorly designed activex object that has circular references within itself. If it does, you may want to explicitly set that control to Nothing during form_unload.

    You can probably narrow it down a bit. Start a fresh project and add just 1 of the activex objects to that project. Run it & see if it hangs afterwards. If not, add another and so on. Process of elimination.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    Hyperactive Member
    Join Date
    Jul 2013
    Posts
    374

    Re: Something is holding my process

    Quote Originally Posted by jdy0803 View Post
    My VB6 program uses some ActiveX, timers...
    If I try terminate my program, something is holding my process.
    How could I find which ActiveX or timer is holding?
    Is there any tool to find it in the Visual Studio6?
    I use http://processhacker.sourceforge.net/

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2012
    Posts
    433

    Re: Something is holding my process

    Regarding this ActiveX, I have been using for a long time so far and be verified that have no problem.
    I used End statement to terminate my application but something is holding my application and can't terminate.
    I need some monitoring tool to find the one that is holding my application.

  5. #5
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,471

    Re: Something is holding my process

    If you have to use END, your code is flawed, period. I think you are going to need to spend serious time walking through your code to determine what is going on.

    The most common reason for a program to reload itself (which may appear like something is holding it up), is when the project is unloading and somewhere after the unload code/statements, the project calls code that checks/sets a form/control property. This action will reload the form simply to have access to the property so it can be checked/set. I suggest verifying that this is not happening. A simple way to test this:

    1. In Form_Load: Debug.Print "Form loaded "; Timer
    2. Run your project and close it normally
    Look at the Immediate window. Did that Debug statement print more than once? If so, your form is reloading
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2012
    Posts
    433

    Re: Something is holding my process

    My project is MDI which have MDI Child forms.
    From the MDIForm_Load, load MDIChildForm1 and MDIChildForm1 call MDIChildForm2.
    Those two(MDIChildForm1 and MDIChildForm2) call(switch) each other.
    In the process of this, maybe I might missed unload Me.
    I'll look into my code carefully and will use Debug.Print to figure it out.
    Thanks,

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2012
    Posts
    433

    Re: Something is holding my process

    I have 1 MDIForm and 2 MDIChild forms, Form1, Form2.
    Here is the codes.
    ---------------------------------------------------------
    [MDIForm]
    Private Sub MDIForm_Load()
    Load Form1
    End Sub
    [Form1]
    Private Sub Command1_Click()
    Load Form2
    Unload Me
    End Sub
    [form2]
    Private Sub Command1_Click()
    Load Form1
    Unload Me
    End Sub
    Private Sub Command2_Click()
    '?
    End Sub
    ---------------------------------------------------------
    I want to terminate from Form2's Command2_Click.
    How to raise MDIForm_Unload event?
    Can I use RaiseEvent? or directly call like MDIForm_Unload()?

    =>I got it!
    I can simply do like this.
    Unload MDIForm1
    Last edited by jdy0803; Jan 19th, 2015 at 01:55 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