Fake a CD?

I want to make a little utility (for myself) for Win '95 with VB4.0.
I want to have these parts on a form:
a drivelist,
a directorylist,
a textbox and
a button
It should do this:
You should select a drive and directory that you want to use in those lists.
in the textbox you input a free valid drive letter.
and the button for starting the procedure.
The procedure would be:
Take the drive and directory from the lists and fake these as a CD-ROM on drive letter specified in the textbox.
I have a program called FAKECD that does all this for me, the only problem with it is that it just works in DOS and not in Win'95.
So, what I want is to redo that program in VB code. Anyone who would like the program can get it, just add a comment with your e-mail and a text specifiyng what you want.

PLEASE HELP ME!! IT'S VERY IMPORTANT FOR ME!!

// Gustav
GustavAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

milton042297Commented:
This is a code sample for Microsoft Access but it will work properly for your case in Visual Basic 4.0.



The sample program below uses several functions to control basic CD-ROM drive features such as stop, play, and eject. The functions can be used in any CD-ROM application you create. The sample program below is not a complete application, but is rather a basis you can use to create a full-featured application.
 
The simplest way to use these functions is to create a form with five command buttons on it. Have each of the buttons call one of the five sample functions below with its OnPush property.
 
To create these functions, create a new Access Basic module and enter the following Declarations and functions.
 
NOTE: In the following sample code, an underscore (_) is used as a line-continuation character. Remove the underscore from the end of the line when re-creating this code in Access Basic.
 
NOTE: You may have these Microsoft Windows API functions defined in an
existing Microsoft Access library or module; therefore, your delarations may be duplicates causing a duplicate procedure name error message. There are two resolutions to this error:
 
 - Remove or comment out the duplicated declarations statements.
 
 - Use function aliasing by replacing the phrase "alias_" throughout the code below with your own unique aliasing characters. This method allows you to remove the other module and not lose the declarations for the API functions in the new module.
 
 
   '******* Declarations Section *******
 
   Option Compare Database
   Option Explicit
 
   Declare Function alias_mciSendString& Lib "MMSystem" alias_
   "mciSendString" (ByVal Sound$, ByVal RtnString$,_
   ByVal RtnLength%, ByVal Hndl%)
 
   Dim RetInt As Integer
   Dim RetStr As String * 64
   Dim mciStatement As String
 
   Global gTrackCurrent As Integer ' stores current track on CD.
   Global gTrackCount As Integer   ' stores count of tracks on CD.
 
   '******* Play Function *********
 
   Function CDPlay () As Integer
      ' This function initializes the audio device
      ' with the first call to mciSendString(), and
      ' then starts the CD playing with the second call.
 
      RetInt = alias_mciSendString("Open CDAudio", "", 0, 0)
      CDPlay = alias_mciSendString("Play CDAudio", "", 0, 0)
   End Function
 
   '******* Stop Function **********
 
   Function CDStop () As Integer
      ' This function stops the CD with the first call
      ' to mciSendString(), and closes the audio device
      ' with the second call.
      RetInt = alias_mciSendString("Stop CDAudio", "", 0, 0)
      CDStop = alias_mciSendString("Close CDAudio", "", 0, 0)
   End Function
 
   '******** Previous Track Function **********
 
   Function CDTrackPrevious ()
      Dim TrackPrevious As Integer
 
      ' Set time format to Tracks, minutes, seconds, and frames.
      RetInt = alias_mciSendString("Set CDAudio Time Format TMSF",_
      "", 0, 0)
 
      ' Retrieve the track number that is currently playing, and
      ' the total number of tracks on the CD. Store these values
      ' in global variables so that they are available to the form.
 
      mciStatement = "Status CDAudio Current Track"
      RetInt = alias_mciSendString(mciStatement, RetStr, 63, 0)
      gTrackCurrent = Val(RetStr)
      TrackPrevious = gTrackCurrent - 1
      mciStatement = "Status CDAudio Number of Tracks"
      RetInt = alias_mciSendString(mciStatement, RetStr, 63, 0)
      gTrackCount = Val(RetStr)
 
      ' Check to see if the current track is the first track. If it
      ' is seek to the beginning of the current track and play it.
      ' Otherwise, move to the previous track and play from there to
      ' the end of the CD.
 
      If TrackPrevious > 0 Then
         mciStatement = "Play CDAudio from " & TrackPrevious
         mciStatement = mciStatement & " To " & gTrackCount
         CDTrackPrevious = alias_mciSendString(mciStatement, "", 0, 0)
      Else
         mciStatement = "Seek CDAudio to " & TrackPrevious
         RetInt = alias_mciSendString(mciStatement, "", 0, 0)
         CDTrackPrevious = alias_mciSendString("Play CDAudio", "", 0, 0)
      End If
   End Function
 
   '********** Next Track Function **********
 
   Function CDTrackNext () As Integer
      Dim TrackNext As Integer
 
      ' Set time format to Tracks, minutes, seconds, and frames.
      RetInt = alias_mciSendString("Set CDAudio Time Format TMSF",_
      "", 0, 0)
 
      ' Retrieve the track number that is currently playing, and
      ' the total number of tracks on the CD. Store these values
      ' in global variables so that they are available to the form.
 
      mciStatement = "Status CDAudio Current Track"
      RetInt = alias_mciSendString(mciStatement, RetStr, 63, 0)
      gTrackCurrent = Val(RetStr)
      TrackNext = gTrackCurrent + 1
      mciStatement = "Status CDAudio Number of Tracks"
      RetInt = alias_mciSendString(mciStatement, RetStr, 63, 0)
      gTrackCount = Val(RetStr)
 
      ' Check to see if the current track is the last track. If it
      ' is seek to the beginning of the last track and play it.
      ' Otherwise, move to the next track and play from there to the end
      ' of the CD.
 
      If (TrackNext) < gTrackCount Then
          mciStatement = "Play CDAudio from " & TrackNext
          mciStatement = mciStatement & " To " & gTrackCount
          CDTrackNext = alias_mciSendString(mciStatement, "", 0, 0)
       Else
          mciStatement = "Seek CDAudio to " & gTrackCurrent
          RetInt = alias_mciSendString(mciStatement, "", 0, 0)
          CDTrackNext = alias_mciSendString("Play CDAudio", "", 0, 0)
      End If
   End Function
 
   '********* Eject Function **********
 
   Function CDEject () As Integer
      ' This function is not supported by all CD devices.
      CDEject = alias_mciSendString("Set CDAudio Door Open", "", 0, 0)
   End Function
 
   '********* Pause Function **********
 
   Function CDPause () As Integer
      CDPause = alias_mciSendString("Stop CDAudio", "", 0, 0)
   End Function
 
