Skip to content

Commit 8841cc4

Browse files
author
mtx48109
committed
formatting mfc n
1 parent ec10cfd commit 8841cc4

17 files changed

Lines changed: 109 additions & 109 deletions

docs/mfc/mfc-activex-controls-advanced-topics.md

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ This article covers advanced topics related to developing ActiveX controls. Thes
6161

6262
8. In the **Get Function** and **Set Function** boxes, type unique names for your Get and Set Functions or accept the default names.
6363

64-
9. Add a parameter, called `row` (type `short`), using the **Parameter Name** and **Parameter Type** controls.
64+
9. Add a parameter, called *row* (type *short*), using the **Parameter Name** and **Parameter Type** controls.
6565

66-
10. Add a second parameter called `column` (type `short`).
66+
10. Add a second parameter called *column* (type *short*).
6767

6868
11. Click **Finish**.
6969

@@ -93,48 +93,48 @@ This article covers advanced topics related to developing ActiveX controls. Thes
9393

9494
|Error|Description|
9595
|-----------|-----------------|
96-
|**CTL_E_ILLEGALFUNCTIONCALL**|Illegal function call|
97-
|**CTL_E_OVERFLOW**|Overflow|
98-
|**CTL_E_OUTOFMEMORY**|Out of memory|
99-
|**CTL_E_DIVISIONBYZERO**|Division by zero|
100-
|**CTL_E_OUTOFSTRINGSPACE**|Out of string space|
101-
|**CTL_E_OUTOFSTACKSPACE**|Out of stack space|
102-
|**CTL_E_BADFILENAMEORNUMBER**|Bad file name or number|
103-
|**CTL_E_FILENOTFOUND**|File not found|
104-
|**CTL_E_BADFILEMODE**|Bad file mode|
105-
|**CTL_E_FILEALREADYOPEN**|File already open|
106-
|**CTL_E_DEVICEIOERROR**|Device I/O error|
107-
|**CTL_E_FILEALREADYEXISTS**|File already exists|
108-
|**CTL_E_BADRECORDLENGTH**|Bad record length|
109-
|**CTL_E_DISKFULL**|Disk full|
110-
|**CTL_E_BADRECORDNUMBER**|Bad record number|
111-
|**CTL_E_BADFILENAME**|Bad file name|
112-
|**CTL_E_TOOMANYFILES**|Too many files|
113-
|**CTL_E_DEVICEUNAVAILABLE**|Device unavailable|
114-
|**CTL_E_PERMISSIONDENIED**|Permission denied|
115-
|**CTL_E_DISKNOTREADY**|Disk not ready|
116-
|**CTL_E_PATHFILEACCESSERROR**|Path/file access error|
117-
|**CTL_E_PATHNOTFOUND**|Path not found|
118-
|**CTL_E_INVALIDPATTERNSTRING**|Invalid pattern string|
119-
|**CTL_E_INVALIDUSEOFNULL**|Invalid use of NULL|
120-
|**CTL_E_INVALIDFILEFORMAT**|Invalid file format|
121-
|**CTL_E_INVALIDPROPERTYVALUE**|Invalid property value|
122-
|**CTL_E_INVALIDPROPERTYARRAYINDEX**|Invalid property array index|
123-
|**CTL_E_SETNOTSUPPORTEDATRUNTIME**|Set not supported at run time|
124-
|**CTL_E_SETNOTSUPPORTED**|Set not supported (read-only property)|
125-
|**CTL_E_NEEDPROPERTYARRAYINDEX**|Need property array index|
126-
|**CTL_E_SETNOTPERMITTED**|Set not permitted|
127-
|**CTL_E_GETNOTSUPPORTEDATRUNTIME**|Get not supported at run time|
128-
|**CTL_E_GETNOTSUPPORTED**|Get not supported (write-only property)|
129-
|**CTL_E_PROPERTYNOTFOUND**|Property not found|
130-
|**CTL_E_INVALIDCLIPBOARDFORMAT**|Invalid clipboard format|
131-
|**CTL_E_INVALIDPICTURE**|Invalid picture|
132-
|**CTL_E_PRINTERERROR**|Printer error|
133-
|**CTL_E_CANTSAVEFILETOTEMP**|Can't save file to TEMP|
134-
|**CTL_E_SEARCHTEXTNOTFOUND**|Search text not found|
135-
|**CTL_E_REPLACEMENTSTOOLONG**|Replacements too long|
136-
137-
If necessary, use the **CUSTOM_CTL_SCODE** macro to define a custom error code for a condition that is not covered by one of the standard codes. The parameter for this macro should be an integer between 1000 and 32767, inclusive. For example:
96+
|CTL_E_ILLEGALFUNCTIONCALL|Illegal function call|
97+
|CTL_E_OVERFLOW|Overflow|
98+
|CTL_E_OUTOFMEMORY|Out of memory|
99+
|CTL_E_DIVISIONBYZERO|Division by zero|
100+
|CTL_E_OUTOFSTRINGSPACE|Out of string space|
101+
|CTL_E_OUTOFSTACKSPACE|Out of stack space|
102+
|CTL_E_BADFILENAMEORNUMBER|Bad file name or number|
103+
|CTL_E_FILENOTFOUND|File not found|
104+
|CTL_E_BADFILEMODE|Bad file mode|
105+
|CTL_E_FILEALREADYOPEN|File already open|
106+
|CTL_E_DEVICEIOERROR|Device I/O error|
107+
|CTL_E_FILEALREADYEXISTS|File already exists|
108+
|CTL_E_BADRECORDLENGTH|Bad record length|
109+
|CTL_E_DISKFULL|Disk full|
110+
|CTL_E_BADRECORDNUMBER|Bad record number|
111+
|CTL_E_BADFILENAME|Bad file name|
112+
|CTL_E_TOOMANYFILES|Too many files|
113+
|CTL_E_DEVICEUNAVAILABLE|Device unavailable|
114+
|CTL_E_PERMISSIONDENIED|Permission denied|
115+
|CTL_E_DISKNOTREADY|Disk not ready|
116+
|CTL_E_PATHFILEACCESSERROR|Path/file access error|
117+
|CTL_E_PATHNOTFOUND|Path not found|
118+
|CTL_E_INVALIDPATTERNSTRING|Invalid pattern string|
119+
|CTL_E_INVALIDUSEOFNULL|Invalid use of NULL|
120+
|CTL_E_INVALIDFILEFORMAT|Invalid file format|
121+
|CTL_E_INVALIDPROPERTYVALUE|Invalid property value|
122+
|CTL_E_INVALIDPROPERTYARRAYINDEX|Invalid property array index|
123+
|CTL_E_SETNOTSUPPORTEDATRUNTIME|Set not supported at run time|
124+
|CTL_E_SETNOTSUPPORTED|Set not supported (read-only property)|
125+
|CTL_E_NEEDPROPERTYARRAYINDEX|Need property array index|
126+
|CTL_E_SETNOTPERMITTED|Set not permitted|
127+
|CTL_E_GETNOTSUPPORTEDATRUNTIME|Get not supported at run time|
128+
|CTL_E_GETNOTSUPPORTED|Get not supported (write-only property)|
129+
|CTL_E_PROPERTYNOTFOUND|Property not found|
130+
|CTL_E_INVALIDCLIPBOARDFORMAT|Invalid clipboard format|
131+
|CTL_E_INVALIDPICTURE|Invalid picture|
132+
|CTL_E_PRINTERERROR|Printer error|
133+
|CTL_E_CANTSAVEFILETOTEMP|Can't save file to TEMP|
134+
|CTL_E_SEARCHTEXTNOTFOUND|Search text not found|
135+
|CTL_E_REPLACEMENTSTOOLONG|Replacements too long|
136+
137+
If necessary, use the CUSTOM_CTL_SCODE macro to define a custom error code for a condition that is not covered by one of the standard codes. The parameter for this macro should be an integer between 1000 and 32767, inclusive. For example:
138138

