Monthly Archives: June 2008

Get CPU/Memory usage via WMI

Some tricks is required in order to use Win32_PerfFormattedData_PerfProc_Process properly, refer to Why Does My Performance Monitoring Script Keep Returning the Same Incorrect Values? VC++ is using IWbemConfigureRefresher,  IWbemRefresher and  IWbemObjectAccess as demonstrated by Accessing Performance Data in C++ Another post: … Continue reading

Posted in WMI | Leave a comment

find first bit in integer in 3 methods

I just did a demo to find out how each method differ in performance. 3 methods are: method using AND operation method using lookup table method using ASM/intrinsic function Result: gccfindbitd <tect_count>Find bit via AND operation uses 375 msec with … Continue reading

Posted in CPP | 1 Comment

VC++ Debug tips

NoStepInto How to Not Step Into Functions using the Visual C++ Debugger In the Debug library, all allocated memory blocks are bracketed with a series of "guard bytes." Diagnostic Services PageHeap utility

Posted in debug | Leave a comment

Reusing CWinApp derived MFC class in Console application

Once I have to integrate a MFC GUI application into a console application. The MFC has a global "theApp" object, but I also want to change something before its ctor was called, so I moved "theApp" from global to local … Continue reading

Posted in MFC | Leave a comment

VC++ 2008 build error

nafxcw.lib(afxmem.obj) : warning LNK4006: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) already defined in LIBCMT.lib(new.obj); second definition ignorednafxcw.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCMT.lib(delete.obj); second definition ignorednafxcw.lib(afxmem.obj) : warning LNK4006: "void * __cdecl … Continue reading

Posted in IDE | Leave a comment