Visio SDK 2003 shapes events with C#

H

ha1o

Hi

I am working with the Visio SDK 2003. I manage to create a new action in the
right-mouse event for shapes. but I need that the action I create shows a new
form of the application when it gets clicked. this action object is handled
as a visio cell, but this cell doesn't have any mouse event. It has a
property called "FormulaU", this property only accept string instructions
like "RUNADDON(\"NETWORK SHAPE PROPERTIES\")"

What I need is an instruction like this that let me opens a new form in my
application.

Thanks.
 
U

unerklarlich

Hi,

You can use markerevents to communicate from Visio to your application.

In the Action Row, add the following command to the Action Cell

RUNADDONWARGS(
"QUEUEMARKEREVENT",
"/<Some identifier so that ur applicatoin knows that the marker event
recieved is meant for itself.>=<Some Identifier for your applicatoin to
identify the requested task>"
)'

OR

QUEUEMARKEREVENT("/<Some identifier so that ur applicatoin knows that the
marker event recieved is meant for itself.>=<Some Identifier for your
applicatoin to identify the requested task>"
)

You can then use the following code in your application to register a
MarkerEvent handler custom method ...

vsoApplication.MarkerEvent += new Visio.EApplication_MarkerEventEventHandler(

applicationMarkerEventHandler);

Once this is done .. you will implement the
applicationMarkerEventHandler(
Visio.Application vsoApplication,
int sequenceNumber,
string context)

method. "context" will contain the command that is configured in the
shapesheet in Visio. You can parse context and then write suitable code so
show a form or perform whatever task is required.

unerklarlich
 
H

ha1o

hi

I was working with a MarkerEvent handler custom method, and it worked
excellent.

but I found a new problem. I create simple SetUp to bring the application to
another machine. in this new machine the contextual menu item that I create
for the MarkerEvent handler custom method doesn't work, and I can't find out
why.

in this new machine I installed the framework 2.0 and MS Visio 2003. the
simple SetUp has the Visio SDK 2003 DLLs. with this the application works
fine, it open files, it close and save files, it connects to the data base;
but the custom menu item for the MarkerEvent handler custom method just
doesn't work. it doesn't throw any error or show the window I want; it does
nothing and I can't figure out why.

I was thinking that the Visio SDK 2003 installation set something
(configuration settings, files, updates,...) that makes the application works
in the development enviroment, so I would like to know if the SDK
installation is required so the application works properly.

thanks for your time.
 
H

ha1o

Hi Bill

I already try with the package you say. But it doesn't work. I installed the
package in the developer machine and in the user machine; I also follow the
page instructions, but the menu item still doesn't work.

this is the code I use for the menu item of each Master in the drawing:

// Set the action for the menu item.
labelObj.get_CellsSRC(

(short)Microsoft.Office.Interop.Visio.VisSectionIndices.
visSectionAction,
actionRow,

(short)Microsoft.Office.Interop.Visio.VisCellIndices.
visActionAction).FormulaU =
"RUNADDONWARGS(\"QueueMarkerEvent\", \"/Table=" + var1 + " /RegId=" + var2 +
"\")";

this is the market event:
((Page)this.drawingControl.Window.PageAsObj).Application.MarkerEvent += new
Microsoft.Office.Interop.Visio.EApplication_MarkerEventEventHandler(Demo);

the "Demo" method shows a new windows based in the "var1" information. this
is what does nothing in others machine. Also, I'm not sure if this I'm doing
is a smart document or smart tags?

and thanks again for your time.
 
B

Bill Morein [MSFT]

Looking at your code I can't see any specific reason why it wouldn't work on
other machines. Have you tried compiling some of the sample applications
that ship in the SDK and trying to get them to work on different machines?
This might tell us if it is a general problem or if it is specific to your
specific code.

--
Bill Morein
http://blogs.msdn.com/wmorein
Visio
Microsoft Corporation
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top