473,385 Members | 1,320 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Catching a system error.

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.
Aug 6 '06 #1
8 1561
* 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].

--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Aug 6 '06 #2
John wrote:
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.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 6 '06 #3
In article <Ic******************@tornado.southeast.rr.com>,
Jo**@nospam.com says...

[ ... ]
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.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Aug 6 '06 #4
Jerry Coffin wrote:
In article <Ic******************@tornado.southeast.rr.com>,
Jo**@nospam.com says...

[ ... ]
>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.
Aug 6 '06 #5
Phlip wrote:
John wrote:
>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.
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.

>
>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.
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.
Aug 6 '06 #6
John wrote:
>>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.

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 news:microsoft.public.vc.language ,
news:microsoft.public.vb.winapi , and
news:comp.os.ms-windows.programmer.win32 . 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.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 7 '06 #7
Jerry Coffin wrote:
In article <Ic******************@tornado.southeast.rr.com>,
Jo**@nospam.com says...

[ ... ]
>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.
Aug 8 '06 #8
Phlip wrote:
John wrote:
>>>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.

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 news:microsoft.public.vc.language ,
news:microsoft.public.vb.winapi , and
news:comp.os.ms-windows.programmer.win32 . 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.
Aug 8 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rolf | last post by:
I understand a compilation error occurs when a method that throws no exceptions is the only code in a try block. What I don't understnad is why I can specify the catching of an Exception for a...
15
by: Steven Reddie | last post by:
I understand that access violations aren't part of the standard C++ exception handling support. On Windows, a particular MSVC compiler option enables Microsoft's Structured Exception Handling...
0
by: Steven Reddie | last post by:
In article <slrnbnj19j.av.juergen@monocerus.manannan.org>, Juergen Heinzl wrote: >In article <f93791bd.0309282133.650da850@posting.google.com>, Steven Reddie wrote: >> I understand that access...
2
by: Shravan | last post by:
Hi, Does anybody know how to catch unhandled exceptions in an application. I have tried using AppDomain.UnhandledException Event Application.ThreadException Event but they were not catching...
7
by: cmay | last post by:
FxCop complains every time I catch System.Exception. I don't see the value in trying to catch every possible exception type (or even figuring out what exceptions can be caught) by a given block...
12
by: Vasco Lohrenscheit | last post by:
Hi, I have a Problem with unmanaged exception. In the debug build it works fine to catch unmanaged c++ exceptions from other dlls with //managed code: try { //the form loads unmanaged dlls...
6
by: Harlin Seritt | last post by:
I am running the following code: import socket host = '9.9.45.103' port = 10001 conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) conn.connect((host, port))
2
by: fischermx | last post by:
Exception Catching difference between VC++ and C# In C# I have this: try { int x, y, z; x = 20; y = 0;
25
by: JJ | last post by:
I only want to catch 404 errors at the application level (the rest are will be handled by the customerrors section of the web.config). How do I check for the error code in the Application_Error...
3
by: john | last post by:
I wrapped some fortran code using F2PY and need to be able to catch fortran runtime errors to run the following: # "grid" is a wrapped fortran module # no runtime errors incurred when run with...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.