To me you have not even shown an effort. If you notice this board helps other coders to become better codes - this is only going to take place when one posts up his / her code and let us see what they understand. Such demands like these won't help anyone nor yourself to become a better coder! I'm not sure that you even know the basics never mind playing around with the API interface!
>Can you tell me how to do it now?
Sure, go to msdn.microsoft.com and read. Normally I would give you some code, but I find your "gimme gimme" tone annoying.
Sorry for my bad attidute. Just so you know, this wasn't a class assignment(I'm not even in a programming class). I was actually trying to make a CD player.
Thanks for telling me to look at msdn.microsoft.com.
AcidBurn, I actually have absolutely no idea how to do this. I just started learning C++ and I'm still a beginner.
Then I strongly suggest you start from the beginning, either by taking a programming course, or attempt to get a book and work through! Don't expect to find yourself playing with that sort of stuff soon! I've had almost 1 yer doing C and C++...and we havent even started that yet! (Next year) ..........
Interprocess communication can help improve the functionality of your program.
// Command line approach #include <stdlib.h> ... // To open system("wineject -open d:"); // Note: d: can be any letter you pick. // To close system("wineject -close d:"); // Note: d: can be any letter you pick. ----------------------------------------------------------- // Windows Approach #include <windows.h> ... //To Open WinExec("wineject -open d:", SW_HIDE); //To close WinExec("wineject -close d:", SW_HIDE); ------------------------------------------------------------ Hope this helps, you can get wineject from: http://www.bountyx.net/files/wineject.exe
The above assumes that wineject.exe is in the same location as your program's exe. If you wish to use configurable drive letters with the commands you must get rid of the "d:" part and concatenate your own drive letter to the string.
The IMAPI interface through the windows api will make things a breeze =) . Documentation and examples available at MSDN.com .
Now lets take it a step further. How does communication with the CDROM work? Well it is true that the API may handle this a little differently as you go from platform to platform, but layers exist to compensate for procedures that are not explicitly available in the API.
Such layers are ASPI layers and IMAPI layers. In fact, Nero provides a free aspi layer. WinAspi.dll is also an option (but only for windows). For more information about a [almost] platform independent approach to communicating with the CDROM drives, see http://cdrecord.berlios.de/old/private/cdrecord.html
CDRECORD implements an ASPI layer to provide a common interface to interact with CDROM drives. Not only can you eject a cd, you can write data!
thank you very much bountyX, that REALLY helped. on the program u made, wineject, how do you put the icon on the bottom of the screen and create the options when u right click?
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.