Need a bit of help with Exception handling
I have made a class for exception handling using the GameCodeError as a prototype:
From CheckHardDisk, I am throwing
<code>
if (diskfree.avail_clusters < neededClusters)
{
// if you get here you don’t have enough disk space!
throw errorTypes(EC_INIT_NOT_ENOUGH_DISK_SPACE);
}
</code>
and the catch statement is this:
<code>
try
{
CheckHardDisk(2000000000000000);
}
catch (int EC_INIT_NOT_ENOUGH_DISK_SPACE)
{
if (EC_INIT_NOT_ENOUGH_DISK_SPACE)
{
MessageBoxW(hWnd, L"Not Enough Disk Space, please delete some data and try again!", L"ERROR", MB_OK);
return E_FAIL;
}
}
</code>
I am getting the following error in the CheckHardDisk function after the exception is thrown:
Unhandled exception at 0x7c812afb in MyApp.exe: Microsoft C++ exception: errorTypes at memory location 0x0012fb18..
Any ideas?
I have made a class for exception handling using the GameCodeError as a prototype:
From CheckHardDisk, I am throwing
<code>
if (diskfree.avail_clusters < neededClusters)
{
// if you get here you don’t have enough disk space!
throw errorTypes(EC_INIT_NOT_ENOUGH_DISK_SPACE);
}
</code>
and the catch statement is this:
<code>
try
{
CheckHardDisk(2000000000000000);
}
catch (int EC_INIT_NOT_ENOUGH_DISK_SPACE)
{
if (EC_INIT_NOT_ENOUGH_DISK_SPACE)
{
MessageBoxW(hWnd, L"Not Enough Disk Space, please delete some data and try again!", L"ERROR", MB_OK);
return E_FAIL;
}
}
</code>
I am getting the following error in the CheckHardDisk function after the exception is thrown:
Unhandled exception at 0x7c812afb in MyApp.exe: Microsoft C++ exception: errorTypes at memory location 0x0012fb18..
Any ideas?