Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21100

Help with a program

$
0
0
Hello I am trying to make a simple program to send a MMC command (Read CD for example) to a DVD Writer (assigned letter E in my computer) when I click a button. I just started programming and I tried to make something but I got no idea what to do.

Code:

Private Command1_Click()
Function SendCommandNoData()
Handle hVol = CreateFile("\\.\E:", GENERIC_READ, GENERIC_WRITE)
DeviceIoControl(hVol, IoControlCode, InBuffer, OutBuffer, Overlapped)
SendCommandNoData(
  [in]  BYTE *READ CD,
  [in]  ULONG 12,
  [out]  BYTE SenseBuffer[18],
  [in]  ULONG 5
);
End Function

I tried to define the letter for the target drive, because SendCommandNoData seems to me like you can't specify the wanted drive (can I make the user able to choose the dvd writer from a list of found ones in the computer?). Then I tried to send the command. It is probably very bad code, but I just want to learn. Thank you.

Viewing all articles
Browse latest Browse all 21100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>