Sponsor for PC Pals Forum

Author Topic: Visual Basic  (Read 5029 times)

Offline Hiatus

  • Regular Member
  • **
  • Posts: 193
    • JoshSalverda.com
Visual Basic
« on: August 05, 2004, 21:56 »
Yello, I'm having trouble with some coding in VB.

I'm trying to make a program start (Age of Empires II) and I can't figure out how to do it. I tried:

Shell "C:\Program Files\Microsoft Games\Age of Empires II\empires2.exe" (which is where it is located)

It came up with one error as "AGE.DLL could not be initiated" or something and then another message dealing with DirectDraw.

If you click on the shortcut to AOE it works fine. Does it have something to do with the "Shell" command? If so, how do I fix this?
l33t h@x0r... sort of...

Offline Dack

  • Established Member
  • ****
  • Posts: 831
Re:Visual Basic
« Reply #1 on: August 05, 2004, 23:36 »
You probably need to change to the directory where the program is running. If you look at the shortcut you will see the "start in" field.

Try compiling your program and then moving it to the AOE directory before running it. If it then works you have found the problem.

The shell command just executes the application in whatever directory the calling application is running.

Easiest solution is to change to the directory "C:\Program Files\Microsoft Games\Age of Empires II\" and then shell execute the empires.exe.
hey promised the earth! Then delivered mud.
Technically it did meet the spec.

Offline Hiatus

  • Regular Member
  • **
  • Posts: 193
    • JoshSalverda.com
Re:Visual Basic
« Reply #2 on: August 05, 2004, 23:49 »
Ok, well let me start from the beginning...I dunno if you know what I mean or not...

I made a program that is a toolbox where you can just click on the "icon" and runs the program you clicked. (It works on Windows Me so far and maybe 95/98 if neone wants it, lol :)) Icons/Programs include the control panel, games, system tools, etc. Most of them use the "Shell" command.

The only problem I had was with showing "My Computer" (which I still haven't figured out...yet) and AOE.

What you're suggesting is that I move my program to the AOE directory and it will work...? I can try that, but in the mean time...could it also be because I don't have to use the disk?  ::) Also, if I move the program to the directory will that affect any of my other shell commands?

I dunno, thanx for replying tho, I'll try what u suggested after my brother gets off that comp.
l33t h@x0r... sort of...

Offline Dack

  • Established Member
  • ****
  • Posts: 831
Re:Visual Basic
« Reply #3 on: August 05, 2004, 23:55 »
Isn't the shell command "explorer.exe" for the "my computer" part?

You'll probably find the others have run because they will have their DLL's in the system directorys or somewhere else in the path (open up a command window and type PATH to see where Windows searches for files)
hey promised the earth! Then delivered mud.
Technically it did meet the spec.

Offline Hiatus

  • Regular Member
  • **
  • Posts: 193
    • JoshSalverda.com
Re:Visual Basic
« Reply #4 on: August 06, 2004, 00:33 »
Alright! My brother finally got off the comp so I could work on it. I moved the file to the AOE directory and guess what...IT WORKS!  :D

Thanks for your help, I never would have thought of moving it there.

Also, for the "my computer" thing, I don't think you can access it because its a folder. (There's probably a way, but I don't know it...) I just used Shell "Explorer = C:\". It works just as well if not better.

Once again, thanx for ur help!  ;D ;D
l33t h@x0r... sort of...

Offline Dack

  • Established Member
  • ****
  • Posts: 831
Re:Visual Basic
« Reply #5 on: August 06, 2004, 00:42 »
Try shell "Explorer /E" and see what happens ;)
hey promised the earth! Then delivered mud.
Technically it did meet the spec.

Offline Hiatus

  • Regular Member
  • **
  • Posts: 193
    • JoshSalverda.com
Re:Visual Basic
« Reply #6 on: August 06, 2004, 19:45 »
Alrighty, now, is there any way I can make the icon show up in the taskbar (bottom right, to the left of the time)?

That would be a bonus  :)
l33t h@x0r... sort of...

Offline Dack

  • Established Member
  • ****
  • Posts: 831
Re:Visual Basic
« Reply #7 on: August 06, 2004, 22:33 »
In real programming languages it's relatively easy ;) - You just attach to the systray.

Here's a link to show you how to do it in visual basic.
http://www.vbaccelerator.com/home/VB/Code/Libraries/Shell_Projects/SysTray_-_The_Easy_Way/article.asp
hey promised the earth! Then delivered mud.
Technically it did meet the spec.

Offline Hiatus

  • Regular Member
  • **
  • Posts: 193
    • JoshSalverda.com
Re:Visual Basic
« Reply #8 on: August 07, 2004, 07:24 »
What, visual basic isn't real programming???

 ;D :P
l33t h@x0r... sort of...

Offline Hiatus

  • Regular Member
  • **
  • Posts: 193
    • JoshSalverda.com
Visual Basic...again
« Reply #9 on: September 03, 2004, 16:55 »
Hey, I know there's a way to just allow numbers to be entered into a textbox...but I can't find the code! Does anyone know it?

Also, how do I get the numbers to be entered in from right to left?

Thanx, appreciate any help.

l33t h@x0r... sort of...

Offline Sandra

  • Ultimate Member
  • *******
  • Posts: 12155
Re:Visual Basic...again
« Reply #10 on: September 03, 2004, 16:58 »
Pass, sorry  :(

Adept

  • Guest
Re:Visual Basic...again
« Reply #11 on: September 03, 2004, 20:12 »
You could start with a numeric mask restricting input to numeric characters. IIRC you use the # character to denote a numeric.

Offline Hiatus

  • Regular Member
  • **
  • Posts: 193
    • JoshSalverda.com
Re:Visual Basic...again
« Reply #12 on: September 04, 2004, 00:28 »
Quote

You could start with a numeric mask restricting input to numeric characters. IIRC you use the # character to denote a numeric.


 :o
Ah! I don't think I'm not that advanced yet, lol

Could you maybe explain it in simpler terms...?
l33t h@x0r... sort of...

Offline Hiatus

  • Regular Member
  • **
  • Posts: 193
    • JoshSalverda.com
Re:Visual Basic...again
« Reply #13 on: September 04, 2004, 01:32 »
nvm...I google'd it and found out what a masked box is. Interesting...this might work, thanx for the help.

Any idea(s) on how to make the text input from right to left?
I've tried making the "RightToLeft" box "True", but it doesn't work...
l33t h@x0r... sort of...

Adept

  • Guest
Re:Visual Basic...again
« Reply #14 on: September 04, 2004, 08:04 »
I think there is a "Text Align" property which can be set to "Right".

I'm not ceratain as I don't have a copy of VB on my PC at home any more.



Show unread posts since last visit.
Sponsor for PC Pals Forum