Click here to Skip to main content
15,890,382 members
Home / Discussions / C#
   

C#

 
QuestionCreating deployment Pin
waddie123-Apr-07 1:00
waddie123-Apr-07 1:00 
AnswerRe: Creating deployment Pin
kubben23-Apr-07 2:36
kubben23-Apr-07 2:36 
AnswerRe: Creating deployment Pin
Jax_qqq23-Apr-07 4:39
Jax_qqq23-Apr-07 4:39 
QuestionHow to read image file ? Pin
trungpt_hut23-Apr-07 0:45
trungpt_hut23-Apr-07 0:45 
AnswerRe: How to read image file ? Pin
Christian Graus23-Apr-07 0:59
protectorChristian Graus23-Apr-07 0:59 
QuestionMFC serialization Pin
Keshav V. Kamat23-Apr-07 0:28
Keshav V. Kamat23-Apr-07 0:28 
AnswerRe: MFC serialization Pin
Colin Angus Mackay23-Apr-07 0:41
Colin Angus Mackay23-Apr-07 0:41 
QuestionDriveInfo's IsReady problem Pin
Eduard Keilholz23-Apr-07 0:27
Eduard Keilholz23-Apr-07 0:27 
Hey guys,
I'm writing a piece of software which requires to monitor the CD Tray for discs.

<br />
foreach (DriveInfo drvInfo in DriveInfo.GetDrives())<br />
{<br />
    if (drvInfo.DriveType == DriveType.CDRom)<br />
    {<br />
        if (drvInfo.IsReady)<br />
            btnStartUpdateProcess.Enabled = (drvInfo.RootDirectory.GetFiles("*.enc").Length > 0);<br />
        else<br />
            btnStartUpdateProcess.Enabled =false;<br />
    }<br />
}<br />

The code is called by a timer's Tick event. Now when I start the application with a disc in the drive, the code works fine. When I eject the disc, the button btnStartUpdateProcess gets disabled as soon as the timer fires the tick event. The button also enables again when a disc in inserted with at least one file in the root, with the .enc extension.

However, when I start the application with no CD in the tray the button starts disabled (which is correct) but when inserting a disc, the IsRead will return false over and over again. It looks like the IsReady value doesn't update or so. When I stop the application and imidiately start it again (not touching the CD Tray, the IsReady property returns true again.

Is my approach for 'monitoring' the CD incorrect or something?? I've also used some (WMI based) monitors (downloaded) which fire Insert and Eject events, but the result is the same. It seems like some kind of misterious lock prevents my app from detecting discs.

.: I love it when a plan comes together :.
http://www.zonderpunt.nl

Questionusing instance of a class ? Pin
Software_Specialist23-Apr-07 0:12
Software_Specialist23-Apr-07 0:12 
AnswerRe: using instance of a class ? Pin
Colin Angus Mackay23-Apr-07 0:23
Colin Angus Mackay23-Apr-07 0:23 
GeneralRe: using instance of a class ? Pin
Software_Specialist23-Apr-07 0:27
Software_Specialist23-Apr-07 0:27 
GeneralRe: using instance of a class ? Pin
Colin Angus Mackay23-Apr-07 0:47
Colin Angus Mackay23-Apr-07 0:47 
AnswerRe: using instance of a class ? Pin
Eduard Keilholz23-Apr-07 0:47
Eduard Keilholz23-Apr-07 0:47 
GeneralRe: using instance of a class ? Pin
Christian Graus23-Apr-07 0:58
protectorChristian Graus23-Apr-07 0:58 
GeneralRe: using instance of a class ? Pin
Software_Specialist23-Apr-07 1:41
Software_Specialist23-Apr-07 1:41 
QuestionGetter and Setter functions Pin
Dewald23-Apr-07 0:06
Dewald23-Apr-07 0:06 
AnswerRe: Getter and Setter functions Pin
andre_swnpl23-Apr-07 0:29
andre_swnpl23-Apr-07 0:29 
GeneralRe: Getter and Setter functions Pin
Colin Angus Mackay23-Apr-07 0:40
Colin Angus Mackay23-Apr-07 0:40 
AnswerRe: Getter and Setter functions Pin
Colin Angus Mackay23-Apr-07 0:37
Colin Angus Mackay23-Apr-07 0:37 
AnswerRe: Getter and Setter functions Pin
Guffa23-Apr-07 1:00
Guffa23-Apr-07 1:00 
GeneralRe: Getter and Setter functions Pin
Dewald23-Apr-07 2:44
Dewald23-Apr-07 2:44 
AnswerRe: Getter and Setter functions Pin
Vikram A Punathambekar23-Apr-07 2:07
Vikram A Punathambekar23-Apr-07 2:07 
QuestionHow to set a parameter field in .rdlc during design time Pin
selvakumar Panchatcharam22-Apr-07 23:57
selvakumar Panchatcharam22-Apr-07 23:57 
QuestionC# time to C++ (VS 6) time Pin
Stevo Z22-Apr-07 23:49
Stevo Z22-Apr-07 23:49 
AnswerRe: C# time to C++ (VS 6) time Pin
Christian Graus23-Apr-07 0:06
protectorChristian Graus23-Apr-07 0:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.