'*****************************************************************

That's all, good luck.
0
GustavAuthor Commented:
Edited text of question
0
GustavAuthor Commented:
Milton, that was some good code(, that I already knew).
But it wasn't the thing I wanted.
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

GustavAuthor Commented:
Adjusted points to 200
0
advappCommented:
I'd be willing to take a look at this.  It does not sound too difficult.
Send the code to rod@plaza.ds.adp.com
0
GustavAuthor Commented:
Adjusted points to 215
0
schneiddCommented:
If i understand you right, you want to associate a path with a drive letter, right?

Well, there is the DOS command SUBST.EXE in Windows\Command\ (try subst /? in a DOS-Box).

If you don't want to place a SUBST.EXE command in your autoexec.bat, you could simply write a VB caller program.

I hope this helps you
0
GustavAuthor Commented:
schneidd(, and all other people reading this), I know about subst and a lot of other programs like it.
The problem is that these programs doesn't make the system believe that the drive is a CD-ROM.
The only one I discovered that does this CD-thing is the DOS tsr FAKECD. But that doesn't work in Win95.
Do you think you get the problem?
0
GustavAuthor Commented:
Adjusted points to 220
0
schneiddCommented:
Hi Gustav,

I have tried out FAKECD with Windows 95 (v4.00.950a), and IT WORKS!!!

Maybe, you have not the actual version. I have found FAKECD10.ZIP (8.007 Bytes) at the following Address: "http://whirligig.ecs.soton.ac.uk/~sjl495/cdemu/index.htm"

This site also has some other fake cd tools (but all are for DOS).

I have installed the program with the following command line in my autoexec.bat: "LoadHigh C:\CdRom\FakeCD10\FakeCD.Exe D:\CD-ROM /l:h".

After rebooting, - tadaa - there is a new Drive "H:" in the Explorer, and it's recognised as a CD-ROM drive (but it's not write protected).

FAKECD.EXE does not work, if launched in a DOS-Box.
Maybe, if you have the newest Version of Win95 (that with the new FAT32) this could also be a reason, why it doesn't work on your machine.

Greetings Detlef
0
GustavAuthor Commented:
Yes, I know it works when you put it in autoexec.bat.
It does work with FAT32 too, but I wonder if there is a way to do this inside Win95, but if there isn't I will gladly give you the points.
0
GustavAuthor Commented:
Adjusted points to 225
0
RoBoCommented:
Hi we use facke cd for quake, c&c, RedAlert, KKND. when we want to use these we make a batch file for the program and load the fakecd  then run the game and the unload fakecd. some games don't like the real mscdex.exe loaded before fakecd. so instead of geting vb to do the wok get it to make a batch file for u. then again this has only been proven for Fat16, Good Luck
0
GustavAuthor Commented:
Adjusted points to 265
0
y96andhaCommented:
Bad news: It is impossible to create such a program in Visual Basic.

Good news: There is already a program (not written in Visual Basic) to do this. Go to this url: http://www.logicraft.com/data/vcd.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
y96andhaCommented:
I found there was no link back from the page I mentioned.

URL for direct download is http://www.logicraft.com/dwnld/dwnld.htm
0
GustavAuthor Commented:
That program is probably great, but there are two problems:
1. I can't download it.
2. I thought of making an own program, so now there is a question for you wich language shall I use?
0
y96andhaCommented:
1. Why can't you download it?

2. I think Microsoft Visual C++ would be a good choice. You need to get the Windows 95 DDK too. But I must warn you that it's not a simple project, it would probably take quite some time just to dig into the DDK and understand how to develop Win95 device drivers.

You can look at the DDK documentation on the web at http://premium.microsoft.com/msdn/library/
0
GustavAuthor Commented:
When I try to send my info to get the download there is a grey screeen saying that it can't be found or something,
have it worked for you?
0
y96andhaCommented:
Yes, it has worked. I have not downloaded the 95 version, but I have the NT version OK. If you would like, I could get the 95 version and then e-mail it to you?
0
GustavAuthor Commented:
Yes that would be nice, my e-mail is:
munkby@mbox300.swipnet.se
but I couldn't download the NT version either, I don't know why, do you, maybe because im from Sweden?
0
y96andhaCommented:
OK, jag skickar över den just nu. Hoppas det går bra.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.