View previous topic :: View next topic |
Author |
Message |
dnmn8r Master Cheater
Reputation: 0
Joined: 24 Oct 2007 Posts: 341
|
Posted: Wed Oct 31, 2007 3:55 am Post subject: Problem in visual basic |
|
|
hey guys. Im trying to make a little program in visual basic, just so i can have the stuff i commonly use in one little box. The code ive got to open maple is Code: | Private Sub PicMaple_Click()
'This line is to open MapleStory
Shell "C:\Nexon\MapleStory\MapleStory.exe"
End Sub |
the problem is i get an error message (see picture) anyone know why? please dont go off at me, i only started learning Vb like 2 or 3 days ago...
Description: |
|
Filesize: |
10.84 KB |
Viewed: |
8021 Time(s) |

|
|
|
Back to top |
|
 |
Itachi08 Expert Cheater
Reputation: 0
Joined: 03 Nov 2006 Posts: 101
|
Posted: Fri Nov 02, 2007 1:46 pm Post subject: |
|
|
u get this error after compiling the program?
_________________
|
|
Back to top |
|
 |
Labyrnth Moderator
Reputation: 10
Joined: 28 Nov 2006 Posts: 6301
|
Posted: Fri Nov 02, 2007 1:51 pm Post subject: Re: Problem in visual basic |
|
|
dnmn8r wrote: | hey guys. Im trying to make a little program in visual basic, just so i can have the stuff i commonly use in one little box. The code ive got to open maple is Code: | Private Sub PicMaple_Click()
'This line is to open MapleStory
Shell "C:\Nexon\MapleStory\MapleStory.exe"
End Sub |
the problem is i get an error message (see picture) anyone know why? please dont go off at me, i only started learning Vb like 2 or 3 days ago... |
Possibly the name of your control doesn't have this name.
"PicMaple"
|
|
Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Fri Nov 02, 2007 2:19 pm Post subject: Re: Problem in visual basic |
|
|
Labyrnth wrote: | dnmn8r wrote: | hey guys. Im trying to make a little program in visual basic, just so i can have the stuff i commonly use in one little box. The code ive got to open maple is Code: | Private Sub PicMaple_Click()
'This line is to open MapleStory
Shell "C:\Nexon\MapleStory\MapleStory.exe"
End Sub |
the problem is i get an error message (see picture) anyone know why? please dont go off at me, i only started learning Vb like 2 or 3 days ago... |
Possibly the name of your control doesn't have this name.
"PicMaple" |
I was going to says the same ^^
Also, could be that you MapleStory is not on that location. In case it's, then the button name. As for the code, is ok for what you're looking for.
_________________
|
|
Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Nov 02, 2007 4:05 pm Post subject: |
|
|
Then its time to read maple's path from the registery!
|
|
Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Fri Nov 02, 2007 6:06 pm Post subject: |
|
|
Private Sub (the right control name)_Click()
On Error Resume Next
Shell (you path), vbNormalFocus
End Sub
get your path using recommended methods.
_________________
Get kidnapped often. |
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
Posted: Fri Nov 02, 2007 8:50 pm Post subject: |
|
|
I suggest you use CreateProcess instead of Shell.
_________________
- Retired. |
|
Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Fri Nov 02, 2007 10:32 pm Post subject: |
|
|
blland wrote: | Private Sub (the right control name)_Click()
On Error Resume Next
Shell (you path), vbNormalFocus
End Sub
get your path using recommended methods. |
That will do nothing..
So, the error will stay and then.. nothing.
_________________
|
|
Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Sat Nov 03, 2007 1:08 am Post subject: |
|
|
it worked on my comp ><
_________________
Get kidnapped often. |
|
Back to top |
|
 |
XxOsirisxX Grandmaster Cheater Supreme
Reputation: 0
Joined: 30 Oct 2006 Posts: 1597
|
Posted: Sat Nov 03, 2007 1:48 am Post subject: |
|
|
blland wrote: | it worked on my comp >< |
I means, yea, On Error Goto / Resume is a nice command to make a program "UnCrash-Able" but, in this case.. if the button name is wrong or if the location is not right, then the button will just do nothing.
_________________
|
|
Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
Posted: Sat Nov 03, 2007 3:21 am Post subject: |
|
|
if a guy can even get a button name wrong... he deserves a spanking yeah?
_________________
Get kidnapped often. |
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8585 Location: 127.0.0.1
|
Posted: Sat Nov 03, 2007 4:56 am Post subject: |
|
|
XxOsirisxX wrote: | blland wrote: | Private Sub (the right control name)_Click()
On Error Resume Next
Shell (you path), vbNormalFocus
End Sub
get your path using recommended methods. |
That will do nothing..
So, the error will stay and then.. nothing. |
His code is fine, you just have to edit it accordingly for your program like it says.
For example, Command1 will be used to open Notepad. (Hard coded, I do not suggest you do it like this as not everyone uses C:\ as their main system drive.)
Code: | Private Sub Command1_Click()
Shell "C:\Windows\Notepad.exe", vbNormalFocus
End Sub |
I also suggest you don't use shell since you have little to no control over the application you launch if you wish to be able to control it later on with ease. Instead, you should use CreateProcess.
_________________
- Retired. |
|
Back to top |
|
 |
Acim Grandmaster Cheater Supreme
Reputation: 0
Joined: 04 Jun 2007 Posts: 1948 Location: If anyone has a GMS DK and they don't need it I'll have it!!
|
Posted: Sat Nov 03, 2007 6:21 am Post subject: |
|
|
Just do it in Delphi, I did. THIS IS FOR DELPHI: First in the main form code make sure you include Then you can execute stuff like this: Code: | ShellExecute(Handle, 'open',C:\Nexon\MapleStory\MapleStory.exe', nil, nil, SW_SHOWNORMAL) ; |
when the button is clicked.[/code]
_________________
I'm alive and well, but I quit CEF for a while. Legitly playing since Novemberish 07. Starting hacking October 06. |
|
Back to top |
|
 |
DarkShadowz Grandmaster Cheater
Reputation: 0
Joined: 28 Sep 2007 Posts: 599 Location: Do you dare to know?
|
|
Back to top |
|
 |
Trow Grandmaster Cheater
Reputation: 2
Joined: 17 Aug 2006 Posts: 957
|
|
Back to top |
|
 |
|