[ UserControl not show in toolbox ]
When you create a UserControl, you'll usually see it right in the toolbox after Rebuild Project.
But sometimes you will not see your UserControl in the toolbox, to solve it you can do in the following way:
Open Microsoft Visual Studio 2008 and set this option:
Tools > Options > Windows Forms Designer > General : AutoToolboxPopulate
[C#] UserControl not displayed in toolbox
Category C#, Toolbox, UserControl
How to get size of CBitmap ?
After you Load an bitmap image into CBitmap, you can use this code to get its size.
Category C++, CBitmap, Image, Size
How to Load and Show an image on MFC ?
Load and Show an Image on MFC. In this way, you can load an *.bmp Image to show on a component on you MFC form
// Load an Bitmap Image
// How to use these functions ?
Example:
Category Bitmap, C++, Image, Load, Show
How to Convert IplImage* to HBITMAP
Some time you want to show the picture and the result picture that process by OpenCV (IplImage*) on MFC form, so you must convert IplImage* to HBITMAP. I think have many way to do that, but this is a simplest way, you can try it:
Category C++, Convert, HBITMAP, Image, IplImage
[C#] Write Text File
This function creates a text file when it runs. In the directory where you give in filePath and strContent you want to write. If you view the contents of this file, you'll see the following textual representation of the date and time when the program last ran.
Category C#, File, Text, Write
[C#] Read Text file Line by Line
Here is the code to read a text file from disk one line at a time into a string. This code ensures the file exists and properly closes the file if an exception occurs.
Use these namespaces
// Use this function
How to Convert CString to string ?
Convert CString to string ...
You can get CString from many function that used in C++ and MFC, (ex: GetDlgItemText()). In some case, another function requires string type. Use can use this code
LPCTSTR Convert_CString2String (CString strVar){// Convert CString to CW2ACT2CA pszConvertedAnsiString (strVar);// Use CW2A to stringstring strResult(pszConvertedAnsiString);return strResult;}
Category C++, Convert, CString, MFC, string