调windows api时如何避免错误

调windows api时如何处理异常?最近在做一个美国的项目,对代码的质量要求比较高,其中我做了一个读写INI文件

调windows api时如何处理异常?
最近在做一个美国的项目,对代码的质量要求比较高,其中我做了一个读写INI文件的代码,一般也就对付过去了,但现在要处理异常不知道如何做?
static   char   INI_FILE[]   =   "..\default.ini ";
...
void   CBlackboxApp::StoreIniFile()
{
CString   strTemp;
WritePrivateProfileString( "UserInfo ",   "Username ",   theApp.m_strUsername,   INI_FILE);
WritePrivateProfileString( "UserInfo ",   "Password ",   theApp.m_strPassword,   INI_FILE);
}

int   CBlackboxApp::LoadIniFile()
{
char   strTemp[50];
GetPrivateProfileString( "UserInfo ",   "Username ",   " ",   strTemp,   INIVALUELEN,   INI_FILE);
theApp.m_strUsername   =   strTemp;
GetPrivateProfileString( "UserInfo ",   "Password ",   " ",   strTemp,   INIVALUELEN,   INI_FILE);
theApp.m_strPassword   =   strTemp;
}

[解决办法]
当然只能这样。