473,466 Members | 1,331 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Events in C++ and work with IDE cdrom

Hi, I'm quite new in C++ programing and I want to ask, if I can handle
events in simple console-like program. For example I need one loop to
repeat until some key is pressed. Is it possible to make?

And then I would like to ask, if it is possible to read data from cdrom
over IDE. My intention is, to make a program for PSP (PlayStation
Portable), which could read data from cdrom connected to PSP (don't
know exactly how yet, but frirst of all I need to know, if the program
can be even written). So it would be some kind of file browser. There
is a program called usbhostfs and with this you can acces your HDD in
PC from PSP and do whatever you want with the data from PSP. But the
usbhostfs must be running on the PC, so the PSP's usbhost could somehow
connect to PC usbhostfs (something like connetcting client to server).
So my question is, if it is possible to read data from cdrom without
anything like "usbhostfs server"?

Jan 4 '07 #1
3 1696
Klapet wrote:
Hi, I'm quite new in C++ programing and I want to ask, if I can handle
events in simple console-like program. For example I need one loop to
repeat until some key is pressed. Is it possible to make?
bool done = false;
char ch;
print_menu();
while( !done && (cin >ch) )
{
switch( ch )
{
case '1': /* Do menu option 1 */ break;
case '2': /* Do menu option 2 */ break;
case '3': /* Do menu option 3 */ break;
case 'Q': done = true; break;
}
print_menu();
}

If you mean without pressing enter, there's no way to do it without
using platform-dependent extensions:

http://www.parashift.com/c++-faq-lit...html#faq-15.17
And then I would like to ask, if it is possible to read data from cdrom
over IDE. My intention is, to make a program for PSP (PlayStation
Portable), which could read data from cdrom connected to PSP (don't
know exactly how yet, but frirst of all I need to know, if the program
can be even written). So it would be some kind of file browser. There
is a program called usbhostfs and with this you can acces your HDD in
PC from PSP and do whatever you want with the data from PSP. But the
usbhostfs must be running on the PC, so the PSP's usbhost could somehow
connect to PC usbhostfs (something like connetcting client to server).
So my question is, if it is possible to read data from cdrom without
anything like "usbhostfs server"?
This is an OS-specific question. If you can mount something so you can
open it like a normal file, then sure. Otherwise, you can probably
still do it (there's not much that *can't* be done somehow in C++), but
you're beyond the bounds of standard C++ and thus this newsgroup. See
this FAQ for what is on-topic here and for some other newsgroups you
might consider:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

Jan 4 '07 #2
Thanks for the loop solution, but it's not working exactly the way I
would like to. Altough it gave me some ideas how to do that. But I'm
still unsuccessful.

I want to control winamp from command line, but the problem is, when I
start the playback, I need to print the current time on screen, but
when you press some key, it should stop (both the playback and the
counter). And there's the problem. When it is printing on screen, I
can't do anything (because of the running loop) and when I use your
solution, it's not counting.

So can you help me with this? Thanks in advance.

mlimber napsal:
Klapet wrote:
Hi, I'm quite new in C++ programing and I want to ask, if I can handle
events in simple console-like program. For example I need one loop to
repeat until some key is pressed. Is it possible to make?

bool done = false;
char ch;
print_menu();
while( !done && (cin >ch) )
{
switch( ch )
{
case '1': /* Do menu option 1 */ break;
case '2': /* Do menu option 2 */ break;
case '3': /* Do menu option 3 */ break;
case 'Q': done = true; break;
}
print_menu();
}

If you mean without pressing enter, there's no way to do it without
using platform-dependent extensions:

