Welcome
Getting Started
Overview
Types of SolidWorks API Applications
Overview
SolidWorks Macros
Standalone and Add-in Applications
Add-ins, Templates, and Wizards
Add-in Templates and Wizards
SolidWorks C# and VB.NET Add-in Templates
SolidWorks VB.NET Add-In Template
SolidWorks C++/CLI COM Add-in Wizards
SolidWorks C# Add-in Template
ATL Object Wizard
SwAddin
Other Microsoft VBA-enabled Applications
SolidWorks API Object Model and Class Hierarchy
Programming with the SolidWorks API
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

Using the ATL Object Wizard (Visual C++ 6)

The SolidWorks API SDK, which includes the Visual Studio 6 ATL Object Wizard, expects that Microsoft Visual Studio 6.0 has been installed at C:\Program Files.

NOTE: Some parameters and properties may change between SolidWorks service packs. This is a known Microsoft software issue; see "Q220137 - "MIDL Changes the Case of Identifier in Generated Type Library" for details. Also, according to Microsoft Corporation, this behavior is by design.

Creating a new SolidWorks Visual C++ 6.0 DLL

  1. In Visual C++ 6, create a new project using the ATL COM AppWizard, choose a project location and name, and click OK.

  2. Select Dynamic Link Library (DLL) for Server Type and click Finish.

  3. Click OK.

  4. On the ClassView tab, right-click the top-level classes icon and select New ATL Object.

    1. Select SolidWorks in the Category list.

    2. Select the SwAddIn icon on Objects and click Next.

    3. On the Names tab, type the name for your ATL object class in Short Name.

    4. On the SolidWorks AddIn tab, select the options that you want the wizard to provide skeleton code for and click OK.

  5. Click Build, Set Active Configuration, then select the project configuration and click OK.

  6. Click Project, Settings.

    1. On the C/C++ tab, select Preprocessor in Category. Type the full path to the <install_dir>\samples\appcomm folder for your SolidWorks installation in Additional include directories. Append a semi-colon at the end of the filename and add the full path to the main SolidWorks installation folder (the folder where sldworks.exe resides).

    2. Select the C++ Language in Category, select Enable exception handling, and click OK.

  7. In Step 4d, if you selected any option other than that for sample PropertyManagerPage2 code, you must open the project’s CPP file and make some edits. Near the top of the file and between the BEGIN_OBJECT_MAP() and the END_OBJECT_MAP() lines of code, there is commented code. For every line of code that has commented code, delete all of the code except the code inside the braces.

  8. For example, to edit this line of code:

    OBJECT_ENTRY(CLSID_vvv, /* Replace this line with the string in the braces {OBJECT_ENTRY_NON_CREATEABLE(CPart)}*/)

    Delete all of the code except the code inside the braces:

    OBJECT_ENTRY_NON_CREATEABLE(CPart)

  9. Your project should now successfully build.

    Building the DLL registers the DLL for use with the SolidWorks add-in manager. You can unload the DLL from the SolidWorks session by deselecting it in the SolidWorks add-in manager.

 



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:   Using the ATL Object Wizard
*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.