Technical Help & Discussion > Website Design & Programming
Visual Basic
Hiatus:
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?
Dack:
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.
Hiatus:
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.
Dack:
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)
Hiatus:
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
Navigation
[0] Message Index
[#] Next page
Go to full version