14/09/2009
Download source code (9KB)
Nearly, I used RichEditCtrl in a MFC project, and I want to take formatted RTF text in that control to display on a HTML control. I searched through CodeGuru and found this one. It’s a nice job, but it leaks 2 things:
- Doesn’t work well with unicode. In fact, it can’t recognize unicode characters.
- A minor error when calculating font size.
As you maybe known, in RTF format, an unicode character is encoded in two ways:
- \u6884: 6884 is character code (in decimal) of this letter (it’s “Ấ“) .
- \’1EA4: 1EA4 is character code (in hexadecimal) of this letter (it’s “Ấ“) .
So I slightly modified Daniel Beutler’s code in order to work around these problems. You can found my code in the following functions: CRTF_HTMLConverter::R2H_CreateHTMLElements and Util::StringToLong.
Leave a Comment » |
Misc, Windows | Tagged: coding, convert, html, MFC, programming, rtf |
Permalink
Posted by phvu
09/07/2009
Download the source code
Lately, in one of my project, I have to save an BITMAP object into an XML document. The problem is I can only save an CString into the XML document. So I have to find a way to convert BITMAP data (in a HBITMAP) into CString.
It’s pretty easy if I serialize the BITMAP to an byte[] array, and then convert the result byte[] array into CString format. So I will consequently discuss on these 2 problems.
Read the rest of this entry »
Leave a Comment » |
Algorithms, Misc, Windows | Tagged: byte[] array, coding, convert, CString, HBITMAP, MFC, programming, RLE, win32, Windows |
Permalink
Posted by phvu
23/02/2009

Today I had a presentation about Functional Programming in >NET with C# and F# at Microsoft Vietnam office, according to the MSP Tech Passion conference series. All things is OK, and I think the audience really get exciting with my presentation. I’m really glad about it.
So I post the slide and demo source code here. If you wanna discuss more about this topic, feel free to contact me via email or by commenting in this post.
5 Comments |
.NET Framework, Technology | Tagged: C#, coding, F#, language, msp, programming |
Permalink
Posted by phvu
28/01/2009
I’m going to describe the way to make a transparent picture box control in MFC (Smart Device application). It worked well on Windows CE, and it should be fine on Win32 application.
The key function is TransparentImage. Using it, you will see that the job is pretty simple…
Read the rest of this entry »
Leave a Comment » |
Misc, UI, Win Mobile - .NET CF, WinCE, Windows | Tagged: coding, control, MFC, pictureex, programming, transparent, UI, Win Mobile - .NET CF, WinCE |
Permalink
Posted by phvu
15/01/2009
Download the source code

Today I will show the way to send SMS message in Windows CE and Windows Mobile, using C++ and P/Invoke in .NET CF. It’s pretty simple…
In Windows CE environment, SMS fuction is handled by “sms.dll”, but in Windows Mobile 2005 and later, it’s handled (in a much more simpler way) by “cemapi.dll”. The “cemapi.dll” is not documented very well, in the other hand, you can find lots of information about “sms.dll” on MSDN.
Read the rest of this entry »
9 Comments |
Win Mobile - .NET CF, WinCE | Tagged: .NET CF, coding, MFC, programming, sms, Win Mobile - .NET CF, WinCE |
Permalink
Posted by phvu
11/01/2009
I spent my rarely free time before the Lunar New Year holiday by playing with SmallBasic – one of more interesting tools introduced by Microsoft. Just another easy tool for newbies, but I wonder if “what can I do with it?”. It’s just has less than 15 keywords, and at the 1st sight, I can’t imagine anything I can do with it…
Read the rest of this entry »
Leave a Comment » |
.NET Framework, Misc, UI, Windows | Tagged: coding, CrashDown, programming, SmallBasic, UI |
Permalink
Posted by phvu
08/01/2009
Vô tình đọc dc cái này, học dc cách phỏng vấn nhân sự, hehe…
May mà có người tốt bụng dịch lại, ko thì chắc cũng chả siêng ngồi đọc từ đầu đến cuối
)
Read the rest of this entry »
Leave a Comment » |
Misc, Technology | Tagged: coding, cv, programming, resume, ruby |
Permalink
Posted by phvu
14/10/2008
In a software-centric world where we already have many, many languages to program in, from scripting to bytecode compiled languages, to frameworks on top of languages and embedded languages, now Redmond wants to bring ANOTHER language to the table, titled ‘M’ (for Microsoft?).
Read the rest of this entry »
Leave a Comment » |
.NET Framework, Windows | Tagged: language, M, Microsoft, programming |
Permalink
Posted by phvu