Results 1 to 6 of 6

Thread: [RESOLVED] ActiveX Control stops running then delete control's temp folder???

  1. #1

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Resolved [RESOLVED] ActiveX Control stops running then delete control's temp folder???

    Hello I am working on an ActiveX Control Object that has a temp data folder that it works from when it is being used, currently on the machine. So far when the Control is executed then it just creates the folder, then when it stops being used then it should be able to delete the folder, that is is using. Then when you execute the Control, again it just renews the folder's time, date and contents of it. That isn't what I am looking to do here...

    PS: Here is the Source Code that I am using. Also then this is only the relevant parts to it. I guess that this is able to make the Control to delete the Folder, as per when the Control is removed from execution...
    Code:
    Private Sub UserControl_Terminate()
    On Error Resume Next
    
    Dim fsObject As FileSystemObject
    Set fsObject = New FileSystemObject
    
        If Dir("c:\temp\project1") = "" Then
            fsObject.DeleteFolder ("c:\temp\project1")
        End If
    End Sub
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  2. #2

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: ActiveX Control stops running then delete control's temp folder???

    This is what I used to get the effect of the MkDir and then the DeleteFolder, commands:
    Code:
    Public Sub Command1_Click()
    Rem This is the "DeleteFolder" command, being used in the ActiveX Control Object...
    
    Dim fsObject As FileSystemObject
    Set fsObject = New FileSystemObject
    
    fsObject.DeleteFolder ("c:\temp\project1")
    End Sub
    Code:
    Public Sub Command3_Click()
    Rem This is the "MkDir" command, being used in the ActiveX Control Object...
        MkDir("c:\temp\project1")
    End Sub
    Last edited by ThEiMp; Oct 25th, 2012 at 02:56 AM.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: ActiveX Control stops running then delete control's temp folder???

    I would suggest that you not use the FSO. It is slow and uses much more resources than the native VB methods. IMO it should never be used in VB6.

    I'm not sure what problem you are having if any. I would suggest that you not delete the folder at all as this could be a problem if you plan to let other people use the program. For example I have a C:\Temp folder on my pc and if I were to run your program and it deleted that folder I would have to hunt you down and get some pay back.

    Instead you should delete your programs tmp files and only those files. You should also never hard code the drive letter as this could be a problem on some machines as well.

    Rather than using FSO you should use the native VB Kill method to delete your files and only your files.

  4. #4

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: ActiveX Control stops running then delete control's temp folder???

    Well then I always use the Kill for Files, but then there is a Folder that I need to remove, as when the Form with the Control is exited by the end-user...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  5. #5
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    Re: [RESOLVED] ActiveX Control stops running then delete control's temp folder???

    There is a native command for that as well RMDIR()

    As for removing the folder, what if there are other files in that folder that the user actually needs to keep.
    The folder C:\Temp will exist on many systems and it would not be out of the question for a folder named project1 to exist in the folder as well. In fact on my system it does already and has files in it that I would not want a program to auto delete on me.

    What is the need to delete the folder and why is it hard coded?

  6. #6

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: [RESOLVED] ActiveX Control stops running then delete control's temp folder???

    Well I have been looking at the RMDIR() command, however it just didn't work for me, as when I was coding it, at that point in time. However there are now temp files, that are required to be kept. However the Documents that are created by the ActiveX Control Object, are then moved to another region of the disk, as per that of the end-user's request...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

Tags for this Thread

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