Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Find the CD Drive Letter

Posted on 1998-05-04
5
Medium Priority
?
388 Views
Last Modified: 2008-02-01
 Is there a function that I can call to find out the drive letter of the CD-ROM.  I to distribute an application on CD-ROM, but I don't want people to be able to copy the CD-ROM to the hard drive and pass the CD-ROM to someone else.
  Therefore I want to make the program read the data off of the CD-ROM and only the CD requiring them to have the CD in to run the application.
0
Comment
Question by:Jagar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 

Accepted Solution

by:
MikeABB earned 200 total points
ID: 1439012
You can create a drive list and cycle through the drive letters and use the API call GetDriveType to check if it is a CD-ROM.  Here is the information:


Declare Function GetDriveType& Lib "kernel32" Alias "GetDriveTypeA" (ByVal _
nDrive As String)

Parameter      Type/Description
nDrive      String— A string containing the path to the root directory of the drive.

Return Value
Long—Zero if the drive cannot be identified. One if the specified directory does not exist. One of the constants DRIVE_REMOVABLE, DRIVE_FIXED, DRIVE_REMOTE, DRIVE_CDROM or DRIVE_RAMDISK specifying the drive type on success.
0
 
LVL 4

Expert Comment

by:zsi
ID: 1439013
jagar,

In addition to MikeAbb's (any relation to ClifABB?) comments, you might also want to consider either usint the same label on the CD and testing for the existence of that label, or bury a file somewhere in your directory structure and look for it.  This will help to ensure that the proper CD is in the drive.

Don't knock yourself out too much in your attempt to provide copy protection.  You can get a CD burner now for less than $300. :)

If you are really serious about copy protection, I suggest you take a look at Rainbow Technologies (http://www.rainbow.com).  They offer professional anti-piracy solutions.

zsi
0
 
LVL 2

Author Comment

by:Jagar
ID: 1439014
Thanks for the above suggestions, I just trying to make a little protection, so the CD's required will be OK.
0
 

Expert Comment

by:MikeABB
ID: 1439015
zsi,
we work in the same group
0
 
LVL 2

Author Comment

by:Jagar
ID: 1439016
Thank you for your help
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question