Chapter 28, Programming Visio with C++

Chapter 28, Programming Visio with C++

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Any client that supports the Component Object Model (COM) can access and manipulate Microsoft® Visio® objects. Several development environments that are available commercially, such as Microsoft® Visual Basic®, conceal the details of COM, which appeals to many developers. But if you are prepared to work more closely with COM, you can use C or C++ to develop programs that control instances of Visio.

This chapter assumes that you are familiar with COM programming concepts, obtaining pointers to interfaces, and calling interface functions. It also assumes that you are familiar with the C++ programming language. For details about Automation, see the Automation documentation in the Microsoft Platform Software Development Kit (SDK) on MSDN®. For details about C++, see your C++ documentation.

This chapter discusses how Visio exposes objects to Automation in terms of COM. It describes basic support services provided by Visio; these services ease the task of developing C++ programs that control Visio instances. The chapter then explains how to develop a Visio library (VSL), a type of dynamic-link library (DLL) that a Visio instance loads at run time.

Note Beginning with Visio 2002, you can build custom solutions using COM add-ins. For information on implementing COM add-ins in C++, see the Microsoft Developer Network (MSDN) Web site.

For details about recompiling existing programs to use the new support services or about programming Visio with C, see the Readme_CPPLib.htm file that is installed with the Microsoft Visio 2002 SDK.

In this chapter...

How Visio Exposes Objects

C++ Support in Visio

Handling Visio Events in C++ Programs

Visio Libraries