http://www.parashift.com/c++-faq-lit...html#faq-15.17
And then I would like to ask, if it is possible to read data from cdrom
over IDE. My intention is, to make a program for PSP (PlayStation
Portable), which could read data from cdrom connected to PSP (don't
know exactly how yet, but frirst of all I need to know, if the program
can be even written). So it would be some kind of file browser. There
is a program called usbhostfs and with this you can acces your HDD in
PC from PSP and do whatever you want with the data from PSP. But the
usbhostfs must be running on the PC, so the PSP's usbhost could somehow
connect to PC usbhostfs (something like connetcting client to server).
So my question is, if it is possible to read data from cdrom without
anything like "usbhostfs server"?

This is an OS-specific question. If you can mount something so you can
open it like a normal file, then sure. Otherwise, you can probably
still do it (there's not much that *can't* be done somehow in C++), but
you're beyond the bounds of standard C++ and thus this newsgroup. See
this FAQ for what is on-topic here and for some other newsgroups you
might consider:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M
Jan 6 '07 #3
Klapet wrote:
mlimber napsal:
Klapet wrote:
Hi, I'm quite new in C++ programing and I want to ask, if I can handle
events in simple console-like program. For example I need one loop to
repeat until some key is pressed. Is it possible to make?
bool done = false;
char ch;
print_menu();
while( !done && (cin >ch) )
{
switch( ch )
{
case '1': /* Do menu option 1 */ break;
case '2': /* Do menu option 2 */ break;
case '3': /* Do menu option 3 */ break;
case 'Q': done = true; break;
}
print_menu();
}

If you mean without pressing enter, there's no way to do it without
using platform-dependent extensions:

http://www.parashift.com/c++-faq-lit...html#faq-15.17

Thanks for the loop solution, but it's not working exactly the way I
would like to. Altough it gave me some ideas how to do that. But I'm
still unsuccessful.

I want to control winamp from command line, but the problem is, when I
start the playback, I need to print the current time on screen, but
when you press some key, it should stop (both the playback and the
counter). And there's the problem. When it is printing on screen, I
can't do anything (because of the running loop) and when I use your
solution, it's not counting.

So can you help me with this? Thanks in advance.
At the risk of redundancy:

"If you mean [receiving input] without pressing enter, there's no way
to do it without
using platform-dependent extensions:

http://www.parashift.com/c++-faq-lit...html#faq-15.17 "

Consequently, you'll need to ask in a group for your OS.

Cheers! --M

PS, Please don't top-post here. It's considered rude (cf.
http://parashift.com/c++-faq-lite/ho....html#faq-5.4).

Jan 8 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Silvio Golubović | last post by:
I have a problem with my CDROM. It reads only original cd.
2
by: enclume42 | last post by:
Hello, I am a pure Linux guy. I wrote a Java program that is going to be used by some Windows people, and I wish the startup of the program to be as simple as possible, namely to double-click on...
3
by: M | last post by:
I searched the FAQ for this NG and found no answers to my question... I'm writing an application in Java (I'm not a C programmer), however I need to be able to detect WHICH drive (d:\, e:\...
9
by: Paul Steele | last post by:
I am writing a C# app that needs to periodically poll for cdroms and usb storage device insertions. I've looked at the WMI functions but haven't found anything all that useful. The closest is...
2
by: Jigar Mehta | last post by:
Hye, Does anybody of you have any program or tool ready that can be used from inside my program that writes files to the CDROM (ATAPI interface) through writer??? Or is there any API or...
1
by: jujulal | last post by:
Hi all, How could i get CDROM Drive Letter using VB6.0 code. Where i run application that should get cdrom drive letter so, i need help.
3
by: Ognjen Bezanov | last post by:
Hello, I am trying to control a CD-ROM drive using python. The code I use is shown below.
1
by: Rakeshkg | last post by:
Hi, I'd like to be able to temporarily block access to the cdrom/usb store/floppy drives and then reactivate them after a period of time. I have looked at several code that allows notifications of...
1
by: =?Utf-8?B?UmFrZXNoIEd1cHRh?= | last post by:
Hi guys, I'm looking for a way to temporarily disable the removable storage in Windows. This is useful in a lab situation where the instructor conducts a test and the devices can be disabled and...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.