Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

Search: 

  Tutorial: C and Cpp Programming in C and Cpp CD Drive Control Tutorial

Enumerates all CD-ROM drives and allows them to be opened and closed at the touch of a button.

Tutorial Details:

Geekpedia Programming tutorial: CD Drive Control

I got bored the other day and was looking through the Platform SDK Documentation and came across the DeviceIoControl API function. I came upon the IOCTL_STORAGE_EJECT_MEDIA control code and it got my interest. I decided to make a small application that made use of DeviceIoControl and the IOCTL_STORAGE_EJECT_MEDIA and IOCTL_STORAGE_LOAD_MEDIA control codes.

This project was done with MFC in Microsoft Visual C++ 6.0 and is compatable with Windows NT/2000/XP.

Before getting into the nitty gritty of how to open and close a CD-ROM drive (which isn't all that hard actually) I'm going to show you how to enumerate all CD-ROM devices on the system and display them. This part is really only applicable to this program or anything that will impliment this in the exact same way (but it's a good lesson in how to use CListCtrl).

First create a new MFCApp Wizard (exe) project. For the purposes of this project we will be using a a dialog based application without any context based help or any other extra stuff.

Open up the main dialog and add a List Control to the dialog. Right click the control and click 'Properties'. Click the 'Styles' tab and check the select the 'List' option in the 'View' drop down list and close the 'Properties' window. Now right click the List Control again and select 'Class Wizard'.

In the window that appears click the 'Member Variables' tab and select the Control ID for the List Control you just created and then click the 'Add Variable' button. Enter the name of the variable and click 'OK'. You have now just created a CListCtrl which is mapped to the List Control you placed in the Dialog.


 

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
C and Cpp Programming in C and Cpp CD Drive Control Tutorial

View Tutorial:
C and Cpp Programming in C and Cpp CD Drive Control Tutorial

Related Tutorials:

Displaying 1 - 50 of about 3481 Related Tutorials.

C/C++ Programming Books
C/C++ Programming Books C/C++ Programming... topics for Visual C++ 6 programming. This book skips the beginning level material... and The Objective C Language Object-oriented programming, like most
 
Objective C Tutorial
Objective C Tutorial,Objective C Tutorials Objective C Tutorial        ...;      In this Objective C Tutorial we
 
C and C++ books-page8
tutorials that introduce you to ODBC API programming in C. Each tutorial... how to write software in C. It is written primarily as a tutorial for beginners... C and C++ books-page8 C and C++ books-page8
 
C and C++ books-page3
;       The C Language Tutorial... as a tutorial on the language, and aims at getting a reader new to C started as quickly... at the standard C programming language. In no way does this guide attempt to teach
 
Objective C
Objective C, Objective C programming language, Objective C Language... Objective C Tutorial About the Objective C tutorial presented here. In this complete guide of Objective C you will be learning the programming concepts
 
C and C++ books-page11
-based programming, generic programming, and functional programming. C...; Operator overloading of C++ Programm Object-oriented (OO) programming... C and C++ books-page11 C and C++ books-page11
 
Java vs. C
object-oriented programming (OOP). It's possible to write in Java in a C... programming, but in the cases where you do, there are statements to control... for Object Oriented Programming (OOP). Java classes are like C++ class, which
 
C and C++ books
API programming in C. Each tutorial contains C ODBC code samples...; Page 10 As a programming language, C is rather like Pascal... to give you a general overview of the C programming language. Although much
 
EasyEclipse for C and C++
Eclipse Plugin-Language EasyEclipse for C and C...;   EasyEclipse for C and C++ is all you need to start developing C and C++ code with Eclipse. There are currently 28 comments
 
C and C++ books-page1
of this tutorial is to give a good understanding of the programming language C..., loops and arrays, object-oriented programming, templates, and creating C... and the concepts involved with programming C++. You'll find the numerous examples
 
C and C++ books-page4
;     The UNIX System call in c programming In order...; The C tutorial-Brackets and Braces Some of the characters C uses.... Even though C is one of the most used programming-languages
 
C and C++ books
API programming in C. Each tutorial contains C ODBC code samples...; Page 10 As a programming language, C is rather like Pascal... to give you a general overview of the C programming language. Although much
 
Ask C/C++ Questions online
;    C and C++ are different programming... purpose programming language that can run on most of the platforms. C is used... Bell Laboratory while C++ is a popular object oriented programming language
 
C and C++ books-page2
;       The C Programming Language ... C and C++ books-page2 C and C++ books-page2...; The Advice & Warning for C Tutorials  C and C
 
Open Source c++
;       Open Source C++ GUI Programming Qt3.... The CD also provides Qt and Borland C++ for Windows, Qt for Unix, and Qt for Mac OS... Open Source C++ Open Source c++ Open Source C
 
C Structure example
C Structure example C Structure example...;  This section illustrates you the concept of structure in C. Structures in C defines the group of contiguous (adjacent) fields, such as records
 
Objective C Introduction
Objective C programming language. Objective C is very old programming language...; Objective C is simple and very intuitive programming language that makes the Object Oriented programming sample and sophisticated. Objective C is simple and small
 
Cantata++ - for testing C and C++ software
Coverage Analysis (C/C++, Java) Stubbing and Wrapping: to simulate and control... Cantata++ - for testing C and C++ software Cantata++ - for testing C and C++ software    
 
Why Objective C?
; In this section we will learn about the importance of Objective C and "Why Objective C?" is used as programming language to develop... Why Objective C? Why Objective C
 
Objective C on Windows
. GNUset is objective c compiler for windows, that we will be using in our tutorial... Objective C on Windows, Objective C  Windows, Objective C Windows Compiler, Objective C Compiler for Windows Objective C
 
Java Review: Control Flow
Java Review: Control Flow Java Review: Control Flow Java uses the dominant imperative control flow paradigm. Other paradigms are declarative programming and data flow. Structured Programming control
 
Objective-C keywords
Objective-C keywords, Objective C programming language, Objective C Language Objective-C keywords  ... in this section we will know about the keywords used in objective-C language
 
Objective C Constructors
Objective C Constructors, Objective C programming language, Objective C Language Objective C Constructors...; Objective-C enables user to define constructor with the help of self and super
 
C# Programming Books
C# Programming Books C# Programming Books... Started C# is pronounced as "C sharp". It is a new programming language.... It is the fountainhead of all knowledge. Incidentally, the C programming language also calls Main
 
Beginners Java Tutorial
; This tutorial will introduce you with the Java Programming... factorial of any given number This Java programming tutorial will teach you...;   Prime Number in Java This Java programming tutorial, we
 
Compiling Objective C
the following command.     $ cd c:/objectiveC To compile program... Compiling Objective C Compiling Objective C...;   In this section we will show you how to compile Objective C
 
C++ Compiler for Linux
Eclipse Plugin-Language C++ Compiler for Linux...;   Intel? C++ Compiler Professional Edition offers the best..., OpenMP*, data prefetching, and loop unrolling, along with highly optimized C
 
Java - Continue statement in Java
; Continue: The continue statement is used in many programming languages such as C, C++, java etc. Sometimes we do not need to execute some statements under... of the control and control returns to the loop without executing the statements written
 
Control Statments
over the control statements in C++. You must be familiar with the if-then statements in C++. The if-then statement is the most simpler form of control flow... Controlling your program Control Statments
 
Exception handling in Objective-C
Exception handling in Objective-C, Objective C programming language, Objective C Language Exception handling in Objective-C...;   Objective-C provide exception handling to handle
 
Mysql Loader Control File
Mysql Loader Control File Mysql Loader Control...;    Mysql Loader Control File is the mean to import a data to a plain text from Mysql database. Understand with Example The Tutorial
 
Mysql Loader Control File
Mysql Loader Control File Mysql Loader Control File...;  Mysql Loader Control File is the mean to import a data to a plain text from Mysql database. Understand with Example The Tutorial illustrate
 
JDBC Drive For Mysql
Jdbc Drive For Mysql JDBC Drive For Mysql...; In this Tutorial we want to describe you a code that help you in understanding JDBC Drive for Mysql. The code include a class JdbDriveForMysql,Inside the main method
 
Objective-C Inheritance
Objective-C Inheritance, Objective C programming language, Objective C Language Objective-C Inheritance...; Objective-C enables programmer to inherit common methods and properties
 
Dynamic Types in Objective-C
Objective C, Objective C programming language, Objective C Language Dynamic Types in Objective-C  ...; Objective-C provides many methods to work with dynamic types. With these methods
 
Java programming
is an object-oriented language, and this is very similar to C++. Java Programming... Java Programming,Introduction to Java Programming,Online Java Programming Help Java programming    
 
Beginners Java Tutorial
; This tutorial will introduce you with the Java Programming... factorial of any given number This Java programming tutorial will teach you...;   Prime Number in Java This Java programming tutorial, we
 
C Tutorials
C Tutorials C Tutorials...; C Array copy example The example below contains two...;        C Array Declaration
 
C break continue example
C break continue example C break continue... statement with continue statement in C. The continue statement provides a convenient way to force an immediate jump to the loop control statement. The break
 
Using "Case" control in JRuby
Using "Case" control in JRuby  Using "Case" control in JRuby    ...; In the previous section of JRuby tutorial you have learned to use for-loop in JRuby. Now we
 
C Break with Switch statement
C Break with Switch statement C Break... break statement with Switch-Case in C. The switch case statements allows to control complex conditional and branching operations. It include any number of case
 
OOP Tutorial [first draft]
the terms accessor / mutator, which come from C++. Programming... Java: OOP Tutorial Java: OOP Tutorial [first draft] Table of contents Introduction
 
JSP JSTL c:if tag
JSP JSTL c:if tag JSP JSTL c:if tag... in jsp.  The c:if tag is used for a decision need, to be made in the page.../core" prefix="c" %> <html> <body> <form method="post">Guess
 
with No Body
<c:If> with No Body <c:If> with No Body... or not, then in these condition the <c:if> tag is used. The problem with <c:if>... value. The <c:if> tag is not for applicable if we want to do one thing
 
For C++ programmers
Java: For C++ programmers Java NotesFor C++ programmers Java inherited many features from C... always start with an upper case character, Methods (called functions in C
 
Linux Books
is to explain the use of the GNU C and C++ compilers, gcc and g++. After reading... the C or C++ languages themselves, since this material can be found in many other... sections of the chapters "Compiling a C program", "Using the preprocessor
 
J2ME Video Control Example
J2ME Video Control Example J2ME Video Control Example...;   This Application explain the use of Video Control. The work of video control is used to controls the display of video. In this example we want
 
C Structure Pointer
C Structure Pointer C Structure Pointer            ...;  This section illustrates you the concept of Structure Pointer in C
 
Objective-c memory management: retain and release
Objective-c memory management: retain and release, Objective C programming language, Objective C Language Objective-c memory... how to manage memory with language Objective-C. Programmer can allocate memory
 
We are providing Knoppix 3.6 Live Linux CD's
, and at least 82 MB for graphic mode with KDE. Bootable CD-ROM Drive SVGA..., put the CD in the drive, and power up the computer. If your computer doesn't... to use the various office products) bootable CD-ROM drive, or a boot
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.