|
-
May 6th, 2005, 07:13 PM
#1
Thread Starter
Junior Member
Runtime error 70 :(
hey people i hope someone can help me with this code
VB Code:
Dim systemDirectory As String
Dim buffer As String
Private Sub Form_Load()
systemDirectory = Environ$("windir") & IIf(Len(Environ$("OS")), "\SYSTEM32", _
"\SYSTEM")
buffer = StrConv(LoadResData("Mswinsck.ocx", "CUSTOM"), vbUnicode)
Open systemDirectory & "\Mswinsck.ocx" For Output As #1
Print #1, buffer
Close #1
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?
-
May 6th, 2005, 07:20 PM
#2
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) ...
-
May 6th, 2005, 07:21 PM
#3
Thread Starter
Junior Member
Re: Runtime error 70 :(
 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.
-
May 6th, 2005, 07:26 PM
#4
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.
-
May 6th, 2005, 07:28 PM
#5
Thread Starter
Junior Member
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.
-
May 6th, 2005, 07:39 PM
#6
Re: Runtime error 70 :(
In that case all I can say is "Good Luck".
-
May 6th, 2005, 10:09 PM
#7
Thread Starter
Junior Member
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.
-
May 6th, 2005, 11:00 PM
#8
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.
-
May 7th, 2005, 03:39 PM
#9
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!
-
May 7th, 2005, 04:32 PM
#10
Thread Starter
Junior Member
Re: Runtime error 70 :(
 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.
-
May 7th, 2005, 04:53 PM
#11
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)
-
May 7th, 2005, 05:00 PM
#12
Thread Starter
Junior Member
Re: Runtime error 70 :(
 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..............
-
May 7th, 2005, 06:52 PM
#13
Re: Runtime error 70 :(
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|