Catching a system error.

J

John

I'm new and I don't know which forum this should go into, so please forgive
me in advance if I have inadvertantly placed this question. I don't know if
it's a Microsoft question or a generic C++ question. I did try searching for
an appropriate forum but I didn't know which one I should post to.

With that preamble out of the way, I'm learning C++ and Visual Studio 2005
at the same time on my own.

When GetDiskFreeSpace() stumbles upon the 'A' drive, a Windows pop-up window
with a "Drive not Ready" message appears. I spent all morning searching
google for anything resembling this type of situation with every possible
combination of keywords that I could think of but I didn't find a solution.

How can I capture these type of operating system errors?



try
{
GetDiskFreeSpace(volumeAux, &sectorsPerCluster
, &bytesPerSector
, &numberOfFreeClusters
, &totalNumberOfClusters);
}
catch (...) {}

Again, please accept my apologies if this is not the correct forum for this
type of question.
 
A

Alf P. Steinbach

* John:
I'm new and I don't know which forum this should go into, so please
forgive me in advance if I have inadvertantly placed this question. I
don't know if it's a Microsoft question or a generic C++ question. I
did try searching for an appropriate forum but I didn't know which one I
should post to.

With that preamble out of the way, I'm learning C++ and Visual Studio
2005 at the same time on my own.

When GetDiskFreeSpace() stumbles upon the 'A' drive, a Windows pop-up
window with a "Drive not Ready" message appears. I spent all morning
searching google for anything resembling this type of situation with
every possible combination of keywords that I could think of but I
didn't find a solution.

How can I capture these type of operating system errors?



try
{
GetDiskFreeSpace(volumeAux, &sectorsPerCluster
, &bytesPerSector
, &numberOfFreeClusters
, &totalNumberOfClusters);
}
catch (...) {}

Again, please accept my apologies if this is not the correct forum for
this type of question.

Apologogoggogogogoies accepted. ;-) Next time, please just read this
group's /FAQ/, which has suggestions for approproate groups. In this
case, [comp.os.ms-windows.programmer.win32] would be appropriate.

<ot>See the Windows API function SetErrorMode.</ot>

Follow-ups to [comp.os.ms-windows.programmer.win32].
 
P

Phlip

John said:
I'm new and I don't know which forum this should go into, so please
forgive me in advance if I have inadvertantly placed this question.

Always use Google and Google Groups to prep a question. If you don't answer,
you will at least find a good forum.
When GetDiskFreeSpace() stumbles upon the 'A' drive, a Windows pop-up
window with a "Drive not Ready" message appears. I spent all morning
searching google for anything resembling this type of situation with every
possible combination of keywords that I could think of but I didn't find a
solution.

In this case, the question has nothing to do with C++. Post it to a
newsgroup with win32, programming, and kernel in its name.
 
J

Jerry Coffin

[ ... ]
When GetDiskFreeSpace() stumbles upon the 'A' drive, a Windows pop-up window
with a "Drive not Ready" message appears. I spent all morning searching
google for anything resembling this type of situation with every possible
combination of keywords that I could think of but I didn't find a solution.

How can I capture these type of operating system errors?

If you ask about SetErrorMode somewhere that it's topical (e.g.
comp.os.ms-windows.programmer.win32) you'll probably get some useful
information.
 
J

John

Jerry said:
[ ... ]
When GetDiskFreeSpace() stumbles upon the 'A' drive, a Windows pop-up window
with a "Drive not Ready" message appears. I spent all morning searching
google for anything resembling this type of situation with every possible
combination of keywords that I could think of but I didn't find a solution.

How can I capture these type of operating system errors?

If you ask about SetErrorMode somewhere that it's topical (e.g.
comp.os.ms-windows.programmer.win32) you'll probably get some useful
information.

Yes, if I knew the answer (SetErrorMode), then I would have known to ask the
correct question. Of course, then I wouldn't have needed to ask the question
since I already knew the answer.

Thank you very much for pointing this out to me.
 
J

John

Phlip said:
Always use Google and Google Groups to prep a question. If you don't answer,
you will at least find a good forum.

I believe that when I wrote my original post:

"I'm new and I don't know which forum this should go into, so please forgive
me in advance if I have inadvertently placed this question. I don't know if
it's a Microsoft question or a generic C++ question. I did try searching for
an appropriate forum but I didn't know which one I should post to."

I spent all morning searching google for anything resembling this type of
situation with every possible combination of keywords that I could think of
but I didn't find a solution."

I professed to being ignorant, but certainly far from lazy. I did exactly
what you had specified. Nevertheless, I sincerely regret to have caused you
so much inconvenience. My inexcusable transgression is perhaps unforgivable
but I hope, in time, that this group will get past my posting a question to
the incorrect forum.

In this case, the question has nothing to do with C++. Post it to a
newsgroup with win32, programming, and kernel in its name.

Again, I most heartily apologize to you and to all within the group. Had I
been aware that I should have searched for 'kernel' or 'win32' I most
certainly assure you that I would have. Alas, I am early in learning C++,
Windows and Visual Studio and I was incognizant of the appropriate keywords.
 
P

Phlip

John said:
I believe that when I wrote my original post:

"I'm new and I don't know which forum this should go into, so please
forgive me in advance if I have inadvertently placed this question. I
don't know if it's a Microsoft question or a generic C++ question. I did
try searching for an appropriate forum but I didn't know which one I
should post to."

I spent all morning searching google for anything resembling this type of
situation with every possible combination of keywords that I could think
of but I didn't find a solution."

I professed to being ignorant, but certainly far from lazy. I did exactly
what you had specified. Nevertheless, I sincerely regret to have caused
you so much inconvenience. My inexcusable transgression is perhaps
unforgivable but I hope, in time, that this group will get past my posting
a question to the incorrect forum.

Farbeit from me to interfere with anyone's quest to be a victim, but...

....Did such googling reveal the names of forums that discuss
GetDiskFreeSpace()? My very first attempt, with Google Groups, reveals
groups like ,
, and
. So only one in three of these are
wrong, but close enough.

So you did indeed find good forums, by name, unless if you didn't use Google
Groups.
 
J

John

Jerry said:
[ ... ]
When GetDiskFreeSpace() stumbles upon the 'A' drive, a Windows pop-up window
with a "Drive not Ready" message appears. I spent all morning searching
google for anything resembling this type of situation with every possible
combination of keywords that I could think of but I didn't find a solution.

How can I capture these type of operating system errors?

If you ask about SetErrorMode somewhere that it's topical (e.g.
comp.os.ms-windows.programmer.win32) you'll probably get some useful
information.

You are indeed more correct. I did not investigate the possibilities within
google are far as I should have. So, while I may not be lazy, perhaps I'm
just not smart.

Again, I most sincerely apologize for having inconvenienced this group as
greatly as I have with a post that was inappropriately placed here.

I will endeavor not to commit this contravention again.
 
J

John

Phlip said:
Farbeit from me to interfere with anyone's quest to be a victim, but...

...Did such googling reveal the names of forums that discuss
GetDiskFreeSpace()? My very first attempt, with Google Groups, reveals
groups like ,
, and
. So only one in three of these are
wrong, but close enough.

So you did indeed find good forums, by name, unless if you didn't use Google
Groups.

[posted this note to the wrong person. Most sorry.]

You are indeed more correct. I did not investigate the possibilities within
google are far as I should have. So, while I may not faineant, perhaps I'm
just not smart.

Again, I humbly apologize for having inconvenienced this group as greatly as
I have with a post that was inappropriately placed here.

I will endeavor not to commit this contravention again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top