TSTCON Sample: ActiveX Control Test Container
2012-02-10 13:45
525 查看
TSTCON Sample: ActiveX Control Test Container
Visual Studio 2008Other Versions
Visual Studio 2005
Visual Studio .NET 2003
1 out of 1 rated this helpfulRate this topic
The TSTCON sample implements an ActiveX control container using MFC support for OLE embedding. You can use TSTCON to test ActiveX controls, change their properties, and invoke their methods. You can write scripts using the VBScript language to automate the
testing of the controls. TSTCON can keep a log of the events and property change notifications fired by a control.
Note: |
---|
This sample requires the Microsoft Calendar Control, which is installed with Microsoft Access. |
CCheckListBox: A list box with a check box next for each item.
CDragListBox: A list box in which you can drag the items to rearrange their order.
Implementing an Active Scripting Engine host (VBScript).
Implementing context-sensitive help for dialog boxes.
Security Note: |
---|
This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended. |
On the Visual Studio Help menu, click
Samples.
For more information, see Visual Studio Samples.
The most recent version and complete list of samples is available online from theVisual Studio 2008 Samples page.
You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied into a folder under \Program Files\Visual Studio 9.0\Samples\. For Express editions of Visual Studio, all samples are located online.
Building
and Running the Sample
To build and run the TSTCON sample
Open the solution tstcon.sln.In the Property Pages for the TCProps project, expand theConfiguration Properties node; then expand the
Linker node. Under Manifest File, change the
Enable User Account Control (UAC) option to
No.
On the Build menu, click Build Solution.
Run the test container application as a stand-alone application so it can register itself with the system.
To launch a control in the container
In ActiveX Control Test Container, from theEdit menu, click Insert NewControl.
In the Insert New Control dialog box, from the list box, selectCalendarControl, and click
OK.
The Microsoft Calendar Control appears in the upper half of the splitter window. Note that this control is installed with Microsoft Access.
Manipulate the calendar by changing month, year, and date. In the lower pane, observe how the logs, events, and property change notifications are fired by the control as you manipulate it.
To change the control's properties
Select the calendar control by clicking the calendar's border.From the Edit menu, click Properties. Test Container displays theProperties dialog box for the control.
Using this dialog box, you can edit the properties of the control. Change the control's properties and observe the changes.
Close the Properties dialog box.
To invoke methods on the control
From the Control menu, click Invoke Methods. TheInvoke Method dialog box appears.In the Method Name combo box, select
BackColor (PropPut).
From theParameter Type combo box, select
VT_COLOR.
Click Choose Color, choose a color from the color palette, and clickOK.
In the Invoke Methoddialog box, click
Invoke. The background color of the calendar control changes to the color you selected in the color palette.
For more information on how to use the Test Container, from the
Help menu, click Help Topics.
Note: |
---|
Some samples, such as this one, have not been modified to reflect the changes in the Visual C++ wizards, libraries, and compiler, but still demonstrate how to complete your desired task. |
See
Also
Other Resources
MFC SamplesDid you find this helpful? YesNo
Not accurate
Not enough depth
Need more code examples
Tell us more...
(2000 characters remaining)
Community ContentAdd
FAQ
ocscpy deprecated
The compler complains that ocscpy is unsafe.
edit TCDoc.Cpp, line 484 (or there abouts), to replace ocscpy with:
size_t len = wcslen( pszFaceName )+1;
ocscpy_s( m_descFont.lpstrName, len, pszFaceName );
The instructions were incorrect for my computer: Visual Studio 2008, Windows 7, 64 bit.
Opening TstCon.sln did not work.
Open TstConLKG8.sln
Warning D9035: option Wp64 has been deprecated. I found the command line options and changed that from Yes to No. The warning returned. I don't know where to look to make a permanent change.
Comments and elaborations from someone more knowledgable will be appreciated.
History
7/16/2011
JAG77
7/16/2011
JAG77
Build Error for Win32 Vista Ultimate
To build on on Vista 32 bit bit platform do the following
1. Add bellow line to stdafx.h in the beginning
#define WINVER 0x500
2. Change the project setting with a right click on the project - choose properties Repeat this for both projects TCProps and TSTCon
2a. Select Configuration properties Change default platform located at the top to 'Active(Win32)' and Click on Configuration manager and Change Active Solution platform to be 'Win32', close it
2b. Change Configurations Properties\Linker\Manifest File\Enable User Access Control (UAC) to 'No'
Fix also works on Windows 7 / 64 bit
相关文章推荐
- 用ActiveX Control Test Container测试ActiveX控件时找不到控件的解决方法
- VS2010添加TSTCON( ACTIVEX CONTROL TEST CONTAINER )工具
- 修正VC6.0 ACTIVEX 直接运行不能调用Activex Control Test Container 的问题
- ActiveX Control Test Container
- VS2008或以上版本的ActiveX控件的测试工具(ActiveX Control Test Container)编译记录
- VS2010添加TSTCON( ACTIVEX CONTROL TEST CONTAINER )工具
- OpenGL vs2010 ActiveX Control Test Container
- vs2010添加TSTCON( ActiveX Control Test Container )工具
- vs2010没有 ActiveX Control Test Container
- VS2010添加TSTCON( ACTIVEX CONTROL TEST CONTAINER )工具
- vs2010添加TSTCON( ActiveX Control Test Container )工具
- Visual Studio2013下使用ActiveX Control Test Container
- VC2008中ActiveX Control Test Container程序去那里了?
- vs2010添加TSTCON( ActiveX Control Test Container )工具
- vs2010添加TSTCON( ActiveX Control Test Container )工具
- 在Visual Studio 2008里使用ActiveX Test Container
- Activex test contact failed to create control 未指定的错误 控件无法加载的原因
- 解决Windows7下vs2008 Active control test container 不能运行的问题
- Activex test contact failed to create control 未指定的错误 控件无法加载的原因
- 解决Windows7下vs2008 Active control test container 不能运行的问题