Quick Programming Help

Thread Starter

Aamer04

Joined Aug 19, 2010
4
While my program is running I want to type in the characters "n" and "p" to open a notepad file thats in the c drive.

I know this is easy but I forgot how to do it. Can someone help me out? The software I'm using isn't visual basic but its based off of it and is very similar.
 

Thread Starter

Aamer04

Joined Aug 19, 2010
4
Forgot to mention, everything is very similar if not the same except for the fact that the datatype "char" is not available.

Any tips on you would do this in C/C++/VB without using Char....I don't need the "n" and "p" specifically, any keyboard input would work
 

someonesdad

Joined Jul 7, 2009
1,583
I don't use VB, so I can't help you there. In C you'd probably use something like getchar and C++ could use cin. Consult any basic programming text for the details. Once you've gotten the requisite character, you'll probably want to make a call to a Windows function like ShellExecute to help you open notepad.

Note: if you're programming in a GUI environment, things may not be this simple, as sometimes a console-type device isn't available and you need to use the tools in the GUI framework.
 

Thread Starter

Aamer04

Joined Aug 19, 2010
4
hey thanks for the tips! I'm not sure why but I can't open the notepad document I want using shell...weird because I used shell to open something simple..like the calculator and it worked fine. Could it be something with permissions on my pc user account??
 
Top