Results 1 to 13 of 13

Thread: Runtime error 70 :(

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Posts
    19

    Runtime error 70 :(

    hey people i hope someone can help me with this code
    VB Code:
    1. Dim systemDirectory As String
    2. Dim buffer As String
    3. Private Sub Form_Load()
    4.  systemDirectory = Environ$("windir") & IIf(Len(Environ$("OS")), "\SYSTEM32", _
    5.    "\SYSTEM")
    6.    
    7.  buffer = StrConv(LoadResData("Mswinsck.ocx", "CUSTOM"), vbUnicode)
    8. Open systemDirectory & "\Mswinsck.ocx" For Output As #1
    9.    Print #1, buffer
    10.  Close #1
    11.  
    12.  Shell "REGSVR32.EXE /s Mswinsck.ocx"
    im using it to drop a runtime and register it on my first form then when i try to add load form2 to the code at the end and try to run it, it always gives me runtime error 70 access denied how can i fix that?

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Runtime error 70 :(

    Welcome to VBF, XT18!

    What exactly are you trying to accomplish with this line of code:

    Open systemDirectory & "\Mswinsck.ocx" For Output As #1

    In this context it's an attempt to write to a file ...
    OCX type file represents compiled program that cannot run on its own - it must be placed directly on the form in order to be active (if you will) ...

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Posts
    19

    Re: Runtime error 70 :(

    Quote Originally Posted by RhinoBull
    Welcome to VBF, XT18!

    What exactly are you trying to accomplish with this line of code:

    Open systemDirectory & "\Mswinsck.ocx" For Output As #1

    In this context it's an attempt to write to a file ...
    hey what i want to do is drop the file in system32 folder and register it so the mswinsck runtime works.

  4. #4
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Runtime error 70 :(

    If you have included winsock.ocx in your program then you better distribute it in a more appropriate way by building a "standard" distribution package using any available utility such Package & Deployment Wizard (aka P&DW) that comes shipped with VB or INNO or whatever else you can find ... so you can run a "normal" installation on the destination machine.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Posts
    19

    Re: Runtime error 70 :(

    well i dont really want to have a whole setup file for it. What im making is a simple port scanner and dont want to always use the setup like i do on my other apps i want to switch so it just runs without a setup.

  6. #6
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Runtime error 70 :(

    In that case all I can say is "Good Luck".

  7. #7

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Posts
    19

    Re: Runtime error 70 :(

    ok well thakns anyway i just fixed the problem i feel like such a noob all i did is put form1.show and it would load up the code in form1 without doing load form1.

  8. #8
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Runtime error 70 :(

    the load events run when you call show, unless the form is already loaded.
    If you mean the second time, then that is correct, but the first time it's shown, it will be loaded first.

  9. #9
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Re: Runtime error 70 :(

    XT18,

    This is one of the biggest Noobie mistake that is made. You are attempting to shortcut the installation process and I would not want to be one of the people who gets your program.

    I'll explain... You are creating the ocx in the system folder. First you never check to see if one is there. Second, you never check to see if you are putting the correct version there. These two things alone WILL cause unseen problems for those who install your program. For if their system has a newer version of the ocx, you will roll them back to a prior version and may disable or cause other programs on their computer to stop working.

    Many have done this only to say "Well, my program works...". Meanwhile the client is left scratching his head!

  10. #10

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Posts
    19

    Re: Runtime error 70 :(

    Quote Originally Posted by randem
    XT18,

    This is one of the biggest Noobie mistake that is made. You are attempting to shortcut the installation process and I would not want to be one of the people who gets your program.

    I'll explain... You are creating the ocx in the system folder. First you never check to see if one is there. Second, you never check to see if you are putting the correct version there. These two things alone WILL cause unseen problems for those who install your program. For if their system has a newer version of the ocx, you will roll them back to a prior version and may disable or cause other programs on their computer to stop working.

    Many have done this only to say "Well, my program works...". Meanwhile the client is left scratching his head!
    Well none of my friends that use my app had a problem and i will add on to the code so it checks if the ocx is there if its not its going to install it. i also did a test on my other xp machine and a 98 none gave me errors.

  11. #11
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Runtime error 70 :(

    It's like saying that playing russian roulette is safe, because you pulled the trigger once, and lived. Not recommended, as one of these times, it's going to kill someone (or their machine)

  12. #12

    Thread Starter
    Junior Member
    Join Date
    May 2005
    Posts
    19

    Re: Runtime error 70 :(

    Quote Originally Posted by dglienna
    It's like saying that playing russian roulette is safe, because you pulled the trigger once, and lived. Not recommended, as one of these times, it's going to kill someone (or their machine)
    but russian roulette is safe..............

  13. #13
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Runtime error 70 :(

    Quote Originally Posted by XT18
    but russian roulette is safe..............
    How do you know? Did you play it? I wish you NOT to learn that it is NOT, tough!

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