![]() |
|
|
#1 |
![]() Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts
|
c++ code help
is it possible in c++ a function that when called will start any windows programme i choose? like windows media player for example? I want to make some very basic form a voice recognition software i have an idea on how to get the audio bit to recognise what im saying but i have no idea to to make it open the programme i say.
stephen
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols Where's all the talent gone? |
|
|
|
|
|
#2 |
|
Senior Moderator
Join Date: Jul 2006
Location: Milwaukee, WI.
Posts: 31,962 (12.77/day)
Thanks: 2,793
Thanked 12,322 Times in 7,833 Posts
|
Sure it's possible, do you have any C++ knowledge? If not, it's probably best to get some first. Lots of links here: http://forums.techpowerup.com/showthread.php?t=31132
C++ tutorials: http://www.cplusplus.com/doc/tutorial/ Perhaps you may find something that works better for you than C++. I'm still skimming though all the links and I'm starting to learn. |
|
|
|
| The Following User Says Thank You to erocker For This Useful Post: |
|
|
#3 | ||
![]() Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts
|
Quote:
i think i found out a way to be onest, it was allot easier then i expected. Quote:
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols Where's all the talent gone? |
||
|
|
|
|
|
#4 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,133 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
I'm a little rusty on my C++, but the ShellExecute() function may do what you need.
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
|
|
|
|
|
|
#5 |
|
Senior Moderator
Join Date: Jul 2006
Location: Milwaukee, WI.
Posts: 31,962 (12.77/day)
Thanks: 2,793
Thanked 12,322 Times in 7,833 Posts
|
Heh, you're way further ahead than me. I just started reading. I haven't "coded" anything since my Commodore 64. I figure I have a couple good application ideas for Droid/iphone and I might as well start doing something about them.
|
|
|
|
|
|
#6 | |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,133 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
Quote:
![]() I used to do a lot in C/C++, but since I've been doing a lot of Database stuff, C# seems to a good fit. I was dabbling in F#, but can't find a real need for it. Maybe it's time to dig back in so I can be of more help here. Seems a lot of people, especially in school, need C++ assistance.
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
|
|
|
|
|
|
|
#7 |
![]() Join Date: Feb 2008
Location: Nebraska, USA
Posts: 327 (0.17/day)
Thanks: 61
Thanked 18 Times in 18 Posts
|
Yeah, whenever you code your function and you want to start Windows Media Player, all you have to do it:
void startMediaPlayer() // This function header is completely randomly created, it can say anything { system("start wmplayer.exe"); } Remember, you can start any executable, just go to task manager to find out what the official executable name is so that you can call system("blah.exe") |
|
|
|
| The Following User Says Thank You to dcf-joe For This Useful Post: |
|
|
#8 | |
![]() Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts
|
Quote:
edit no it doean't lock up just tested cheers that will work perfect for what i need ![]() All i need to do next it work out how to use a mic a record a bit of audio good job im doing that soon at uni
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols Where's all the talent gone? |
|
|
|
|
|
|
#9 |
![]() Join Date: Feb 2008
Location: Nebraska, USA
Posts: 327 (0.17/day)
Thanks: 61
Thanked 18 Times in 18 Posts
|
Thank you for the thanks, and you are welcome. I am kind of a beginner myself, but I have had to use that system call before and it works perfectly
![]() No, you do not have to provide system paths, you JUST have to know the executable name, and if you are using a 64-bit operating system, you DO NOT have to provide the *32 flag at the end of the executable name, the operating system already knows
|
|
|
|
|
|
#10 |
|
Hardcore Monkey Moderator
Join Date: Feb 2007
Location: Cheeseland (Wisconsin, USA)
Posts: 12,133 (5.27/day)
Thanks: 591
Thanked 5,494 Times in 2,938 Posts
|
I think to launch an executable without the full path, the directory name has to be in the "Path" enviroment variable.
__________________
Cloud (noun, singular): A dynamic arrangement of multiple potential single points of failure, with a user at one end and their data at the other. Get more tech news on a wide variety of topics at NextPowerUp
|
|
|
|
| The Following User Says Thank You to Kreij For This Useful Post: |
|
|
#11 | |
![]() Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts
|
Quote:
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols Where's all the talent gone? |
|
|
|
|
|
|
#12 |
![]() Join Date: Feb 2008
Location: Nebraska, USA
Posts: 327 (0.17/day)
Thanks: 61
Thanked 18 Times in 18 Posts
|
Does not matter if 32 or 64 bit. The operating system knows what it is when it runs the executable.
I am just saying, if you are running a 64-bit operating system and you are trying to run a 32-bit executable, you do not have to include that flag at the end, because the operating system knows what it is before it runs it. As for trying to run a 64-bit executable in a 32-bit environment, if I recall correctly, Microsoft released an update a few years back to allow that to work, somehow I am sure it would work the same way though.
|
|
|
|
|
|
#13 | |
![]() Join Date: May 2008
Location: Blackpool, uk
Posts: 2,775 (1.52/day)
Thanks: 780
Thanked 282 Times in 237 Posts
|
Quote:
__________________
Womack & Womack : Duran Duran : The Specials : Madness : Lionel Richie : Indeep : Michael Jackson : Taylor Dayne : Frank Sinatra : The Gap Band : Wild Cherry : Fleetwood Mack : Blondie : Bee Gees : Wham : Snap : MC Hammer : Bill Withers : Louis Armstrong : Percy Mayfield : Ray Charles : Ben E. King : Bob Marley : The Temptations : The Marvelettes : Elvis Presley : Chic : Sister Sledge : The Clash : The Ramones : The Sex Pistols Where's all the talent gone? |
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help simplifying code | ste2425 | Programming & Webmastering | 21 | Feb 15, 2010 08:52 PM |
| Ati Code 43 Error Help | domy85 | General Software | 1 | Mar 18, 2009 08:58 PM |
| DFI Code 26.. Need help | ShadowFold | Motherboards & Memory | 12 | Jan 2, 2009 08:34 PM |
| AGESA code | WojtasRed | Motherboards & Memory | 4 | Aug 24, 2008 05:07 PM |