Skip to content

Commit b943ef8

Browse files
authored
Added missing MFC ref topics (MicrosoftDocs#232)
* temp commit for new mfc macros functions * added remaining macros and globals * fixed broken links from previous commit
1 parent 4dc462e commit b943ef8

18 files changed

+1709
-76
lines changed

docs/mfc/reference/TOC.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,7 @@
465465
## [Type Casting of MFC Class Objects](type-casting-of-mfc-class-objects.md)
466466
## [Run-Time Object Model Services](run-time-object-model-services.md)
467467
## [Diagnostic Services](diagnostic-services.md)
468+
## [Modules and DLLs](extension-dll-macros.md)
468469
## [Exception Processing](exception-processing.md)
469470
## [CString Formatting and Message-Box Display](cstring-formatting-and-message-box-display.md)
470471
## [Application Information and Management](application-information-and-management.md)
@@ -496,6 +497,7 @@
496497
## [AFX Messages](afx-messages.md)
497498
## [ToolBar Control Styles](toolbar-control-styles.md)
498499
## [CMFCImagePaintArea::IMAGE_EDIT_MODE Enumeration](cmfcimagepaintarea-image-edit-mode-enumeration.md)
500+
## [UICheckState Enumeration](uicheckstate-enumeration.md)
499501
# [Structures, Styles, Callbacks, and Message Maps](structures-styles-callbacks-and-message-maps.md)
500502
## [Structures Used by MFC](structures-used-by-mfc.md)
501503
### [ABC Structure](abc-structure.md)
@@ -560,6 +562,7 @@
560562
### [Callback Function for CDC::SetAbortProc](callback-function-for-cdc-setabortproc.md)
561563
## [Message Maps (MFC)](message-maps-mfc.md)
562564
### [Message Map Macros (MFC)](message-map-macros-mfc.md)
565+
### [Delegate and Interface Map Macros](delegate-and-interface-maps.md)
563566
### [How to: Use the Message-Map Cross-Reference](how-to-use-the-message-map-cross-reference.md)
564567
### [WM_COMMAND Message Handler](wm-command-message-handler.md)
565568
### [Child Window Notification Message Handlers](child-window-notification-message-handlers.md)

docs/mfc/reference/application-control.md

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ translation.priority.ht:
3535
- "zh-tw"
3636
---
3737
# Application Control
38-
OLE requires substantial control over applications and their objects. The OLE system DLLs must be able to launch and release applications automatically, coordinate their production and modification of objects, and so on. The functions in this topic meet those requirements. In addition to being called by the OLE system DLLs, these functions must sometimes be called by applications as well.
38+
OLE requires substantial control over applications and their objects. The OLE system DLLs must be able to launch and release applications automatically, coordinate their production and modification of objects, and so on. The functions in this topic meet those requirements. In addition to being called by the OLE system DLLs, these functions must sometimes be called by applications as well.
3939

4040
### Application Control
4141

@@ -46,9 +46,12 @@ OLE requires substantial control over applications and their objects. The OLE sy
4646
|[AfxOleGetUserCtrl](#afxolegetuserctrl)|Retrieves the current user-control flag.|
4747
|[AfxOleSetUserCtrl](#afxolesetuserctrl)|Sets or clears the user-control flag.|
4848
|[AfxOleLockApp](#afxolelockapp)|Increments the framework's global count of the number of active objects in an application.|
49-
|[AfxOleUnlockApp](#afxoleunlockapp)|Decrements the framework's count of the number of active objects in an application.|
49+
|[AfxOleLockControl](#afxolelockcontrol)| Locks the class factory of the specified control. |
50+
|[AfxOleUnlockApp](#afxoleunlockapp)|Decrements the framework's count of the number of active objects in an application.|
51+
|[AfxOleUnlockControl](#afxoleunlockcontrol)| Unlocks the class factory of the specified control. |
5052
|[AfxOleRegisterServerClass](#afxoleregisterserverclass)|Registers a server in the OLE system registry.|
5153
|[AfxOleSetEditMenu](#afxoleseteditmenu)|Implements the user interface for the *typename* Object command.|
54+
5255

5356
## <a name="afxolecanexitapp"></a> AfxOleCanExitApp
5457
Indicates whether the application can terminate.
@@ -73,7 +76,7 @@ BOOL AFXAPI AfxOleCanExitApp();
7376
Retrieves the application's current message filter.
7477

7578
```
76-
COleMessageFilter* AFXAPI AfxOleGetMessageFilter();
79+
COleMessageFilter* AFXAPI AfxOleGetMessageFilter();
7780
```
7881

7982
### Return Value
@@ -94,7 +97,7 @@ COleMessageFilter* AFXAPI AfxOleGetMessageFilter();
9497
Retrieves the current user-control flag.
9598

9699
```
97-
BOOL AFXAPI AfxOleGetUserCtrl();
100+
BOOL AFXAPI AfxOleGetUserCtrl();
98101
```
99102

100103
### Return Value
@@ -110,7 +113,7 @@ BOOL AFXAPI AfxOleGetUserCtrl();
110113
Sets or clears the user-control flag, which is explained in the reference for `AfxOleGetUserCtrl`.
111114

112115
```
113-
void AFXAPI AfxOleSetUserCtrl(BOOL bUserCtrl);
116+
void AFXAPI AfxOleSetUserCtrl(BOOL bUserCtrl);
114117
```
115118

116119
### Parameters
@@ -129,7 +132,7 @@ void AFXAPI AfxOleSetUserCtrl(BOOL bUserCtrl);
129132
Increments the framework's global count of the number of active objects in the application.
130133

131134
```
132-
void AFXAPI AfxOleLockApp();
135+
void AFXAPI AfxOleLockApp();
133136
```
134137

135138
### Remarks
@@ -163,6 +166,43 @@ void AFXAPI AfxOleUnlockApp();
163166
### Requirements
164167
**Header**: afxdisp.h
165168

169+
## AfxOleLockControl
170+
Locks the class factory of the specified control so that dynamically created data associated with the control remains in memory.
171+
172+
### Syntax
173+
```
174+
BOOL AFXAPI AfxOleLockControl( REFCLSID clsid );
175+
BOOL AFXAPI AfxOleLockControl( LPCTSTR lpszProgID );
176+
```
177+
### Parameters
178+
`clsid`
179+
The unique class ID of the control.
180+
181+
`lpszProgID`
182+
The unique program ID of the control.
183+
184+
### Return Value
185+
Nonzero if the class factory of the control was successfully locked; otherwise 0.
186+
187+
### Remarks
188+
This can significantly speed up display of the controls. For example, once you create a control in a dialog box and lock the control with `AfxOleLockControl`, you do not need to create and kill it again every time the dialog is shown or destroyed. If the user opens and closes a dialog box repeatedly, locking your controls can significantly enhance performance. When you are ready to destroy the control, call `AfxOleUnlockControl`.
189+
190+
### Example
191+
```cpp
192+
// Starts and locks control's (Microsoft Calendar) class factory.
193+
// Control will remain in memory for lifetime of
194+
// application or until AfxOleUnlockControl() is called.
195+
196+
AfxOleLockControl(_T("MSCAL.Calendar"));
197+
```
198+
199+
### Requirements
200+
**Header:** <afxwin.h>
201+
202+
### See Also
203+
[Macros and Globals](mfc-macros-and-globals.md)
204+
[AfxOleUnlockControl](#afxoleunlockcontrol)
205+
166206
## <a name="afxoleregisterserverclass"></a> AfxOleRegisterServerClass
167207
This function allows you to register your server in the OLE system registry.
168208
@@ -232,7 +272,7 @@ BOOL AFXAPI AfxOleRegisterServerClass(
232272
Implements the user interface for the *typename* Object command.
233273
234274
```
235-
void AFXAPI AfxOleSetEditMenu(
275+
void AFXAPI AfxOleSetEditMenu(
236276
COleClientItem* pClient,
237277
CMenu* pMenu,
238278
UINT iMenuItem,
@@ -272,3 +312,40 @@ void AFXAPI AfxOleSetEditMenu(
272312
273313
## See Also
274314
[Macros and Globals](../../mfc/reference/mfc-macros-and-globals.md)
315+
316+
## <a name="afxoleunlockcontrol"></a> AfxOleUnlockControl
317+
Unlocks the class factory of the specified control.
318+
319+
### Syntax
320+
```
321+
BOOL AFXAPI AfxOleUnlockControl( REFCLSID clsid );
322+
BOOL AFXAPI AfxOleUnlockControl( LPCTSTR lpszProgID );
323+
```
324+
### Parameters
325+
`clsid`
326+
The unique class ID of the control.
327+
328+
`lpszProgID`
329+
The unique program ID of the control.
330+
331+
### Return Value
332+
Nonzero if the class factory of the control was successfully unlocked; otherwise 0.
333+
334+
### Remarks
335+
A control is locked with `AfxOleLockControl`, so that dynamically created data associated with the control remains in memory. This can significantly speed up display of the control because the control need not be created and destroyed every time it is displayed. When you are ready to destroy the control, call `AfxOleUnlockControl`.
336+
337+
### Example
338+
```cpp
339+
// Unlock control's (Microsoft Calendar Control) class factory.
340+
341+
AfxOleUnlockControl(_T("MSCAL.Calendar"));
342+
343+
```
344+
345+
### Requirements
346+
**Header:** <afxwin.h>
347+
348+
### See Also
349+
[Macros and Globals](mfc-macros-and-globals.md)
350+
[AfxOleLockControl](#afxolelockcontrol)
351+

0 commit comments

Comments
 (0)