Tag Archives: C

Few Considerations About Functions Returning an Object

I am rewriting a VCL program using MFC, and I have converted many functions of this kind: CString MyFunction () { return L”Sample test”; } This kind of function declaration is comfortable, but the question is: is it also convenient?   The answer I found is that it might not be so convenient, especially if used inside a loop. When we call this function, we … Continue reading Few Considerations About Functions Returning an Object »

HOWTO Automatically Catch Problems While Debugging

Suppose to have the ability to add dozens of breakpoints into your program main error detection points, whenever you start a debugging session. This should allow you to easily track down some hidden/unnoticed problems. For example, suppose to have a C function like the below one: __MYOBJECTDATA * WINAPI MYOBJGetPtr (HANDLE hMyObject) { __MYOBJECTDATA *pObj; pObj = (__MYOBJECTDATA *) hMyObject; __try { if ((pObj != … Continue reading HOWTO Automatically Catch Problems While Debugging »