|
Hamid. wrote: I think its not good way but he can uses of SetCurrentDirectory check return value if its nonzero it has floppy.
But you have to poll regularly for that.. i don't think thats good design and could present user headache, as if floppy is corrupt, it could hang the system!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Well I said its not good idea but I dont think it hang the system.
|
|
|
|
|
Hamid. wrote: Well I said its not good idea but I dont think it hang the system.
well you have to test that yourself try putting corrupt floppy into your computer and acess it through My COmputer!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I dont use of floppy disk.;P
|
|
|
|
|
Hamid. wrote: I dont use of floppy disk.
USe ZIP Drive then
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Ok
|
|
|
|
|
PC floppy drives have (or used to have) a active low Disc Change line, which went high (1 ) when the drive was empty and was low (0 ) when a disc was inserted.
Not sure if/how you can get direct access to that line on Win32, though...
Maybe there is an LVM routine that can be used?
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
with the help of WMI, you can find out the arrival and removal of floppy drives and offourse all other drives.
|
|
|
|
|
Naveen.R wrote: with the help of WMI, you can find out the arrival and removal of floppy drives and offourse all other drives.
Hi Naveen,
could you please help me in finding out the exact WMI Class , which could help me in this purpose.. it could work as wonderfull tip for my FAQ site. if you allow i will publish that with you name.
Thanks
Alok
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
I saw two classes Win32_FloppyController/Win32_FloppyDrive .
|
|
|
|
|
ThatsAlok wrote: could you please help me in finding out the exact WMI Class
Any thing for you sir
Actaully I tried this for one of my project requirment. I used the ExecNotificationQueryAsync() function with the following query.
HRESULT hres = pSvc->ExecNotificationQueryAsync(<br />
_bstr_t("WQL"), <br />
_bstr_t("SELECT *" <br />
"FROM __InstanceOperationEvent WITHIN 1 "<br />
"WHERE TargetInstance ISA 'Win32_LogicalDisk'"), <br />
WBEM_FLAG_SEND_STATUS, NULL, pStubSink );
And in the notification handler we can check the instance is __InstanceCreationEvent and __InstanceDeletionEvent for any drive arrival or removal. But if you want disk arrival or removal you may need to handle the __InstanceModificationEvent( this one i didnt check ).
|
|
|
|
|
Hi all,
Say I have a CString and I want to assign the current system date on a MFC application click event. How can I do it.
Thanks
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: Say I have a CString and I want to assign the current system date on a MFC application click event. How can I do it.
CTime::GetCurrentTime and CTime::Format!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
use as follows
CTime time;
CString str;
time=CTime::GetCurrentTime();
str.Format("%d:%d:%d",time.GetDay(),time.GetMonth(),time.GetYear());
good luck.
-----------------------------------------
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
i might beat you by second!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
All are beat me here by years of experience at all.
Thanks for you replay as well.
I appreciate your help all the time...
Eranga
|
|
|
|
|
yah good.
one funny thing happened you know,
as per the practice,
after i punch few lines of code in the editor, automatically, my index finger hits the F7 key to build the code and my lefthand hits the escape key to exit the output window.
the same hapenned in my previous post. but when i hit escape, the content i typed got disappeared. again i had to retype the post. thats why you are fast.
you can try out this logic. its funny.;P
|
|
|
|
|
Had you immediately hit Ctrl+Z, your text would have reappeared.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
;Pyah its working.
thank you.
|
|
|
|
|
Yep, I found this on MSDN as well. But my question is how to assign that time(or date) in CString. Casting is not allow on, LPCSTR. Isn't it
I appreciate your help all the time...
Eranga
|
|
|
|
|
observe my post clearly. it solves ur problem.
i.e. assigning the time to a CString.
--------------------------------------------------
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
|
yah first, i didnt specify that line.
but later i thought that, that would also be helpful to you.
any way.
solved or not?
|
|
|
|
|
Yep, the code seems work fine. But the thing is I can't use it directly on a message box as follows. May be my effort can be silly.
<br />
AfxMessageBox(c_Date.Format("%d:%d:%d", c_Time.GetDay(), c_Time.GetMonth(), c_Time.GetYear()), MB_OK) ;<br />
I appreciate your help all the time...
Eranga
|
|
|
|
|
Eranga Thennakoon wrote: May be my effort can be silly.
yah you are always correct. ;P
use them separately.
BTW, what is that you are getting when you used like this.
|
|
|
|