Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Executing PC games from a VB 6 form

Posted on 2002-05-08
3
Medium Priority
?
141 Views
Last Modified: 2010-05-02
How can you execute newer PC games such as Return to Castle Wolfenstein and Medal of Honor from a Visual Basic 6 form? I'm writing a video game menu program that executes PC games with the click of a button.  It works with some games but not any that involve the use of a DOS type console at the start of the game.
The program works if you keep the .exe for the menu in the same folder as the .exe of the game. But since there is more than one game that uses startup DOS consoles I can't do that. The code that I'm using the execute the games so far is:

Dim X as Long
X = Shell("path to game", 3)

I'm hip on any ideas even if I have to write the code in a language other than VB.

0
Comment
Question by:padawan76
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
jgv earned 200 total points
ID: 6997198
Not sure what your problem is exactly but it sounds like setting the default directory to the game folder fixes the problem. You could give this a try:

ChDir "C:\Program Files\GameFolder"
Shell "TheGame.exe", 3
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6997467
In some cases, you may need to prefix it with "start":

Shell "Start myGame.exe"
0
 

Author Comment

by:padawan76
ID: 6997601
I added the ChDir line that you mentioned and my program worked on the first try!
You rock and thank you so much!!!!!!

 
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question