139139
[!code-cpp[NVC_MFC_AxUI#37](../mfc/codesnippet/cpp/mfc-activex-controls-advanced-topics_4.cpp)]
140140

@@ -158,7 +158,7 @@ This article covers advanced topics related to developing ActiveX controls. Thes
158158

159159
-or-
160160

161-
- Declare a local variable and subclass as the dialog item. Insert code that resembles the following (`CMyCtrl` is the wrapper class, `IDC_MYCTRL1` is the control's ID):
161+
- Declare a local variable and subclass as the dialog item. Insert code that resembles the following (`CMyCtrl` is the wrapper class, IDC_MYCTRL1 is the control's ID):
162162

163163
[!code-cpp[NVC_MFC_AxCont#19](../mfc/codesnippet/cpp/mfc-activex-controls-advanced-topics_6.cpp)]
164164

docs/mfc/mfc-activex-controls-distributing-activex-controls.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This article discusses several issues related to redistributing ActiveX controls
3030
The setup program you provide with your ActiveX controls should create a special subdirectory of the Windows directory and install the controls' .OCX files in it.
3131

3232
> [!NOTE]
33-
> Use the Windows **GetWindowsDirectory** API in your setup program to obtain the name of the Windows directory. You may want to derive the subdirectory name from the name of your company or product.
33+
> Use the Windows `GetWindowsDirectory` API in your setup program to obtain the name of the Windows directory. You may want to derive the subdirectory name from the name of your company or product.
3434
3535
The setup program must install the necessary redistributable DLL files in the Windows system directory. If any of the DLLs are already present on the user's machine, the setup program should compare their versions with the versions you are installing. Reinstall a file only if its version number is higher than the file already installed.
3636

@@ -41,14 +41,14 @@ This article discusses several issues related to redistributing ActiveX controls
4141

4242
If you prefer, you can write your setup program to register the control directly instead.
4343

44-
Use the **LoadLibrary** Windows API to load the control DLL. Next, use **GetProcAddress** to obtain the address of the "DllRegisterServer" function. Finally, call the `DllRegisterServer` function. The following code sample demonstrates one possible method, where `hLib` stores the handle of the control library, and `lpDllEntryPoint` stores the address of the "DllRegisterServer" function.
44+
Use the `LoadLibrary` Windows API to load the control DLL. Next, use `GetProcAddress` to obtain the address of the "DllRegisterServer" function. Finally, call the `DllRegisterServer` function. The following code sample demonstrates one possible method, where `hLib` stores the handle of the control library, and `lpDllEntryPoint` stores the address of the "DllRegisterServer" function.
4545

4646
[!code-cpp[NVC_MFC_AxCont#16](../mfc/codesnippet/cpp/mfc-activex-controls-distributing-activex-controls_1.cpp)]
4747

4848
The advantage of registering the control directly is that you do not need to invoke and load a separate process (namely, REGSVR32), reducing installation time. In addition, because registration is an internal process, the setup program can handle errors and unforeseen situations better than an external process can.
4949

5050
> [!NOTE]
51-
> Before your setup program installs an ActiveX control, it should call **OleInitialize**. When your setup program is finished, call **OleUnitialize**. This ensures that the OLE system DLLs are in the proper state for registering an ActiveX control.
51+
> Before your setup program installs an ActiveX control, it should call `OleInitialize`. When your setup program is finished, call `OleUnitialize`. This ensures that the OLE system DLLs are in the proper state for registering an ActiveX control.
5252
5353
You should register MFCx0.DLL.
5454

docs/mfc/mfc-activex-controls-licensing-an-activex-control.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Licensing support, an optional feature of ActiveX controls, allows you to contro
2828
ActiveX controls that implement licensing allow you, as the control developer, to determine how other people will use the ActiveX control. You provide the control purchaser with the control and .LIC file, with the agreement that the purchaser may distribute the control, but not the .LIC file, with an application that uses the control. This prevents users of that application from writing new applications that use the control, without first licensing the control from you.
2929

3030
## <a name="_core_overview_of_activex_control_licensing"></a> Overview of ActiveX Control Licensing
31-
To provide licensing support for ActiveX controls, the [COleObjectFactory](../mfc/reference/coleobjectfactory-class.md) class provides an implementation for several functions in the **IClassFactory2** interface: **IClassFactory2::RequestLicKey**, **IClassFactory2::GetLicInfo**, and **IClassFactory2::CreateInstanceLic**. When the container application developer makes a request to create an instance of the control, a call to `GetLicInfo` is made to verify that the control .LIC file is present. If the control is licensed, an instance of the control can be created and placed in the container. After the developer has finished constructing the container application, another function call, this time to `RequestLicKey`, is made. This function returns a license key (a simple character string) to the container application. The returned key is then embedded in the application.
31+
To provide licensing support for ActiveX controls, the [COleObjectFactory](../mfc/reference/coleobjectfactory-class.md) class provides an implementation for several functions in the `IClassFactory2` interface: `IClassFactory2::RequestLicKey`, `IClassFactory2::GetLicInfo`, and `IClassFactory2::CreateInstanceLic`. When the container application developer makes a request to create an instance of the control, a call to `GetLicInfo` is made to verify that the control .LIC file is present. If the control is licensed, an instance of the control can be created and placed in the container. After the developer has finished constructing the container application, another function call, this time to `RequestLicKey`, is made. This function returns a license key (a simple character string) to the container application. The returned key is then embedded in the application.
3232

3333
The figure below demonstrates the license verification of an ActiveX control that will be used during the development of a container application. As mentioned previously, the container application developer must have the proper .LIC file installed on the development machine to create an instance of the control.
3434

@@ -63,15 +63,15 @@ Verification of a Licensed ActiveX Control During Execution
6363

6464
- [VerifyUserLicense](../mfc/reference/coleobjectfactory-class.md#verifyuserlicense)
6565

66-
Verifies that the control allows design-time usage by checking the system for the presence of the control license file. This function is called by the framework as part of processing **IClassFactory2::GetLicInfo** and **IClassFactory::CreateInstanceLic**.
66+
Verifies that the control allows design-time usage by checking the system for the presence of the control license file. This function is called by the framework as part of processing `IClassFactory2::GetLicInfo` and `IClassFactory::CreateInstanceLic`.
6767

6868
- [GetLicenseKey](../mfc/reference/coleobjectfactory-class.md#getlicensekey)
6969

70-
Requests a unique key from the control DLL. This key is embedded in the container application and used later, in conjunction with `VerifyLicenseKey`, to create an instance of the control. This function is called by the framework as part of processing **IClassFactory2::RequestLicKey**.
70+
Requests a unique key from the control DLL. This key is embedded in the container application and used later, in conjunction with `VerifyLicenseKey`, to create an instance of the control. This function is called by the framework as part of processing `IClassFactory2::RequestLicKey`.
7171

7272
- [VerifyLicenseKey](../mfc/reference/coleobjectfactory-class.md#verifylicensekey)
7373

74-
Verifies that the embedded key and the control's unique key are the same. This allows the container to create an instance of the control for its use. This function is called by the framework as part of processing **IClassFactory2::CreateInstanceLic** and can be overridden to provide customized verification of the license key. The default implementation performs a string comparison. For more information, see [Customizing the Licensing of an ActiveX Control](#_core_customizing_the_licensing_of_an_activex_control), later in this article.
74+
Verifies that the embedded key and the control's unique key are the same. This allows the container to create an instance of the control for its use. This function is called by the framework as part of processing `IClassFactory2::CreateInstanceLic` and can be overridden to provide customized verification of the license key. The default implementation performs a string comparison. For more information, see [Customizing the Licensing of an ActiveX Control](#_core_customizing_the_licensing_of_an_activex_control), later in this article.
7575

7676
### <a name="_core_header_file_modifications"></a> Header File Modifications
7777
The ActiveX Control Wizard places the following code in the control header file. In this example, two member functions of `CSampleCtrl`'s object `factory` are declared, one that verifies the presence of the control .LIC file and another that retrieves the license key to be used in the application containing the control:
@@ -84,7 +84,7 @@ Verification of a Licensed ActiveX Control During Execution
8484
[!code-cpp[NVC_MFC_AxUI#40](../mfc/codesnippet/cpp/mfc-activex-controls-licensing-an-activex-control_2.cpp)]
8585

8686
> [!NOTE]
87-
> If you modify **szLicString** in any way, you must also modify the first line in the control .LIC file or licensing will not function properly.
87+
> If you modify `szLicString` in any way, you must also modify the first line in the control .LIC file or licensing will not function properly.
8888
8989
The ActiveX Control Wizard places the following code in the control implementation file to define the control class' `VerifyUserLicense` and `GetLicenseKey` functions:
9090

docs/mfc/mfc-activex-controls-localizing-an-activex-control.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This article discusses procedures for localizing ActiveX control interfaces.
2626
> [!NOTE]
2727
> This will not work correctly in some cases, if future instances have different locales.
2828
29-
- Use the **OnAmbientChanged** notification function to dynamically load the proper resources for the container's locale.
29+
- Use the `OnAmbientChanged` notification function to dynamically load the proper resources for the container's locale.
3030

3131
> [!NOTE]
3232
> This will work for the control, but the run-time DLL will not dynamically update its own resources when the ambient LocaleID property changes. In addition, run-time DLLs for ActiveX controls use the thread locale to determine the locale for its resources.
@@ -83,7 +83,7 @@ This article discusses procedures for localizing ActiveX control interfaces.
8383

8484
[!code-cpp[NVC_MFC_AxLoc#4](../mfc/codesnippet/cpp/mfc-activex-controls-localizing-an-activex-control_4.cpp)]
8585

86-
Place the code sample above into a member function of the control, such as an override of [COleControl::OnSetClientSite](../mfc/reference/colecontrol-class.md#onsetclientsite). In addition, `m_hResDLL` should be a member variable of the control class.
86+
Place the code sample above into a member function of the control, such as an override of [COleControl::OnSetClientSite](../mfc/reference/colecontrol-class.md#onsetclientsite). In addition, *m_hResDLL* should be a member variable of the control class.
8787

8888
You can use similar logic for localizing a control's property page. To localize the property page, add code similar to the following sample to your property page's implementation file (in an override of [COlePropertyPage::OnSetPageSite](../mfc/reference/colepropertypage-class.md#onsetpagesite)):
8989

0 commit comments

Comments
 (0)