> AddControl Method (IModelViewManager)
Welcome
Getting Started
SolidWorks API Help
FeatureWorks API Help
SolidWorks Document Manager API Help
eDrawings API Help
SolidWorks Routing API Help
SolidWorks Simulation API Help
SolidWorks Utilities API Help
SolidWorks Workgroup PDM API Help
Hide Table of Contents Show Table of Contents
AddControl Method (IModelViewManager)

Adds a tab to this model view using the specified ActiveX control.

.NET Syntax

Visual Basic (Declaration) 
Function AddControl( _
   ByVal Name As String, _
   ByVal ControlName As String, _
   ByVal BstrLicKey As String _
) As Object
Visual Basic (Usage) 
Dim instance As IModelViewManager
Dim Name As String
Dim ControlName As String
Dim BstrLicKey As String
Dim value As Object
 
value = instance.AddControl(Name, ControlName, BstrLicKey)
C# 
object AddControl( 
   string Name,
   string ControlName,
   string BstrLicKey
)
C++/CLI 
Object^ AddControl( 
&   String^ Name,
&   String^ ControlName,
&   String^ BstrLicKey
) 

Parameters

Name

User-defined label that appears on the tab

ControlName

Name or class ID for the ActiveX control

BstrLicKey

Optional license key; this data is needed to create ActiveX controls that require a runtime license key; if the ActiveX control supports licensing, then provide a license key for the creation of the ActiveX control; default value is NULL

Return Value

Pointer to the new ActiveX control

Example

Remarks

If your ActiveX control needs tab traversal support, then use IModelViewManager::AddControl3.

This method sets the class ID and license key information for the ActiveX control when the API PropertyManager page is shown and the ActiveX control is created. The controlName argument can be either the name of the control (ProgID) or the class ID (CLSID), for example, "MSCAL.calendar" or "{8E27C92B-1264-101C-8A2F-040224009C02}". Both provide the calendar protocol. You can obtain these strings using a combination of the Microsoft OLE/COM Object Viewer and the registry editor.

 

For example:

 

' ProgID

bRet = m_pActiveXControl.SetClass("MSCAL.Calendar", "")

bRet = m_pActiveXControl2.SetClass("MSComctlLib.ListViewCtrl", "")

 

' CLSID

bRet = m_pActiveXControl.SetClass("{8E27C92B-1264-101C-8A2F-040224009C02}", "")

bRet = m_pActiveXControl2.SetClass("{BDD1F04B-858B-11D1-B16A-00C0F0283628}", "")

To delete a tab created by this method, use IModelViewManager::DeleteControlTab.

 

See also Keystrokes and Accelerator Keys in ActiveX Modeless Dialogs and PropertyManager Pages.

 

See Also

Availability

SolidWorks 2003 FCS, Revision Number 11.0


Related SolidWorks Forum Content

Provide feedback on this topic

SolidWorks welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   AddControl Method (IModelViewManager)
*Comment:  
x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2012 SP05

The search functionality within the web help is in a beta test phase and you may experience periodic delays or interruptions in its performance. These are the normal and ordinary features of a beta test and shall not under any circumstances give rise to any liability on the part of DS SolidWorks or its licensors. The topics within the Web-based help are not beta topics; they document API Help (English only) 2012 SP05.

To disable Web help from within SolidWorks and use local help instead, click Help > Use SolidWorks Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.