PC Pals Forum

Technical Help & Discussion => Website Design & Programming => Topic started by: Hiatus on August 05, 2004, 21:56

Title: Visual Basic
Post by: Hiatus 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?
Title: Re:Visual Basic
Post by: Dack 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.
Title: Re:Visual Basic
Post by: Hiatus 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.
Title: Re:Visual Basic
Post by: Dack 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)
Title: Re:Visual Basic
Post by: Hiatus 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
Title: Re:Visual Basic
Post by: Dack on August 06, 2004, 00:42
Try shell "Explorer /E" and see what happens ;)
Title: Re:Visual Basic
Post by: Hiatus 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  :)
Title: Re:Visual Basic
Post by: Dack 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 (http://www.vbaccelerator.com/home/VB/Code/Libraries/Shell_Projects/SysTray_-_The_Easy_Way/article.asp)
Title: Re:Visual Basic
Post by: Hiatus on August 07, 2004, 07:24
What, visual basic isn't real programming???

 ;D :P
Title: Visual Basic...again
Post by: Hiatus 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.

Title: Re:Visual Basic...again
Post by: Sandra on September 03, 2004, 16:58
Pass, sorry  :(
Title: Re:Visual Basic...again
Post by: Adept 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.
Title: Re:Visual Basic...again
Post by: Hiatus 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...?
Title: Re:Visual Basic...again
Post by: Hiatus 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...
Title: Re:Visual Basic...again
Post by: Adept 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.

Title: Re:Visual Basic...again
Post by: joudi on October 04, 2004, 21:42

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


Sorry to arrive too late, maybe. I visit this section rarely. I didn't know that I could be, somehow' useful.

Well, As my original language is written from right to left, I can suggest that way, hopping it works with you too.

press the CTRL+Shift (Upper/lower case) (of the right side of the keyboard) simultaneously. That must move the cursor to the right side of the page.

If you like to get it back (from left to right), do the same, CTRL+Shift (of the left side of the motherboard.)
Title: Re:Visual Basic...again
Post by: Sandra on October 04, 2004, 22:30
It doesnt work on mine Joudi.
Maybe you have to have the extra languages with, for we in the west, the right to left language option installed for it to work  ???
Title: Re:Visual Basic...again
Post by: joudi on October 04, 2004, 23:28
Well Sandra, I'm telling that, which must be applied on "Word". Isn't that what he needs?

If that's what he needs, and if it doesn't work, then a visit to the "Conrol Panel" is requiered for intalling in the "Regional Options" the languages written from right to left.