none
Error message 0x80070020 RRS feed

  • Question

  • I can run a Small Basic program without any trouble, but when I try to rerun it I get an error message "The process cannot access the file because it is being used by another process. (Exception from HRESULT:0x80070020)" What is the cause of this error and, more importantly, how do I get rid of it, short of rebooting my computer?
    Saturday, October 5, 2013 4:16 PM

Answers

  • Just ran your program in the ide and from the exe and had no trouble.

    I've had this happen before but its never persisted and like Pappa Lapub mentions it could be from the first time you run/compile the program.

    Also as Pappa Lapub mentioned the Task manager is an informative tool. To find it type task manager in the program search at the start button and run it next to your Small Basic program. You should see the process finish when the sb program finishes. If you can't run your sb program run task manager and look for tmp###.tmp and use task manager to end the process.

    The first time you run/compile a sb program it creates a tmp###.tmp file. Once it has compiled and you save it, it runs as an .exe file from the program directory.

    I'm no expert with this internal stuff but hope that helps.

     


    Sunday, October 6, 2013 8:56 AM
    Moderator

All replies

  • May be your first runned process (file) did not terminate completely.

    Look in taskmanager or Process Explorer

    and terminate it if necessary.

    Saturday, October 5, 2013 6:26 PM
    Answerer
  • We might to help a bit more if you post the code.

    Sunday, October 6, 2013 1:02 AM
    Moderator
  • The problem occurs only when I run the program from within the Small Basic IDE. If I launch the program from the .sb file I don't have the problem.

    I'm running Windows 7 64-bit with 16 GB RAM if that's any help.

    It happens whatever program I run, so it's not a program specific problem. However, as you've asked, here is one of the programs:

    wlft = 560
    wtop = 160
    '
    clft = 20
    ctop = 8
    '
    TextWindow.CursorLeft = clft
    TextWindow.CursorTop = ctop
    TextWindow.WriteLine("Julian Date")
    TextWindow.CursorLeft = clft
    TextWindow.WriteLine("~~~~~~~~~~~")
    TextWindow.CursorLeft = clft 
    TextWindow.CursorTop = ctop + 3
    TextWindow.Write("Year ")
    year=TextWindow.ReadNumber()
    TextWindow.CursorLeft = clft + 11
    TextWindow.CursorTop = ctop + 3
    TextWindow.Write("Month  ")
    month=TextWindow.ReadNumber()
    TextWindow.CursorLeft = clft + 22
    TextWindow.CursorTop = ctop + 3
    TextWindow.Write("Day ")
    day=TextWindow.ReadNumber()
    TextWindow.CursorLeft = clft
    TextWindow.CursorTop = ctop + 5
    TextWindow.Write("Hour ")
    hour=TextWindow.ReadNumber()
    TextWindow.CursorLeft = clft + 11
    TextWindow.CursorTop = ctop + 5
    TextWindow.Write("Minute ")
    minute=TextWindow.ReadNumber()
    TextWindow.CursorLeft = clft + 22
    TextWindow.CursorTop = ctop + 5
    TextWindow.Write("Second ")
    second=TextWindow.ReadNumber()
    FracDay=(((second/60)+minute/60)+hour)/24  'Fractional part of the day 
    If month>2 Then   ' If the month is March or later 
      K=year+1        'use year + 1
      else            'otherwise
        K=year        'use year.
      EndIf
    L=Math.Floor((K+99)/100)
    N=Math.Floor(3*L/4)
    P=Math.Floor(7*K/4)
    R=Math.Floor(275*month/9)
    JD=367*year-N-P+R+day+FracDay+1721029
    JD = Math.Round(JD * 100000) / 100000  'Julian date 
    TextWindow.CursorLeft = clft 
    TextWindow.CursorTop = ctop + 9
    TextWindow.WriteLine( "JD = "+JD)
    TextWindow.CursorLeft = clft 
    TextWindow.CursorTop = ctop + 13


    • Edited by MHBN Sunday, October 6, 2013 5:47 AM
    Sunday, October 6, 2013 5:43 AM
  • Just ran your program in the ide and from the exe and had no trouble.

    I've had this happen before but its never persisted and like Pappa Lapub mentions it could be from the first time you run/compile the program.

    Also as Pappa Lapub mentioned the Task manager is an informative tool. To find it type task manager in the program search at the start button and run it next to your Small Basic program. You should see the process finish when the sb program finishes. If you can't run your sb program run task manager and look for tmp###.tmp and use task manager to end the process.

    The first time you run/compile a sb program it creates a tmp###.tmp file. Once it has compiled and you save it, it runs as an .exe file from the program directory.

    I'm no expert with this internal stuff but hope that helps.

     


    Sunday, October 6, 2013 8:56 AM
    Moderator
  • Hi, MHBN,

    I was able to reproduce the error message. When I created the .sb file and then moved it to a restricted folder (in this case the Program Files (x86)\Microsoft\Small Basic\ folder) I got the same error when I tried to run the program from within the Small Basic IDE.

    Where are you saving your .SB program files? Are you saving them under Program Files?

    -Anthony

    Sunday, October 6, 2013 6:44 PM
  • The SB application file is saved in the Program Files (x86) folder. The programs I write are kept in the Small Basic folder in My Documents.
    Sunday, October 6, 2013 9:25 PM
  • Were you able to run the task manager?
    Or to keep it simple, just copy your code and create a new program file. See if that helps.
    Sunday, October 6, 2013 9:31 PM
    Moderator
  • Yes, but to no avail. Sorry for not getting back to you about it, but I wanted to be sure of what I was doing.
    Sunday, October 6, 2013 9:52 PM
  • That's ok. I had this prob before but it didn't persist.

    Just quickly, you might want to try some simple approaches like:

    Copy all the code or parts at a time into a new file and run/compile bits at a time.

    And/or you could rebuild the program, but do all this in a new file.

    All the best, hope it gets sorted.

    Sunday, October 6, 2013 10:04 PM
    Moderator
  • I copied the code across to another computer, same OS. I had no trouble with it there, so it seems to be a computer specific not a program specific problem. Maybe it's time to reformat my hard drive and create a clean working environment.

    MHBG

    Monday, October 14, 2013 9:59 PM