Hide 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.

 



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:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:




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) 2010 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.