home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,614 of 10,840   
   Per Juul Larsen to All   
   Re: Process in the background.   
   29 Jul 08 12:04:49   
   
   From: juul@larsen.dk   
      
   Dean Earley skrev:   
   > Per Juul Larsen wrote:   
   >> Dean Earley skrev:   
   >>> Per Juul Larsen wrote:   
   >>>> Hi   
   >>>>   
   >>>> My VB aplication copies a lot of images from a removable media which   
   >>>> is the first process (function).   
   >>>> Is there a way to allow the copy process to run in the background,   
   >>>> in order to let the application continue with other activities. ?   
   >>>> (sending SQLquerries etc.)   
   >>>>   
   >>>> Right now I must wait untill all the files have been found and   
   >>>> copied to my HD. A little pity.   
   >>>>   
   >>>> The copy process  goes like this :   
   >>>>   
   >>>> Function CopyFile(InpFile As String, OutpFile As String)   
   >>>> On Error Resume Next   
   >>>> Dim ase As String   
   >>>> Open InpFile For Binary As #1   
   >>>> ase = String(LOF(1), vbNullChar)   
   >>>> Get #1, , ase   
   >>>> Close #1   
   >>>> Open OutpFile For Binary Access Write As #2   
   >>>> Put #2, , ase   
   >>>> Close #2   
   >>>> End Function   
   >>>   
   >>> Another option is multithreading which is awkward but doable in VB6,   
   >>> or you can emulate it by starting another process to do the copying   
   >>> and some form of IPC (com, DDE, windows events, etc) to bnotify when   
   >>> it has finished.   
   >>>   
   >>> Whether you use this or SHFileOperation() depends how much control   
   >>> you want over the copying.   
   >>>   
   >> Thank you for the answer.I am considering what to do.   
   >> Have tried Shell (batchfile) and it looks like it goes a little faster.   
   >>   
   >> mvh pjl   
   >   
   > Erm, you will also find that the real CopyFile function is a lot faster,   
   > especially as the one you give doesn't do anything special.   
   >   
   Hi.   
      
   Tried Your advice..   
   Wrote this vbs Script :   
      
   dim filesys   
   Set filesys=CreateObject("Scripting.FileSystemObject")   
   filesys.CopyFile"G:\DCIM\101MSDCF\*.jpg","c:\picture\backup\temp"   
      
   and startet the vbs Script via SHELL in my VB.   
      
   Result : 3 times faster !!!   
      
   thank you.   
      
   regars pjl   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca