The application can monitor itself[^] if you want. Or you can activate Windows Performance Counters[^] for your application, and use Performance Monitor to monitor your application.
Rolf Kristensen
Posts
-
Monitoring application memory usage -
How to store and retrieve data from database via internet using VC++2008You just answered the question yourself. You create a web-server-application (ASP.NET / PHP / CGI / Java etc.) on the same network as the database. Now the web-client-application can access the database through the web-server-application over the internet.
-
Any (free) Unit testing frame work for MFC code?Other test frameworks: Google Test[^] (Google Test Adapter (Adds VS2012 support)[^] Microsoft.VisualStudio.TestTools.CppUnitTestFramework (VS2012 only)[^] It can be a good idea to investigate how well the unit testing framework works together with your build server. It can give "free" benefits like test performance graphs, that can show if a recent code change have degraded performance.
-
don't use the drive into Ring0 -
How to make an edit box accept only digits from 0 - 9 in mfc.?If using
DoDataExchange
andDDX_Text
, then you also have access toDDV_MinMaxInt
(And other DDV friends[^]) -
CComboBox for lots and lots of optionsIf you could find a ComboBox that expands into CListCtrl, then you can use the grouping feature of the CListCtrl. But an easier solution is just to use two ComboBoxes. One that allows one to select user type, and one that displays the filtered result within the selected user type.
-
How to get a ip address from system nameHere is how to get ip address from system name:
-
Memory usageCString csMsg;
PROCESS_MEMORY_COUNTERS_EX procMemInfo = {0};
procMemInfo.cb = sizeof(procMemInfo);
if (GetProcessMemoryInfo(GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS*)&procMemInfo, sizeof(procMemInfo)))
{
// Log how much physical and total memory we are using
// - Win7 (and newer) reports commit-size in this member
if (procMemInfo.PagefileUsage==0)
procMemInfo.PagefileUsage = procMemInfo.PrivateUsage;
ULONG ulWorkingSetSize = (ULONG)(procMemInfo.WorkingSetSize / 1024 / 1024);
ULONG ulPagefileUsage = (ULONG)(procMemInfo.PagefileUsage / 1024 / 1024);
CString csProcessMemInfo;
csProcessMemInfo.Format(_T("WorkingSetSize=%lu MBytes, CommitChargeSize=%lu MBytes"), ulWorkingSetSize, ulPagefileUsage);
csMsg += csProcessMemInfo;
}
MEMORYSTATUSEX memStatus = {0};
memStatus.dwLength = sizeof(memStatus);
if (GlobalMemoryStatusEx(&memStatus))
{
// Log how much address space we are using (detect memory fragmentation)
ULONG ulUsedVirtual = (ULONG)((memStatus.ullTotalVirtual-memStatus.ullAvailVirtual) / 1024 / 1024);
ULONG ulAvailVirtual = (ULONG)(memStatus.ullAvailVirtual / 1024 / 1024);
CString csMemStatus;
csMemStatus.Format(_T("UsedVirtual=%lu MBytes, AvailableVirtual=%lu MBytes"), ulUsedVirtual, ulAvailVirtual);
csMsg += csMemStatus;
} -
Strange memory leakIf the sizeof(PROCESSENTRY32) == 48, then I have found your leak.
-
Application error 0xc0150002 when run MFC in Window 7Make sure to check the EventLog (Application + System) it can many times have interesting information, about failed program starts. Also even if you find it impossible to install VC6 on Win7, then you can still debug using WinDBG (Windows Debugging Tools).
-
Help to find an excesive memory allocation in my application -
need help with serial communicationsThe latest version can be found here
-
MFC CListCtrl FindItem is not workingYou could insert the column you want to search in first, and then change the display order afterwards so it becomes the second column. Or just implement your own search method:
CString token = "hello";
for(int i=0;i -
Can I create a dialog template for other dialog boxes?Here is an example Enhanced MFC Message Boxes[^] (Download 1.2 lite)
-
Corruption of the heap. Why ?I can recommend using Application Verifier[^] and then run your application within a debugger. Then it should break the application at the initial corruption of the heap. Application Verifier is part of the Windows SDK[^]
-
How to create your own Remote Desktop Application in Visual C++ or MFCMaybe this can help - Remote Control PCs[^] Alternative you can checkout this very simple .NET version Screen Cast Server with Control[^]
-
XML Data To C++ ObjectsThese XML to CPP frameworks are also called ORM (Object Relational Mapping): QxOrm - C++ ORM (Object Relational Mapping) Library[^] XSD: XML Data Binding for C++[^] boost::serialization[^] I have little experience with "automatic" xml mappers, but when choosing a framework then ensure they can SAX parse (much faster) and also support versioning of XML documents (Support for mapping from old XML documents with deprecated and missing tags).
-
Suggest a third party library for MFC applicationsImplement the GUI in .NET that can communicate with whatever backend.
-
CListCtrlInherit from CGridListCtrlEx - Grid Control Based on CListCtrl[^] and override CGridListCtrlEx::OnDisplayRowFont()
-
changing column value to hyper linkHere are different examples of creating a hyperlink in the CListCtrl: A list control with hyperlink function[^] Simple CListCtrl with HyperLink Function[^] CListCtrl With Web Links[^]