developing a pdmworks enterprise add-in in microsoft vb.net 

21
Developing a PDMWorks Enterprise add-in in Microsoft VB.NET Jonathan Freeson Senior Consultant / Partner xLM Solutions, LLC

Upload: gannon

Post on 10-Jan-2016

53 views

Category:

Documents


10 download

DESCRIPTION

Developing a PDMWorks Enterprise add-in in Microsoft VB.NET . Jonathan Freeson Senior Consultant / Partner xLM Solutions, LLC. Overview. Programming with the PDMWE API Development and Debugging Techniques - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Developing a PDMWorks Enterprise add-in in Microsoft VB.NET  Jonathan FreesonSenior Consultant / Partner xLM Solutions, LLC

Page 2: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Overview

Programming with the PDMWE API

Development and Debugging Techniques– Using the VB.NET Example Program in the API Help File

found on the PDMWE CD (API_GB.CHM)

Note: There are hidden slides and slide notes in the deck that go into more detail in some areas.

Page 3: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

API: Very Important Change in PDMWE 2008

Visual Basic 6 is no longer supported.

VB6 applications upgrade to VB.NET Relatively Easily

Page 4: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

API: Requirements

Suggest Microsoft .NET 2.0 Development Environment– Documentation has screenshots showing Visual Studio/Visual

Basic 2002 which is .NET 1.0. – 64 Bit Support introduced in .NET 2.0– SQL 2005 uses .NET 2.0– Visual Basic 2005 and 2008 can target .NET 2.0

Visual Basic Express Edition can be used in a limited fashion

Page 5: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Development : Getting Started – Creating The Project

Start Microsoft Visual Basic 2005 or 2008

Create a new “Class Library”

Page 6: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Development: Visual Basic 2008 Notes

Default target runtime is .NET 3.5

.NET 2.0 is more common that 3.5 and is more likely to be installed on all clients. – Target should be changed to .NET 2.0

Page 7: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Environment Setup – Adding References

2007 and 2008 use the “EDMLIB” COM Library.

Page 8: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Environment Setup – Adding References

Adding the COM reference creates an “COM Interop Assembly” called “Interop.EdmLib.DLL”

This DLL is a wrapper/bridge between .NET and COM

Very important: The Interop.EdmLib.DLL that is automatically created must be deployed with the Add In DLL.

Page 9: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Environment Setup – Project Settings

In VB 2005 and 2008, mark Assembly as “COM-Visible.”

Page 10: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Writing Code – Implementing Interface

The class that is called from PDMWE must implement the EdmLib.IEdmAddIn5 interface.

Page 11: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Getting Started -- Interfaces

GetAddInInfo– Called by PDMWE to determine what the AddIn is capable of

o Specifying which version of PDMWE is supportedo Events to which it is subscribed

OnCmd– Called whenever a subscribed event occurs– Can abort/cancel certain operations

Page 12: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

The API

Uses a lot of Object Orientated Programming (OOP) structures.– Not easily visible to the development environment– Examples:

o Multiple versions of same object exist. IEdmVault7 is compatible with IEdmVault6, IEdmVault5, etc.

o An IEdmVault object can also be a IEdmVariableMgr5.

Well documented in the API_GB.CHM file found on the PDMWE CD. Good starting point.

Page 13: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Developing And Debugging

Using example from API_GB.CHM

Page 14: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Compiling And Deploying Test Version

Page 15: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Debugging

Up to now, everything could be done with “Express Editions” of Visual Basic.

Debugging requires a full Visual Studio

PDMWE runs as part of Windows Explorer– Use Visual Studio to Debug the “explorer.exe” process– Usually requires explorer.exe to be killed so close important

windows and save work

Tips: In windows, CTRL-SHIFT-ESCAPE brings up task manager– Can be used to start explorer.exe when it is killed and there is

no task bar to right click on.

Page 16: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Debugging – Attaching to running explorer.exe

Attach to running explorer.exe

Page 17: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Debugging – Create new explorer.exe

Recommended: Kill existing explorer.exe then use debugger to start new one

Page 18: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Debugging Demonstration

Attaching to existing explorer.exe via the “Debug -> Attach Process” command

Configuring Visual Studio Project to start explorer.exe for debugging– Must kill explorer.exe before starting

Page 19: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Production Deployment

VERY Important to select ALL the .DLL files

Page 20: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Questions?

Page 21: Developing a PDMWorks Enterprise add-in in Microsoft VB.NET 

Contact Information

Jonathan Freeson – Managing Partner, xLM [email protected]+1-517-579-9539

Slide materials and the VB.NET project file can be found at: http://www.xlmsolutions.com/sww2008