C# for MFC programmers Quick Equivalents Map
This list is by no means intended to be comprehensive. I am learning C#, and as I've had to look something up, I record it here. I figure if I had to look it up, you will, too. If you have entries to contribute based on your own experience, or if you discover an error caused by my own naiveté in C#, feel free to send them. I won't attribute each individual contributions, but I will add you to a "contributions by..." section at the end. If you want your email or your Web site included in the attributions list, please say so explicitly; otherwise I will just put your name there. Or, if you want to remain anonymous, tell me and I will hog all the credit myself.
Useful Web Sites
I've discovered a number of useful Web sites for beginning C# programmers. Included in no particular order,
- http://www.syncfusion.com/FAQ/
winforms/default.asp - http://www.syncfusion.com/faq/
winforms/627.asp (owner-drawn ListBox) - http://www.wintoolzone.com/
dotnetcom.aspx
My FAQ
A | B | C | D | E | F | G | H | I | J | K | L | M |
N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
C/MFC concept | C# | ||||
A | |||||
abs | Math.Abs | ||||
| int n = ...; |
| int n = ...; | ||
int n = -2147483648; // largest negative # | int n = -2147483648; but the following works! uint u = unchecked(n <> | ||||
.AddString(...) (CListBox) | .Items.Add(...) (CListBox) | ||||
AfxMessageBox | MessageBox.Show | ||||
| UINT n = |
| DialogResult n = | ||
See MessageBox | |||||
atoi | Parse | ||||
| CString s; |
| String s | ||
atol | Parse | ||||
| CString s; |
| String s | ||
|
| ||||
B | |||||
BOOL | Boolean | ||||
bool | Boolean | ||||
|
| ||||
BS_PUSHLIKE | Drag a check box onto the form. Select its Appearance property as Button | ||||
|
| ||||
|
| ||||
|
| ||||
|
| ||||
BYTE | byte | ||||
C | |||||
CBitmap | Bitmap (actually, a GDI+ bitmap) | ||||
CBrush | Brush | ||||
CDC | Graphics | ||||
CClientDC | Graphics | ||||
| CClientDC dc(&c_Ctl) |
| Graphics g = | ||
ceil | Math.Ceiling | ||||
CenterWindow (CWnd) | .StartPosition = FormStartPosition.CenterParent (can be set at design time) | ||||
CFileDialog | Create an object (usually in the forms design template) of type SaveFileDialog or OpenFileDialog. Use the ShowDialog method to invoke it. | ||||
CFont | Font | ||||
char (as a character type) | char | ||||
|
|
| Note however that char in C# means Unicode character and is not the same as byte or the concept in C/C++ known as char. Signedness is not a characteristic of the C# char type. It is conceptually closer to the C/C++ WCHAR type. | ||
char (as a signed 8-bit integer) | sbyte | ||||
CListBox::AddString(...) (CListBox) | CListBox.Items.Add(...) (CListBox) | ||||
CListBox.GetLBText(n) (CListBox) | CListBox.GetItemText(n) | ||||
COLOR_ constants | See GetSysColor | ||||
COLORREF | Color | ||||
COLORREF r = |
| Color c = | |||
This actually oversimplifies, or over complicates, the problem. C# contains a number of "predefined color names", many with really obscure names and no good graphical representation in the Help system of what they look like. However, RGB(255,0,0) is the name .Red. The names appear to conform to the HTML naming conventions. You can also name system colors. See GetSysColor. | Argb stands for the 4-tuple, Alpha, Red, Green, Blue, and the overload with three arguments assumes Alpha (transparency) is 255 (completely opaque). | ||||
COLORREF r = RGB(255,0,0) | Color c = Color.Red; | ||||
CPaintDC | The .Graphics member of the System.Windows.Forms. | ||||
CPen | Pen | ||||
|
| ||||
CSize | Size (integer values) | ||||
| CSize sz = ...; |
| SizeF sz = ...; | ||
This is an oversimplification because the fields of a SizeF are floats and not integers! | |||||
CSpinCtrl (with CEdit buddy control) | NumericUpDown | ||||
CString | String | ||||
CString::Find(CString s) | String.IndexOf(String s) | ||||
CString::Format | Format | ||||
| CString s; |
| String s; | ||
| Formatting specifications in C# are much more flexible than in traditional C. For example, you can associate several format requests with the same argument, and the formatting options are richer, including localized date, time, and currency representations. Instead of %, the format specifiers in C# are enclosed in {}, and are of the form {n:Fp} where n specifies the argument in the formatting string (the n: can be omitted in the ToString method call), F is a format specifier, and p is the precision. | ||||
%d | {n:d} or {n:D} | ||||
%02d | {n:d2} or {n:D2} | ||||
%o | octal is not supported | ||||
%ld | {n:d} No special handling is required for int values | ||||
%I64d | {n:d} No special handling is required for 64-bit int values | ||||
%x | {n:x} | ||||
%X | {n:X} | ||||
CWnd::GetClientRect() | ClientRectangle (property) | ||||
CWnd::Invalidate() | .Invalidate() | ||||
CWnd::InvalidateRect(&r) | .Invalidate(...); | ||||
CWnd::ShowWindow(SW_SHOW) | .Visible = true; | ||||
CWnd::ShowWindow(SW_HIDE); | .Visible = false; | ||||
|
| ||||
CString.GetLength(); | String.Length; | ||||
D | |||||
DeleteDC | No need to; implicitly handled by the Graphics destructor during garbage collection. | ||||
DestroyWindow | Close | ||||
DoModal | .ShowDialog | ||||
double | double | ||||
DrawItem (CListBox) | DrawItem event | ||||
DWORD | uint | ||||
E | |||||
.Ellipse | .DrawEllipse | ||||
| CClientDC dc(&wnd); |
| Graphics g = wnd.CreateGraphics(); | ||
EndDialog(IDCancel) | Close | ||||
EndDialog(IDOK) | Close | ||||
exp | Math.Exp | ||||
F | |||||
|
| ||||
.Find (CString) | .IndexOf (String) | ||||
|
| ||||
float | float | ||||
.Format | see CString::Format | ||||
G | |||||
GetBValue | .B | ||||
| COLORREF c = ...; |
| Color c = ...; | ||
.GetClientRect() | .ClientRectangle (property) | ||||
| CRect r; |
| Rectangle r = | ||
GetCurSel (CComboBox) | ... = ComboBox.SelectedIndex; | ||||
GetDC | Graphics | ||||
| CDC * dc = wnd.GetDC(); |
| Graphics g = | ||
GetFont | .Font | ||||
| CFont * f = wnd.GetFont(); |
| Font f = wnd.Font; | ||
GetGValue | .G | ||||
| COLORREF c = ...; |
| Color c = ...; | ||
.GetLBText(n) (CListBox) | .GetItemText(n) | ||||
.GetLBText(n) (CComboBox) | .GetSelectedItem.ToString(); | ||||
.GetLength() (CString) | s.Length | ||||
.GetMiterLimit (CDC) | ... = Pen.MiterLimit; | ||||
GetModuleFileName | System.Windows.Forms. | ||||
| TCHAR name[MAX_PATH]; |
| String name = System.Windows.Forms. | ||
GetPos (CSpinCtrl) | NumericUpDown.Value Note that the values of .Minimum, .Maximum, and .Value are of type decimal. This means that to assign a value which is a fractional value, you have to use a decimal constant. To use the values, you may have to cast them from decimal to int or float. | ||||
GetRange (CSpinCtrl) | NumericUpDown.Maximum and Note that the values of .Minimum, .Maximum, and .Value are of type decimal. This means that to assign a value which is a fractional value, you have to use a decimal constant. To use the values, you may have to cast them from decimal to int or float. | ||||
GetRValue | .R | ||||
| COLORREF c = ...; |
| Color c = ...; | ||
.GetSize() (CArray) | s.Length | ||||
GetSysColor | Color.FromKnownColor( | ||||
COLORREF c = ::GetSysColor(COLOR_WINDOW) |
| Color.KnownColor.Window | |||
COLOR_3DDKSHADOW | Color.KnownColor. | ||||
COLOR_3DFACE | Color.KnownColor.Control (?) | ||||
COLOR_3DHIGHLIGHT | Color.KnownColor.ControlLight (?) | ||||
COLOR_3DHILIGHT | Color.KnownColor.ControlLight (?) | ||||
COLOR_3DLIGHT | Color.KnownColor.? | ||||
COLOR_ACTIVEBORDER | Color.KnownColor.ActiveBorder | ||||
COLOR_ACTIVECAPTION | Color.KnownColor.ActiveCaption | ||||
COLOR_APPWORKSPACE | Color.KnownColor.AppWorkspace | ||||
COLOR_BACKGROUND | Color.KnownColor.Desktop | ||||
COLOR_BTNFACE | Color.KnownColor.Control (?) | ||||
COLOR_BTNHIGHLIGHT | Color.KnownColor.ControlLight (?) | ||||
COLOR_BTNHILIGHT | Color.KnownColor.ControlLight (?) | ||||
COLOR_BTNSHADOW | Color.KnownColor.ControlDark (?) | ||||
COLOR_BTNTEXT | Color.KnownColor.ControlText | ||||
COLOR_CAPTIONTEXT |
| ||||
COLOR_DESKTOP | Color.KnownColor.Desktop | ||||
COLOR_GRADIENTACTIVECAPTION |
| ||||
COLOR_GRADIENTINACTIVECAPTION |
| ||||
COLOR_GRAYTEXT | Color.KnownColor.GrayText | ||||
COLOR_HIGHLIGHT | Color.KnownColor.Highlight | ||||
COLOR_HIGHLIGHTTEXT | Color.KnownColor.HighlightText | ||||
COLOR_HOTLIGHT | Color.KnownColor.HotTrack (?) | ||||
COLOR_INACTIVEBORDER | Color.KnownColor. | ||||
COLOR_INACTIVECAPTION | Color.KnownColor. | ||||
COLOR_INACTIVECAPTIONTEXT | Color.KnownColor. | ||||
COLOR_INFOBK |
| ||||
COLOR_INFOTEXT | Color.KnownColor.InfoText | ||||
COLOR_MENU | Color.KnownColor.Menu | ||||
COLOR_MENUTEXT | Color.KnownColor.MenuText | ||||
COLOR_SCROLLBAR | Color.KnownColor.ScrollBar | ||||
COLOR_WINDOW | Color.KnownColor.Window | ||||
COLOR_WINDOWFRAME | Color.KnownColor.WindowFrame | ||||
COLOR_WINDOWTEXT | Color.KnownColor.WindowText | ||||
GetSystemMetrics | System.Windows.Forms. | ||||
GetTextExtent | MeasureString | ||||
| CClientDC dc(&wnd); |
| Graphics g = wnd.CreateGraphics(); | ||
GetTickCount | DateTime.Now.Ticks | ||||
GetUserName | System.Environment.UserName | ||||
GWL_DLGRESULT | Closing event, DialogResult property | ||||
| void CMyDialog::OK() |
| select the Closing event for the form and type a name of the function you want, such as OnClosing private void OnClosing( | ||
H | |||||
HBITMAP | Bitmap (actually, a GDI+ bitmap) | ||||
HBRUSH | Brush | ||||
HDC | Graphics (see CDC) | ||||
HPEN | Pen | ||||
I | |||||
_I64_MAX | Int64.MaxValue | ||||
_I64_MIN | Int64.MinValue | ||||
int | int | ||||
__int64 | long | ||||
INT_MAX | Int32.MaxValue | ||||
INT_MIN | Int32.MinValue | ||||
.Invalidate() | .Invalidate(); | ||||
.InvalidateRect | .Invalidate(); | ||||
| CRect r; |
| Rectangle r; | ||
itoa | ToString | ||||
%d | 3 |
| int v; | ||
%3d | ··3 (leading spaces) | int v;
String s; s = String.Format("{0,3:d}", v); | |||
%03d | 003 | int v = 3; | |||
%03d | 003 | int v = 3; | |||
K | |||||
KillTimer | place a timer object on the form and give it a name
timer.Stop(); | ||||
L | |||||
|
| ||||
LineTo | DrawLine | ||||
CClientDC dc(&wnd); |
| Graphics g = wnd.CreateGraphics(); | |||
CClientDC dc(&wnd); | Graphics g = wnd.CreateGraphics(); | ||||
::LoadCursor(NULL, cursorid) | No equivalent. See OnSetCursor | ||||
long | int | ||||
LONG | int | ||||
LONGLONG | long | ||||
M | |||||
MessageBox | MessageBox.Show | ||||
| UINT n = |
| DialogResult n = | ||
| buttons can be any of the following: | ||||
MB_ABORTRETRYIGNORE |
| MessageBoxButtons. | |||
MB_HELP |
| no equivalent | |||
MB_OK |
| MessageBoxButtons.OK | |||
MB_OKCANCEL |
| MessageBoxButtons.OKCancel | |||
MB_OKRETRY |
| MessageBoxButtons.OKRetry | |||
MB_YESNO |
| MessageBoxButtons.YesNo | |||
MB_YESNOCANCEL |
| MessageBoxButtons.YesNoCancel | |||
| icon is optional and can be any of | ||||
MB_ASTERISK | MessageBoxIcon.Asterisk Note: this code should be considered obsolete; .Information should be used instead | ||||
MB_ERROR | MessageBoxIcon.Error | ||||
MB_EXCLAMATION | MessageBoxIcon.Exclamation Note: this code should be considered obsolete; .Warning should be used instead | ||||
MB_HAND | MessageBoxIcon.Hand Note: this code should be considered obsolete; .Error should be used instead | ||||
MB_INFORMATION | MessageBoxIcon.Information | ||||
|
| MessageBoxIcon.None | |||
MB_ICONQUESTION | MessageBoxIcon.Question | ||||
MB_ICONSTOP | MessageBoxIcon.Stop Note: this code should be considered obsolete; .Error should be used instead | ||||
MB_ICONWARNING | MessageBoxIcon.Warning | ||||
MB_USERICON |
| no equivalent | |||
| The default button can be one of the following | ||||
| MB_DEFBUTTON1 |
| MessageBoxDefaultButton. | ||
MB_DEFBUTTON2 | MessageBoxDefaultButton. | ||||
MB_DEFBUTTON3 | MessageBoxDefaultButton. | ||||
MB_DEFBUTTON4 | no equivalent | ||||
The return value can be one of the following | |||||
| IDABORT |
| DialogResult.Abort | ||
IDCANCEL | DialogResult.Cancel | ||||
IDIGNORE | DialogResult.Ignore | ||||
IDNO | DialogResult.No | ||||
There is no equivalent to this value in the standard API | DialogResult.None | ||||
IDOK | DialogResult.OK | ||||
IDRETRY | DialogResult.Retry | ||||
IDYES | DialogResult.Yes | ||||
MoveTo | DrawLine | ||||
CClientDC dc(&wnd); |
| Graphics g = wnd.CreateGraphics(); | |||
CClientDC dc(&wnd); | Graphics g = wnd.CreateGraphics(); | ||||
MoveWindow | .Location (changes only the top-left origin) | ||||
| // Move window to X, Y retaining size |
| ctl.Location = new Point(X, Y); Note that accessing the .Location member returns a copy of the Point value, so changing the values in this will not change the size in the control itself, e.g., ctl.Location.x = X; // does not work changes only the value in the copy. You must assign a complete Point object to the .Location member. | ||
MoveWindow | .Size (changes only the size) | ||||
| // Change window to size W,H in same place |
| ctl.Size = new Size(X, Y); or you can change each dimension independently ctl.Width = W; Note that accessing the .Size member returns a copy of the Size value, so changing the values in this will not change the size in the control itself, e.g., ctl.Size.Width = W; // does not work changes only the value in the copy. You must assign a complete Size object to the .Size member, or assign independently to the .Width or .Height members | ||
N | |||||
NULL | null | ||||
O | |||||
|
| ||||
OnClose | Closing event | ||||
| void CMyWnd::OnClose() |
| select the Closing event for the form and type a name of the function you want, such as OnClosing private void OnClosing( | ||
OnDestroy | Closed event | ||||
| void CMyWnd::OnDestroy() { ... } |
| select the Closing event for the form and type a name of the function you want, such as OnClosed private void OnClosing(Object sender, | ||
OnVScroll(...) | Create a ScrollEvent handler | ||||
| switch(nSBCode) |
| switch(e.Type) | ||
SB_PAGEUP | ScrollEventType.LargeDecrement | ||||
SB_PAGEDOWN | ScrollEventType.LargeIncrement | ||||
SB_LINEUP | ScrollEventType.SmallDecrement | ||||
SB_LINEDOWN | ScrollEventType.SmallIncrement | ||||
SB_TOP | ScrollEventType.First | ||||
SB_BOTTOM | ScrollEventType.Last | ||||
SB_THUMBPOSITION | ScrollEventType.ThumbPosition | ||||
SB_THUMBTRACK | ScrollEventType.ThumbTrack | ||||
SB_ENDSCROLL | ScrollEventType.EndPos | ||||
|
| ||||
OnInitDialog | Load event | ||||
OnLButtonDown | MouseDown event | ||||
OnLButtonUp | MouseUp event | ||||
OnMouseMove | MouseMove event | ||||
OnMove | LocationChanged event | ||||
OnPaint | OnPaint event | ||||
OnSetCursor | No equivalent; cursor is set using the Cursor property of the window whose cursor is to be set. See SetCursor | ||||
OnSize | SizeChanged event | ||||
P | |||||
PostMessage | BeginInvoke | ||||
| ON_MESSAGE(UWM_MYMESSAGE, OnMyMessage) LRESULT CMyClass::OnMyMessage( void CMyClass::DoSomething() |
| public delegate class CMyClass { public void DoSomething() | ||
|
|
| As with many C# equivalences, this is an oversimplification of a far more sophisticated concept. For example, in C# you can actually receive a callback when the message is handled, or wait for the receiving thread to process it. | ||
PostQuitMessage(0) | Close() | ||||
pow | Math.Pow | ||||
printf | System.Console.Write | ||||
| printf("%s", string); |
| CString string; | ||
printf("%s\n", string); |
| CString string; | |||
CString string; | |||||
puts | System.Console.Write | ||||
| CString string; |
| CString string; | ||
R | |||||
.Rectangle | .DrawRectangle | ||||
| CClientDC dc(&wnd); |
| Graphics g = wnd.CreateGraphics(); | ||
ReleaseDC | No need to; implicitly handled by the Graphics destructor during garbage collection. | ||||
.ResetContent | listbox.Items.Clear() | ||||
.RestoreDC (CDC) | .Restore (graphics) | ||||
| CClientDC dc(&wnd); |
| Graphics g = wnd.CreateGraphics(); | ||
.ReverseFind (CString) | .LastIndexOf | ||||
RGB | .FromArgb | ||||
COLORREF r = |
| Color c = | |||
This actually oversimplifies, or over complicates, the problem. C# contains a number of "predefined color names" with really obscure names and no good graphical representation in the Help system of what they look like. The names correspond to the standard names used in HTML. However, as an example, RGB(255,0,0) is the name .Red | Argb stands for the 4-tuple, Alpha, Red, Green, Blue, and the overload with three arguments assumes Alpha (transparency) is 255 (completely opaque). | ||||
COLORREF r = RGB(255,0,0) | Color c = Color.Red; | ||||
S | |||||
.SaveDC (CDC) | .Save (graphics) | ||||
| CClientDC dc(&wnd); |
| Graphics g = wnd.CreateGraphics(); | ||
SetCurSel (CComboBox) | ComboBox.SelectedIndex = ...; | ||||
::SetCursor(AfxGetApp()-> | .Cursor = Cursors.id | ||||
IDC_APPSTARTING | Cursors.AppStarting | ||||
IDC_ARROW | Cursors.Arrow | ||||
IDC_CROSS | Cursors.Cross | ||||
no equivalent |
| Cursors.Default | |||
IDC_HAND | Cursors.Hand | ||||
IDC_HELP | Cursors.Help | ||||
no equivalent | Cursors.HSplit | ||||
IDC_IBEAM | Cursors.IBeam | ||||
IDC_NO | Cursors.No | ||||
no equivalent | Cursors.NoMove2D | ||||
no equivalent | Cursors.NoMoveHoriz | ||||
no equivalent | Cursors.NoMoveVert | ||||
no equivalent | Cursors.PanEast | ||||
no equivalent | Cursors.PanNE | ||||
no equivalent | Cursors.PanNorth | ||||
no equivalent | Cursors.PanNW | ||||
no equivalent | Cursors.PanSE | ||||
no equivalent | Cursors.PanSouth | ||||
no equivalent | Cursors.PanSW | ||||
no equivalent | Cursors.PanWest | ||||
IDC_SIZEALL | Cursors.SizeAll | ||||
IDC_SIZENESW | Cursors.SizeNESW | ||||
IDC_SIZENS | Cursors.SizeNS | ||||
IDC_SIZESWNE | Cursors.SizeSWNE | ||||
IDC_SIZEWE | Cursors.SizeWE | ||||
IDC_UPARROW | Cursors.UpArrow | ||||
no equivalent | Cursors.VSplit | ||||
IDC_WAIT | Cursors.WaitCursor | ||||
.SetMapMode (CDC) | .PageScale (Graphics) | ||||
MM_TEXT |
| GraphicsUnit.Pixel | |||
MM_LOENGLISH | GraphicsUnit.Inch | ||||
MM_LOMETRIC | GraphicsUnit.Millimeter | ||||
MM_TWIPS (1/1440 inch) | GraphicsUnit.Document (1/300 inch) | ||||
no equivalent | GraphicsUnit.Display (1/72 inch) | ||||
MM_ISOTROPIC | GraphicsUnit.World (closest approximation) | ||||
no equivalent | GraphicsUnit.Display (1/75 inch) | ||||
.SetMiterLimit (CDC) | Pen.MiterLimit = ...; | ||||
.SetPos (CSpinCtrl) | NumericUpDown.Value = ... Note that the values of .Minimum, .Maximum, and .Value are of type decimal. This means that to assign a value which is a fractional value, you have to use a decimal constant. To use the values, you may have to cast them from decimal to int or float. | ||||
.SetRange (CSpinCtrl) | NumericUpDown.Maximum = ... Note that the values of .Minimum, .Maximum, and .Value are of type decimal. This means that to assign a value which is a fractional value, you have to use a decimal constant. To use the values, you may have to cast them from decimal to int or float. | ||||
SetTimer | place a timer object on the form and give it a name timer.Interval = ...; // can be set | ||||
.SetViewPortExt/ | .PageScale (Graphics) | ||||
SetWindowPos | .Location (changes only the top-left origin) | ||||
| // Move window to X, Y retaining size |
| ctl.Location = new Point(X, Y); Note that accessing the .Location member returns a copy of the Point value, so changing the values in this will not change the size in the control itself, e.g., ctl.Location.x = X; // does not work changes only the value in the copy. You must assign a complete Point object to the .Location member. | ||
| // Change size to W, H and don't move |
| ctl.Size = new Size(W, H); or the values can be set independently ctl.Width = W; Note that accessing the .Size member returns a copy of the Size value, so changing the values in this will not change the size in the control itself, e.g., ctl.Size.Width = W; // does not work changes only the value in the copy. You must assign a complete Size object to the .Size member, or assign independently to the .Width or .Height members | ||
ShBrowseForFolder | No good equivalent. KB article 306285 shows how to call the underlying ShBrowseForFolder call in .NET 1.0; in .NET 1.1 there is a FolderBrowserDialog class, but it is not supported in the Common Framework, meaning you can't use it if you expect to run on a Pocket PC. Probably your best bet is to look at the Web site http://www.wintoolzone.com/ where there is an implementation that does not involve the shell API and does not require Common Framework (CF) support. | ||||
ShellExecute | System.Diagnostics.Process. | ||||
SHRT_MAX | Int16.MaxValue | ||||
SHRT_MIN | Int16.MinValue | ||||
short | short | ||||
.ShowWindow(SW_SHOW); | .Visible = true; | ||||
.ShowWindow(SW_HIDE); | .Visible = false; | ||||
sprintf | ToString | ||||
%d | 3 |
| int v; | ||
%3d | ··3 (leading spaces) | No equivalent in C# | |||
%03d | 003 | int v = 3; | |||
%03d | 003 | int v = 3; | |||
strcat | + (applied to String objects) | ||||
strcmp | .Equals | String s1;
String s2; if(s1.Equals(s)) | |||
note that the comparison operators work also; so you can write
if(s1 <> or if(s1 == s2) or if(s1 > s2) as well as !=, <= and >=. | |||||
strrchr | LastIndexOf | ||||
strstr | .Contains | String s;
s = "Permissions"; if(s.Contains("miss")) ... contains the substring | |||
strtol(LPCTSTR, NULL, 16) | int.Parse(String, "x") // throws exception | ||||
|
| ||||
strtol(LPCTSTR, NULL, 10) | int.Parse(String, "d") // throws exception | ||||
strtol(LPCTSTR, NULL, 2) | No equivalent | ||||
strtol(LPCTSTR, NULL, 8) | No equivalent | ||||
|
| ||||
T | |||||
_T(...) | Not needed as all strings and characters are implicitly Unicode strings and characters. | ||||
U | |||||
|
| ||||
UINT | uint | ||||
ULONG | uint | ||||
ULONGLONG | ulong | ||||
unsigned | uint | ||||
unsigned int | uint | ||||
unsigned __int64 | ulong | ||||
W | |||||
WM_CLOSE | Close | ||||
| PostMessage(WM_CLOSE) |
| Close() | ||
WM_DESTROY | Closed event | ||||
| void CMyWnd::OnDestroy() { ... } |
| select the Closing event for the form and type a name of the function you want, such as OnClosed private void OnClosed(Object sender, | ||
WM_INITDIALOG | Load event | ||||
WM_MOVE | LocationChanged event | ||||
WM_SIZE | SizeChanged event | ||||
WORD | ushort |
Acknowledgements
I didn't discover all of this myself. I asked a lot of questions. Thanks to many contributors, especially those in the microsoft.public.dotnet.
- Mike Burton
- Yan-Hong Huang
- Daniel Jebaraj
- Gaurav Khanna
- Mattias Sjögren
- Geert Verkade
No comments:
Post a Comment