Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Problem in visual basic
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
dnmn8r
Master Cheater
Reputation: 0

Joined: 24 Oct 2007
Posts: 341

PostPosted: Wed Oct 31, 2007 3:55 am    Post subject: Problem in visual basic Reply with quote

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...



error.jpg
 Description:
 Filesize:  10.84 KB
 Viewed:  8021 Time(s)

error.jpg


Back to top
View user's profile Send private message
Itachi08
Expert Cheater
Reputation: 0

Joined: 03 Nov 2006
Posts: 101

PostPosted: Fri Nov 02, 2007 1:46 pm    Post subject: Reply with quote

u get this error after compiling the program?
_________________
Back to top
View user's profile Send private message
Labyrnth
Moderator
Reputation: 10

Joined: 28 Nov 2006
Posts: 6301

PostPosted: Fri Nov 02, 2007 1:51 pm    Post subject: Re: Problem in visual basic Reply with quote

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
View user's profile Send private message
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Fri Nov 02, 2007 2:19 pm    Post subject: Re: Problem in visual basic Reply with quote

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
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Fri Nov 02, 2007 4:05 pm    Post subject: Reply with quote

Then its time to read maple's path from the registery! Smile
Back to top
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Fri Nov 02, 2007 6:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Fri Nov 02, 2007 8:50 pm    Post subject: Reply with quote

I suggest you use CreateProcess instead of Shell.
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Fri Nov 02, 2007 10:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Sat Nov 03, 2007 1:08 am    Post subject: Reply with quote

it worked on my comp ><
_________________
Get kidnapped often.
Back to top
View user's profile Send private message
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Sat Nov 03, 2007 1:48 am    Post subject: Reply with quote

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
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Sat Nov 03, 2007 3:21 am    Post subject: Reply with quote

if a guy can even get a button name wrong... he deserves a spanking yeah?
_________________
Get kidnapped often.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8585
Location: 127.0.0.1

PostPosted: Sat Nov 03, 2007 4:56 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
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!!

PostPosted: Sat Nov 03, 2007 6:21 am    Post subject: Reply with quote

Just do it in Delphi, I did. THIS IS FOR DELPHI: First in the main form code make sure you include
Code:
ShellAPI
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
View user's profile Send private message
DarkShadowz
Grandmaster Cheater
Reputation: 0

Joined: 28 Sep 2007
Posts: 599
Location: Do you dare to know?

PostPosted: Sat Nov 03, 2007 7:29 am    Post subject: Re: Problem in visual basic Reply with quote

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...


This is too easy...

Code:
Private Sub PicMaple_Click()
Shell ("C:\Nexon\MapleStory\MapleStory.exe")
End Sub


You forgot some puncuation to the code Razz

_________________
Fate is an path no one knows...
Darkness are shadows in a mischievous way...
Destiny can achieve beyond its limits...
Hell is an path where there are no souls....

Take an path and think who you really are...
Back to top
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Sat Nov 03, 2007 7:33 am    Post subject: Re: Problem in visual basic Reply with quote

DarkShadowz 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...


This is too easy...

Code:
Private Sub PicMaple_Click()
Shell ("C:\Nexon\MapleStory\MapleStory.exe")
End Sub


You forgot some puncuation to the code Razz


what a surprise, starter's more right than you are.

_________________
Get kidnapped often.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites