Sometime you need some CEdit Validation, for example, restricting the data number only. The simple implemetion is to handle the EN_UPDATE notification message. The EN_UPDATE message is useful to handle as it caters for both normal entry and clipboard paste. You can do that in the Dialog or subclass the CEdit class. Here is an [...]
How to load a bitmap from bmp file and draw it in DC? There are two main steps: Load the bitmap from the file to a memory DC. Paint the content of the memory DC to the one which display the bitmap. In MFC, there is no API to load a bitmap directly from a [...]
05 Dec
Posted by hamo as Win32/MFC 8,936 views, 2 Comments
When you want to change the height of CListCtrl, you need to use an owner-draw version of CListCtrl and change the font of the control. But when you change the font of the CListCtrl, the control or its parent window does not get a chance to respecify the height of the rows and the effect will not be [...]
by Andreas Jdger The inspiration to write this code was to have an easy-to-use parser for functions given as string. You have a string like cos(x)-7*x/(1+x) and you want to compute some values, maybe for displaying the graph of the function. You can write code like this: CFunction* fkt = CFunction::Parse(“cos(x)-7*x/(1+x)”); long double y = [...]
25 Nov
Posted by hamo as Win32/MFC 437 views, 0 Comments
Here is only a short introduction of the article, if you are interested, please goto the author’s website for the full text. Most people have heard of the standard auto_ptr smart pointer facility, but not everyone uses it daily. That’s a shame, because it turns out that auto_ptr neatly solves common C++ design and coding [...]
We offen need to store some binary data in the mdb database, thus we have to transefer the data by VARIANT structure.But how to read from binary data from VARIANT or write to? Here is a solution by safe array of VARRIANT.