You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/dotnet/how-to-add-command-routing-to-the-windows-forms-control.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,9 +36,9 @@ translation.priority.ht:
36
36
# How to: Add Command Routing to the Windows Forms Control
37
37
[CWinFormsView](../mfc/reference/cwinformsview-class.md) routes commands and update-command UI messages to the user control to allow it to handle MFC commands (for example, frame menu items and toolbar buttons).
38
38
39
-
The user control uses [ICommandTarget::Initialize](../mfc/reference/icommandtarget-interface.md#icommandtarget__initialize) to store a reference to the command source object in `m_CmdSrc`, as shown in the following example. To use `ICommandTarget` you must add a reference to mfcmifc80.dll.
39
+
The user control uses [ICommandTarget::Initialize](../mfc/reference/icommandtarget-interface.md#initialize) to store a reference to the command source object in `m_CmdSrc`, as shown in the following example. To use `ICommandTarget` you must add a reference to mfcmifc80.dll.
40
40
41
-
`CWinFormsView` handles several of the common MFC view notifications by forwarding them to the managed user control. These notifications include the [OnInitialUpdate](../mfc/reference/iview-interface.md#iview__oninitialupdate), [OnUpdate](../mfc/reference/iview-interface.md#iview__onupdate) and [OnActivateView](../mfc/reference/iview-interface.md#iview__onactivateview) methods.
41
+
`CWinFormsView` handles several of the common MFC view notifications by forwarding them to the managed user control. These notifications include the [OnInitialUpdate](../mfc/reference/iview-interface.md#oninitialupdate), [OnUpdate](../mfc/reference/iview-interface.md#onupdate) and [OnActivateView](../mfc/reference/iview-interface.md#onactivateview) methods.
42
42
43
43
This topic assumes you have previously completed [How to: Create the User Control and Host in a Dialog Box](../dotnet/how-to-create-the-user-control-and-host-in-a-dialog-box.md) and [How to: Create the User Control and Host MDI View](../dotnet/how-to-create-the-user-control-and-host-mdi-view.md).
Copy file name to clipboardExpand all lines: docs/dotnet/how-to-call-properties-and-methods-of-the-windows-forms-control.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ translation.priority.ht:
38
38
- "zh-tw"
39
39
---
40
40
# How to: Call Properties and Methods of the Windows Forms Control
41
-
Because [CWinFormsView::GetControl](../mfc/reference/cwinformsview-class.md#cwinformsview__getcontrol) returns a pointer to <xref:System.Windows.Forms.Control?displayProperty=fullName>, and not a pointer to `WindowsControlLibrary1::UserControl1`, it is advisable to add a member of the user control type and initialize it in [IView::OnInitialUpdate](.../mfc/reference/iview-interface.md#iview__oninitialupdate). Now you can call methods and properties using `m_ViewControl`.
41
+
Because [CWinFormsView::GetControl](../mfc/reference/cwinformsview-class.md#getcontrol) returns a pointer to <xref:System.Windows.Forms.Control?displayProperty=fullName>, and not a pointer to `WindowsControlLibrary1::UserControl1`, it is advisable to add a member of the user control type and initialize it in [IView::OnInitialUpdate](.../mfc/reference/iview-interface.md#oninitialupdate). Now you can call methods and properties using `m_ViewControl`.
42
42
43
43
This topic assumes you have previously completed [How to: Create the User Control and Host in a Dialog Box](../dotnet/how-to-create-the-user-control-and-host-in-a-dialog-box.md) and [How to: Create the User Control and Host MDI View](../dotnet/how-to-create-the-user-control-and-host-mdi-view.md).
Copy file name to clipboardExpand all lines: docs/dotnet/how-to-create-the-user-control-and-host-mdi-view.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ The following steps show how to create a .NET Framework user control, author the
97
97
};
98
98
```
99
99
100
-
If you want add additional views to your MDI application, you will need to call [CWinApp::AddDocTemplate](../mfc/reference/cwinapp-class.md#cwinapp__adddoctemplate) for each view you create.
100
+
If you want add additional views to your MDI application, you will need to call [CWinApp::AddDocTemplate](../mfc/reference/cwinapp-class.md#adddoctemplate) for each view you create.
101
101
102
102
7. Modify the MFC02View.cpp file to change CView to CWinFormsView in the IMPLEMENT_DYNCREATE macro and message map and replace the existing empty constructor with the constructor shown below:
Copy file name to clipboardExpand all lines: docs/dotnet/how-to-do-ddx-ddv-data-binding-with-windows-forms.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,16 +34,16 @@ translation.priority.ht:
34
34
- "zh-tw"
35
35
---
36
36
# How to: Do DDX/DDV Data Binding with Windows Forms
37
-
[DDX_ManagedControl](http://msdn.microsoft.com/Library/61b55a90-c993-478e-9dea-db27fbf0e193) calls [CWinFormsControl::CreateManagedControl](../mfc/reference/cwinformscontrol-class.md#cwinformscontrol__createmanagedcontrol) to create a control matching the resource control ID. If you use `DDX_ManagedControl` for a `CWinFormsControl` control (in wizard-generated code), you should not call `CreateManagedControl` explicitly for the same control.
37
+
[DDX_ManagedControl](http://msdn.microsoft.com/Library/61b55a90-c993-478e-9dea-db27fbf0e193) calls [CWinFormsControl::CreateManagedControl](../mfc/reference/cwinformscontrol-class.md#createmanagedcontrol) to create a control matching the resource control ID. If you use `DDX_ManagedControl` for a `CWinFormsControl` control (in wizard-generated code), you should not call `CreateManagedControl` explicitly for the same control.
38
38
39
-
Call `DDX_ManagedControl` in [CWnd::DoDataExchange](../mfc/reference/cwnd-class.md#cwnd__dodataexchange) to create controls from resource IDs. For data exchange, you do not need to use the DDX/DDV functions with Windows Forms controls. Instead, you can place code to access the properties of the managed control in the `DoDataExchange` method of your dialog (or view) class, as in the following example.
39
+
Call `DDX_ManagedControl` in [CWnd::DoDataExchange](../mfc/reference/cwnd-class.md#dodataexchange) to create controls from resource IDs. For data exchange, you do not need to use the DDX/DDV functions with Windows Forms controls. Instead, you can place code to access the properties of the managed control in the `DoDataExchange` method of your dialog (or view) class, as in the following example.
40
40
41
41
The following example shows how to bind a native C++ string to a .NET user control.
42
42
43
43
## Example
44
44
The following is an example of DDX/DDV data binding of an MFC string `m_str` with the user-defined `NameText` property of a .NET user control.
45
45
46
-
The control is created when [CDialog::OnInitDialog](../mfc/reference/cdialog-class.md#cdialog__oninitdialog) calls `CMyDlg::DoDataExchange` for the first time, so any code that references `m_UserControl` must come after the `DDX_ManagedControl` call.
46
+
The control is created when [CDialog::OnInitDialog](../mfc/reference/cdialog-class.md#oninitdialog) calls `CMyDlg::DoDataExchange` for the first time, so any code that references `m_UserControl` must come after the `DDX_ManagedControl` call.
47
47
48
48
You can implement this code in the MFC01 application you created in [How to: Create the User Control and Host in a Dialog Box](../dotnet/how-to-create-the-user-control-and-host-in-a-dialog-box.md).
Copy file name to clipboardExpand all lines: docs/dotnet/how-to-migrate-to-clr.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ This topic discusses issues that arise when compiling native code with **/clr**
43
43
## Known Issues Compiling Library Projects with /clr
44
44
Visual Studio contains some known issues when compiling library projects with **/clr**:
45
45
46
-
- Your code may query types at runtime with [CRuntimeClass::FromName](../mfc/reference/cruntimeclass-structure.md#cruntimeclass__fromname). However, if a type is in an MSIL .dll (compiled with **/clr**), the call to `FromName` may fail if it occurs before the static constructors run in the managed .dll (you will not see this problem if the FromName call happens after code has executed in the managed .dll). To work around this problem, you can force the construction of the managed static constructor by defining a function in the managed .dll, exporting it, and invoking it from the native MFC application. For example:
46
+
- Your code may query types at runtime with [CRuntimeClass::FromName](../mfc/reference/cruntimeclass-structure.md#fromname). However, if a type is in an MSIL .dll (compiled with **/clr**), the call to `FromName` may fail if it occurs before the static constructors run in the managed .dll (you will not see this problem if the FromName call happens after code has executed in the managed .dll). To work around this problem, you can force the construction of the managed static constructor by defining a function in the managed .dll, exporting it, and invoking it from the native MFC application. For example:
A pointer to the data type of the Windows Forms user control. For more information, see <xref:System.TypequalifyHint%3DTrue%26autoUpgrade%3DTrue>.
93
+
A pointer to the data type of the Windows Forms user control.
94
94
95
95
### Example
96
96
In the following example, the `CUserView` class inherits from `CWinFormsView` and passes the type of `UserControl1` to the `CWinFormsView` constructor. `UserControl1` is a custom-built control in ControlLibrary1.dll.
This example shows how to provide a custom compare function. It uses the [std::complex::real](../../standard-library/complex-class.md#complex__real) method to sort [std::complex\<double>](../../standard-library/complex-double.md) values in ascending order.
280
+
This example shows how to provide a custom compare function. It uses the [std::complex::real](../../standard-library/complex-class.md#real) method to sort [std::complex\<double>](../../standard-library/complex-double.md) values in ascending order.
Copy file name to clipboardExpand all lines: docs/parallel/multithreading-creating-user-interface-threads.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,12 +49,12 @@ A user-interface thread is commonly used to handle user input and respond to use
49
49
|Function|Purpose|
50
50
|--------------|-------------|
51
51
52
-
|[ExitInstance](../mfc/reference/cwinthread-class.md#cwinthread__exitinstance)|Perform cleanup when thread terminates. Usually overridden.|
53
-
|[InitInstance](../mfc/reference/cwinthread-class.md#cwinthread__initinstance)|Perform thread instance initialization. Must be overridden.|
54
-
|[OnIdle](../mfc/reference/cwinthread-class.md#cwinthread__onidle)|Perform thread-specific idle-time processing. Not usually overridden.|
55
-
|[PreTranslateMessage](../mfc/reference/cwinthread-class.md#cwinthread__pretranslatemessage)|Filter messages before they are dispatched to **TranslateMessage** and **DispatchMessage**. Not usually overridden.|
56
-
|[ProcessWndProcException](../mfc/reference/cwinthread-class.md#cwinthread__processwndprocexception)|Intercept unhandled exceptions thrown by the thread's message and command handlers. Not usually overridden.|
57
-
|[Run](../mfc/reference/cwinthread-class.md#cwinthread__run)|Controlling function for the thread. Contains the message pump. Rarely overridden.|
52
+
|[ExitInstance](../mfc/reference/cwinthread-class.md#exitinstance)|Perform cleanup when thread terminates. Usually overridden.|
53
+
|[InitInstance](../mfc/reference/cwinthread-class.md#initinstance)|Perform thread instance initialization. Must be overridden.|
54
+
|[OnIdle](../mfc/reference/cwinthread-class.md#onidle)|Perform thread-specific idle-time processing. Not usually overridden.|
55
+
|[PreTranslateMessage](../mfc/reference/cwinthread-class.md#pretranslatemessage)|Filter messages before they are dispatched to **TranslateMessage** and **DispatchMessage**. Not usually overridden.|
56
+
|[ProcessWndProcException](../mfc/reference/cwinthread-class.md#processwndprocexception)|Intercept unhandled exceptions thrown by the thread's message and command handlers. Not usually overridden.|
57
+
|[Run](../mfc/reference/cwinthread-class.md#run)|Controlling function for the thread. Contains the message pump. Rarely overridden.|
58
58
59
59
60
60
MFC provides two versions of `AfxBeginThread` through parameter overloading: one that can only create worker threads and one that can create user-interface threads or worker threads. To start your user-interface thread, call the second overload of [AfxBeginThread](http://msdn.microsoft.com/library/e9e8684d-24f7-4599-8fdf-1f4f560a753b), providing the following information:
@@ -69,7 +69,7 @@ A user-interface thread is commonly used to handle user input and respond to use
69
69
70
70
- (Optional) The desired security attributes. The default is the same access as the parent thread. For more information about the format of this security information, see [SECURITY_ATTRIBUTES](http://msdn.microsoft.com/library/windows/desktop/aa379560) in the [!INCLUDE[winsdkshort](../atl-mfc-shared/reference/includes/winsdkshort_md.md)].
71
71
72
-
`AfxBeginThread` does most of the work for you. It creates a new object of your class, initializes it with the information you supply, and calls [CWinThread::CreateThread](../mfc/reference/cwinthread-class.md#cwinthread__createthread) to start executing the thread. Checks are made throughout the procedure to make sure all objects are deallocated properly should any part of the creation fail.
72
+
`AfxBeginThread` does most of the work for you. It creates a new object of your class, initializes it with the information you supply, and calls [CWinThread::CreateThread](../mfc/reference/cwinthread-class.md#createthread) to start executing the thread. Checks are made throughout the procedure to make sure all objects are deallocated properly should any part of the creation fail.
Copy file name to clipboardExpand all lines: docs/parallel/multithreading-terminating-threads.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,7 +69,7 @@ Two normal situations cause a thread to terminate: the controlling function exit
69
69
70
70
- Set the `m_bAutoDelete` data member to **FALSE**. This allows the `CWinThread` object to survive after the thread has been terminated. You can then access the `m_hThread` data member after the thread has been terminated. If you use this technique, however, you are responsible for destroying the `CWinThread` object because the framework will not automatically delete it for you. This is the preferred method.
71
71
72
-
- Store the thread's handle separately. After the thread is created, copy its `m_hThread` data member (using **::DuplicateHandle**) to another variable and access it through that variable. This way the object is deleted automatically when termination occurs and you can still find out why the thread terminated. Be careful that the thread does not terminate before you can duplicate the handle. The safest way to do this is to pass **CREATE_SUSPENDED** to [AfxBeginThread](http://msdn.microsoft.com/library/e9e8684d-24f7-4599-8fdf-1f4f560a753b), store the handle, and then resume the thread by calling [ResumeThread](../topic/../mfc/reference/cwinthread-class.md#cwinthread__resumethread).
72
+
- Store the thread's handle separately. After the thread is created, copy its `m_hThread` data member (using **::DuplicateHandle**) to another variable and access it through that variable. This way the object is deleted automatically when termination occurs and you can still find out why the thread terminated. Be careful that the thread does not terminate before you can duplicate the handle. The safest way to do this is to pass **CREATE_SUSPENDED** to [AfxBeginThread](http://msdn.microsoft.com/library/e9e8684d-24f7-4599-8fdf-1f4f560a753b), store the handle, and then resume the thread by calling [ResumeThread](../topic/../mfc/reference/cwinthread-class.md#resumethread).
73
73
74
74
Either method allows you to determine why a `CWinThread` object terminated.
Copy file name to clipboardExpand all lines: docs/windows/custom-controls-in-the-dialog-editor.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ The Dialog editor lets you use existing "custom" or "user" controls in a dialog
44
44
> [!NOTE]
45
45
> Custom controls in this sense are not to be confused with ActiveX controls. ActiveX controls were sometimes called OLE custom controls. Also, don't confuse these controls with the owner-drawn controls in Windows.
46
46
47
-
This functionality is intended to let you use controls other than those supplied by Windows. At run time, the control is associated with a window class (not the same as a C++ class). A more common way to accomplish the same task is to install any control, such as a static control, in your dialog box. Then at run time, in the [OnInitDialog](../mfc/reference/cdialog-class.md#cdialog__oninitdialog) function, remove that control and replace it with your own custom control.
47
+
This functionality is intended to let you use controls other than those supplied by Windows. At run time, the control is associated with a window class (not the same as a C++ class). A more common way to accomplish the same task is to install any control, such as a static control, in your dialog box. Then at run time, in the [OnInitDialog](../mfc/reference/cdialog-class.md#oninitdialog) function, remove that control and replace it with your own custom control.
48
48
49
49
This is an old technique. Today you are advised in most cases to write an ActiveX control or subclass a Windows common control.
0 commit comments