J
Josef Meile
Hi,
I'm trying to find a guide on doing external exe add-ons for
visio. The only add-on example I have found is the c++ flow
chart example from the sdk, which generates a vsl file and
not an exe file which is what I want. I'm planning to use C#,
but I suppose that the procedure to do an exe add-on isn't
be much different as by a vsl, is it?
I have tried to guess what the code does, but for me isn't
jet clear the following things:
1) I know that you can catch the Document_created event on
an add-in and see if the template that the new document
is using is the one included with your solution. If I'm not
wrong, visio will excecute all the Document_created handlers
of all the loaded add-ins, then do something according to
the written code there. But, with add-ons is diferent because
they aren't on memory and are loaded when you need them.
So, my question is: How do you associate the add-on with a
template in order to make it load when a new document based
on the template is created?
2) According to the interop tutorial, you can catch the events of
an add-in by using the "WITH EVENTS" keyword on the declaration
of your visio application variable, or by associating a Event handler
class with your application by doing this:
Private resultEvent As Microsoft.Office.Interop.Visio.Event
Private eventSink As IVisEventProc
I found the "VFlowSample::HandleVisioEvent" method on the
Flow Char add-on, but the question is: is it enough with just
defining this or are there other steps to handle the events?
3) What other libraries you have to include to do a visio add-on?
For example: on the Flow Chart add-on, I saw the "DocumentCreator",
class. Is it a predefined class or do you have to code it from
zero?
4) The visio add-on wizard ask allways what to include:
* C++ without ATL or MFC
* MFC
* ATL
What's the purpose of each option?
2) I have tried to build, install and run the flow chart example,
but I always see a page with a text shape which says:
"This template is designed to work with the Flowchart Sample
Application that must be built by compiling sample code located
in the SDK install directory under samples\flowchart\cpp."
I don't see anything else. What is this add-on supose to
do?
I did what is written there: Open the C++ net project, build
the solution by choosing "Build solution" from the "Debug" menu,
place the mouse over "FlowchartSampleSetup", then choose
"Install" from the context menu. I got the following files
installed:
* ATL71.DLL
* Flowchart (VSL).vst
* Flowchart.xls
* FlowSample.vsl
on the following directory:
C:\Program Files\Microsoft Office\Visio 2003 SDK Samples\Flowchart Sample
(C++)
Then, I set the add-ons path to that directory. When I restarted
visio, I saw a reference to the installed vsl on the "new" option
of the "file" menu. So, I hit it, but I saw again that text shape. What
am I missing here?
3) How do you debug an exe add-on on visual studio net? I tried doing
this by setting the "command action" of the "Debugging" section to:
C:\Program Files\Microsoft Office\Visio11\VISIO.EXE
Then, I put a breakpoint on the first code line after the "try" command
of the "VFlowSample::Run" example.
but when trying to run it, I got a warning that says:
"'VISIO.EXE' does not contain debugging information. (No symbols
loaded.) Click OK to debug anyway."
So, I clicked OK. But the breakpoint got a question mark,
it were never hit, and I saw the following message when
placing the mouse over it:
"At VFlowSample.cpp, line 101
The breakpoint will not currently be hit.
No excecutable code is currently loaded at this location."
How do you configure your debugger?
Thanks in advanced,
Josef
I'm trying to find a guide on doing external exe add-ons for
visio. The only add-on example I have found is the c++ flow
chart example from the sdk, which generates a vsl file and
not an exe file which is what I want. I'm planning to use C#,
but I suppose that the procedure to do an exe add-on isn't
be much different as by a vsl, is it?
I have tried to guess what the code does, but for me isn't
jet clear the following things:
1) I know that you can catch the Document_created event on
an add-in and see if the template that the new document
is using is the one included with your solution. If I'm not
wrong, visio will excecute all the Document_created handlers
of all the loaded add-ins, then do something according to
the written code there. But, with add-ons is diferent because
they aren't on memory and are loaded when you need them.
So, my question is: How do you associate the add-on with a
template in order to make it load when a new document based
on the template is created?
2) According to the interop tutorial, you can catch the events of
an add-in by using the "WITH EVENTS" keyword on the declaration
of your visio application variable, or by associating a Event handler
class with your application by doing this:
Private resultEvent As Microsoft.Office.Interop.Visio.Event
Private eventSink As IVisEventProc
I found the "VFlowSample::HandleVisioEvent" method on the
Flow Char add-on, but the question is: is it enough with just
defining this or are there other steps to handle the events?
3) What other libraries you have to include to do a visio add-on?
For example: on the Flow Chart add-on, I saw the "DocumentCreator",
class. Is it a predefined class or do you have to code it from
zero?
4) The visio add-on wizard ask allways what to include:
* C++ without ATL or MFC
* MFC
* ATL
What's the purpose of each option?
2) I have tried to build, install and run the flow chart example,
but I always see a page with a text shape which says:
"This template is designed to work with the Flowchart Sample
Application that must be built by compiling sample code located
in the SDK install directory under samples\flowchart\cpp."
I don't see anything else. What is this add-on supose to
do?
I did what is written there: Open the C++ net project, build
the solution by choosing "Build solution" from the "Debug" menu,
place the mouse over "FlowchartSampleSetup", then choose
"Install" from the context menu. I got the following files
installed:
* ATL71.DLL
* Flowchart (VSL).vst
* Flowchart.xls
* FlowSample.vsl
on the following directory:
C:\Program Files\Microsoft Office\Visio 2003 SDK Samples\Flowchart Sample
(C++)
Then, I set the add-ons path to that directory. When I restarted
visio, I saw a reference to the installed vsl on the "new" option
of the "file" menu. So, I hit it, but I saw again that text shape. What
am I missing here?
3) How do you debug an exe add-on on visual studio net? I tried doing
this by setting the "command action" of the "Debugging" section to:
C:\Program Files\Microsoft Office\Visio11\VISIO.EXE
Then, I put a breakpoint on the first code line after the "try" command
of the "VFlowSample::Run" example.
but when trying to run it, I got a warning that says:
"'VISIO.EXE' does not contain debugging information. (No symbols
loaded.) Click OK to debug anyway."
So, I clicked OK. But the breakpoint got a question mark,
it were never hit, and I saw the following message when
placing the mouse over it:
"At VFlowSample.cpp, line 101
The breakpoint will not currently be hit.
No excecutable code is currently loaded at this location."
How do you configure your debugger?
Thanks in advanced,
Josef