VC只有:
// Example of the try and catch statements
try
{
// Write the file header
file.Write((LPSTR)&bmfHdr, sizeof(BITMAPFILEHEADER));
//
// Write the DIB header and the bits
file.WriteHuge(lpBI, dwDIBSize);
}
catch (CFileException* e)
{
::GlobalUnlock((HGLOBAL) hDib);
throw;
}
其实我不觉得delphi的finally有什么作用,也弹出出错信息,
既然我知道可能会出错,
我不如在 except里自己处理或者free后exit还好过,所以我从来不用finally
// Example of the try and catch statements
try
{
// Write the file header
file.Write((LPSTR)&bmfHdr, sizeof(BITMAPFILEHEADER));
//
// Write the DIB header and the bits
file.WriteHuge(lpBI, dwDIBSize);
}
catch (CFileException* e)
{
::GlobalUnlock((HGLOBAL) hDib);
throw;
}
其实我不觉得delphi的finally有什么作用,也弹出出错信息,
既然我知道可能会出错,
我不如在 except里自己处理或者free后exit还好过,所以我从来不用finally
解决方案 »
- 求WTL学习资料
- 高手请进,请教个线程间通信的问题
- char ch[3]="103"; 怎样编程获得“0”这个字符呢?
- 如何让static text中的多行字的行距变宽啊?
- 请大家帮我看看这个类,要改进的地方
- CEdit的一个关于全选问题.
- 如何 用bho 使得ie启动后全屏显示
- 如何用代码改变“关于”对话框的显示文字
- 为什么我调用COM会出错的?5.5..5..
- ADO中m_pConnection->Execute怎么用?请大侠指点!
- 我想学windows编程,能不能给我一点建议啊?
- 请问在使用TAPI连接MODEM后 我想将串口关闭 ,让别的应用程序使用已拨通的MODEM 发送数据 而该应用程序只能打开串口,如何关闭相关串口再打
{
//your code;
}
catch (...)
{
//your code;
}