Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Mon, 7 Jul 2008 08:46:00 -0700,    group: microsoft.public.visio.developer        back       


Custom Cut/Copy/Paste   
Hi,

I have created my own cut/copy/paste for visio. 

Sometimes, when I try to cut a selection the entire application hangs and I 
have to close it and restart. 

This is the code I use: 

Selection cutCopyPasteSelection = null;
this.cutCopyPasteSelection = visioCtl.Window.Selection;
this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);

Sometimes this code does work, so it doesn't always hang.  Am I doing the 
cut wrong? I copied the code from the sample in the documentation.

Thank you.
date: Mon, 7 Jul 2008 08:46:00 -0700   author:   Stumple

RE: Custom Cut/Copy/Paste   
Sorry, I posted the wrong code. It is not a Cut() that is hanging the visio 
document. Those seem to work fine. It is instead the Copy() that hangs visio.

Selection cutCopyPasteSelection = null;
this.cutCopyPasteSelection = visioCtl.Window.Selection;
this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);

"Stumple" wrote:

> Hi,
> 
> I have created my own cut/copy/paste for visio. 
> 
> Sometimes, when I try to cut a selection the entire application hangs and I 
> have to close it and restart. 
> 
> This is the code I use: 
> 
> Selection cutCopyPasteSelection = null;
> this.cutCopyPasteSelection = visioCtl.Window.Selection;
> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
> 
> Sometimes this code does work, so it doesn't always hang.  Am I doing the 
> cut wrong? I copied the code from the sample in the documentation.
> 
> Thank you.
date: Mon, 7 Jul 2008 08:49:02 -0700   author:   Stumple

Re: Custom Cut/Copy/Paste   
this may not be the solution to what is happening, but, when I had a similar 
problem I observed that it appeared to be the number of objects in the 
selection that was causing the hang. The workaround was to create a group of 
the selections before attempting the paste of the group.
al

"Stumple"  wrote in message 
news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
> Sorry, I posted the wrong code. It is not a Cut() that is hanging the 
> visio
> document. Those seem to work fine. It is instead the Copy() that hangs 
> visio.
>
> Selection cutCopyPasteSelection = null;
> this.cutCopyPasteSelection = visioCtl.Window.Selection;
> this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
>
> "Stumple" wrote:
>
>> Hi,
>>
>> I have created my own cut/copy/paste for visio.
>>
>> Sometimes, when I try to cut a selection the entire application hangs and 
>> I
>> have to close it and restart.
>>
>> This is the code I use:
>>
>> Selection cutCopyPasteSelection = null;
>> this.cutCopyPasteSelection = visioCtl.Window.Selection;
>> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
>>
>> Sometimes this code does work, so it doesn't always hang.  Am I doing the
>> cut wrong? I copied the code from the sample in the documentation.
>>
>> Thank you.
date: Mon, 7 Jul 2008 13:35:00 -0500   author:   AlEdlund

Re: Custom Cut/Copy/Paste   
Do you think this is the same problem eventhough I have only one shape 
selected? Is there a way to create a group of selections from on shape?

Thanks

"AlEdlund" wrote:

> this may not be the solution to what is happening, but, when I had a similar 
> problem I observed that it appeared to be the number of objects in the 
> selection that was causing the hang. The workaround was to create a group of 
> the selections before attempting the paste of the group.
> al
> 
> "Stumple"  wrote in message 
> news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
> > Sorry, I posted the wrong code. It is not a Cut() that is hanging the 
> > visio
> > document. Those seem to work fine. It is instead the Copy() that hangs 
> > visio.
> >
> > Selection cutCopyPasteSelection = null;
> > this.cutCopyPasteSelection = visioCtl.Window.Selection;
> > this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
> >
> > "Stumple" wrote:
> >
> >> Hi,
> >>
> >> I have created my own cut/copy/paste for visio.
> >>
> >> Sometimes, when I try to cut a selection the entire application hangs and 
> >> I
> >> have to close it and restart.
> >>
> >> This is the code I use:
> >>
> >> Selection cutCopyPasteSelection = null;
> >> this.cutCopyPasteSelection = visioCtl.Window.Selection;
> >> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
> >>
> >> Sometimes this code does work, so it doesn't always hang.  Am I doing the
> >> cut wrong? I copied the code from the sample in the documentation.
> >>
> >> Thank you. 
>
date: Mon, 7 Jul 2008 13:52:01 -0700   author:   Stumple

Re: Custom Cut/Copy/Paste   
If it's only a single shape I doubt that it is the same problem. I ran into 
it when the shape count got around 50 shapes. Do you have your code wrapped 
with error trapping (try-catch-end try, on error, whatever) to catch what 
might be failing?
al

"Stumple"  wrote in message 
news:B5EF06C7-B665-40A4-9ABB-A2BA684013C6@microsoft.com...
> Do you think this is the same problem eventhough I have only one shape
> selected? Is there a way to create a group of selections from on shape?
>
> Thanks
>
> "AlEdlund" wrote:
>
>> this may not be the solution to what is happening, but, when I had a 
>> similar
>> problem I observed that it appeared to be the number of objects in the
>> selection that was causing the hang. The workaround was to create a group 
>> of
>> the selections before attempting the paste of the group.
>> al
>>
>> "Stumple"  wrote in message
>> news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
>> > Sorry, I posted the wrong code. It is not a Cut() that is hanging the
>> > visio
>> > document. Those seem to work fine. It is instead the Copy() that hangs
>> > visio.
>> >
>> > Selection cutCopyPasteSelection = null;
>> > this.cutCopyPasteSelection = visioCtl.Window.Selection;
>> > this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
>> >
>> > "Stumple" wrote:
>> >
>> >> Hi,
>> >>
>> >> I have created my own cut/copy/paste for visio.
>> >>
>> >> Sometimes, when I try to cut a selection the entire application hangs 
>> >> and
>> >> I
>> >> have to close it and restart.
>> >>
>> >> This is the code I use:
>> >>
>> >> Selection cutCopyPasteSelection = null;
>> >> this.cutCopyPasteSelection = visioCtl.Window.Selection;
>> >> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
>> >>
>> >> Sometimes this code does work, so it doesn't always hang.  Am I doing 
>> >> the
>> >> cut wrong? I copied the code from the sample in the documentation.
>> >>
>> >> Thank you.
>>
date: Mon, 7 Jul 2008 17:55:14 -0500   author:   AlEdlund

Re: Custom Cut/Copy/Paste   
It is quite odd behavior and I am unsure how to track it down since it is 
after I make a call to the visio code. 

I did put a try-catch block around the code today just to catch anything 
that might fall out in the future but I don't think that was the problem. 
Before, I was just walking/stepping through the code one line at a time in 
the debugger. I had actually set a beakpoint right before the .Paste() and 
then tried to walk over the .Paste() line and that is when the whole 
application locks up.

Today, I removed all breakpoints and just let the operation continue through 
and it seems to be working properly, but without being able to put 
breakpoints before and after the Paste() code I really have no way of 
debugging my code because I perform special operations specific to the kind 
of shape being copied. 

Is there an event or something that needs to be processed in order for the 
paste operation to succeed?

Thanks.

"AlEdlund" wrote:

> If it's only a single shape I doubt that it is the same problem. I ran into 
> it when the shape count got around 50 shapes. Do you have your code wrapped 
> with error trapping (try-catch-end try, on error, whatever) to catch what 
> might be failing?
> al
> 
> "Stumple"  wrote in message 
> news:B5EF06C7-B665-40A4-9ABB-A2BA684013C6@microsoft.com...
> > Do you think this is the same problem eventhough I have only one shape
> > selected? Is there a way to create a group of selections from on shape?
> >
> > Thanks
> >
> > "AlEdlund" wrote:
> >
> >> this may not be the solution to what is happening, but, when I had a 
> >> similar
> >> problem I observed that it appeared to be the number of objects in the
> >> selection that was causing the hang. The workaround was to create a group 
> >> of
> >> the selections before attempting the paste of the group.
> >> al
> >>
> >> "Stumple"  wrote in message
> >> news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
> >> > Sorry, I posted the wrong code. It is not a Cut() that is hanging the
> >> > visio
> >> > document. Those seem to work fine. It is instead the Copy() that hangs
> >> > visio.
> >> >
> >> > Selection cutCopyPasteSelection = null;
> >> > this.cutCopyPasteSelection = visioCtl.Window.Selection;
> >> > this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
> >> >
> >> > "Stumple" wrote:
> >> >
> >> >> Hi,
> >> >>
> >> >> I have created my own cut/copy/paste for visio.
> >> >>
> >> >> Sometimes, when I try to cut a selection the entire application hangs 
> >> >> and
> >> >> I
> >> >> have to close it and restart.
> >> >>
> >> >> This is the code I use:
> >> >>
> >> >> Selection cutCopyPasteSelection = null;
> >> >> this.cutCopyPasteSelection = visioCtl.Window.Selection;
> >> >> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
> >> >>
> >> >> Sometimes this code does work, so it doesn't always hang.  Am I doing 
> >> >> the
> >> >> cut wrong? I copied the code from the sample in the documentation.
> >> >>
> >> >> Thank you.
> >> 
>
date: Tue, 8 Jul 2008 07:41:00 -0700   author:   Stumple

Re: Custom Cut/Copy/Paste   
I did try doing System.Windows.Forms.Application.DoEvents() and then placing 
a breakpoint after that. So my code goes like this: 

Paste()
DoEvents()
--Breakpoint--

What I saw was the copied shape drop onto the page and then my appliction 
hung up. It appears the application only hangs if I have a breakpoint 
somewhere after I do the paste. I am not sure what is going on though and why 
a breakpoint would cause the application to hang. 

Thanks.

"Stumple" wrote:

> It is quite odd behavior and I am unsure how to track it down since it is 
> after I make a call to the visio code. 
> 
> I did put a try-catch block around the code today just to catch anything 
> that might fall out in the future but I don't think that was the problem. 
> Before, I was just walking/stepping through the code one line at a time in 
> the debugger. I had actually set a beakpoint right before the .Paste() and 
> then tried to walk over the .Paste() line and that is when the whole 
> application locks up.
> 
> Today, I removed all breakpoints and just let the operation continue through 
> and it seems to be working properly, but without being able to put 
> breakpoints before and after the Paste() code I really have no way of 
> debugging my code because I perform special operations specific to the kind 
> of shape being copied. 
> 
> Is there an event or something that needs to be processed in order for the 
> paste operation to succeed?
> 
> Thanks.
> 
> "AlEdlund" wrote:
> 
> > If it's only a single shape I doubt that it is the same problem. I ran into 
> > it when the shape count got around 50 shapes. Do you have your code wrapped 
> > with error trapping (try-catch-end try, on error, whatever) to catch what 
> > might be failing?
> > al
> > 
> > "Stumple"  wrote in message 
> > news:B5EF06C7-B665-40A4-9ABB-A2BA684013C6@microsoft.com...
> > > Do you think this is the same problem eventhough I have only one shape
> > > selected? Is there a way to create a group of selections from on shape?
> > >
> > > Thanks
> > >
> > > "AlEdlund" wrote:
> > >
> > >> this may not be the solution to what is happening, but, when I had a 
> > >> similar
> > >> problem I observed that it appeared to be the number of objects in the
> > >> selection that was causing the hang. The workaround was to create a group 
> > >> of
> > >> the selections before attempting the paste of the group.
> > >> al
> > >>
> > >> "Stumple"  wrote in message
> > >> news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
> > >> > Sorry, I posted the wrong code. It is not a Cut() that is hanging the
> > >> > visio
> > >> > document. Those seem to work fine. It is instead the Copy() that hangs
> > >> > visio.
> > >> >
> > >> > Selection cutCopyPasteSelection = null;
> > >> > this.cutCopyPasteSelection = visioCtl.Window.Selection;
> > >> > this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
> > >> >
> > >> > "Stumple" wrote:
> > >> >
> > >> >> Hi,
> > >> >>
> > >> >> I have created my own cut/copy/paste for visio.
> > >> >>
> > >> >> Sometimes, when I try to cut a selection the entire application hangs 
> > >> >> and
> > >> >> I
> > >> >> have to close it and restart.
> > >> >>
> > >> >> This is the code I use:
> > >> >>
> > >> >> Selection cutCopyPasteSelection = null;
> > >> >> this.cutCopyPasteSelection = visioCtl.Window.Selection;
> > >> >> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
> > >> >>
> > >> >> Sometimes this code does work, so it doesn't always hang.  Am I doing 
> > >> >> the
> > >> >> cut wrong? I copied the code from the sample in the documentation.
> > >> >>
> > >> >> Thank you.
> > >> 
> >
date: Tue, 8 Jul 2008 08:16:01 -0700   author:   Stumple

Re: Custom Cut/Copy/Paste   
might not be the application, might be a system event since the visio is 
unaware of break points.
al

"Stumple"  wrote in message 
news:950A12F2-8DB8-472D-9AB4-5CDC09E0993F@microsoft.com...
>I did try doing System.Windows.Forms.Application.DoEvents() and then 
>placing
> a breakpoint after that. So my code goes like this:
>
> Paste()
> DoEvents()
> --Breakpoint--
>
> What I saw was the copied shape drop onto the page and then my appliction
> hung up. It appears the application only hangs if I have a breakpoint
> somewhere after I do the paste. I am not sure what is going on though and 
> why
> a breakpoint would cause the application to hang.
>
> Thanks.
>
> "Stumple" wrote:
>
>> It is quite odd behavior and I am unsure how to track it down since it is
>> after I make a call to the visio code.
>>
>> I did put a try-catch block around the code today just to catch anything
>> that might fall out in the future but I don't think that was the problem.
>> Before, I was just walking/stepping through the code one line at a time 
>> in
>> the debugger. I had actually set a beakpoint right before the .Paste() 
>> and
>> then tried to walk over the .Paste() line and that is when the whole
>> application locks up.
>>
>> Today, I removed all breakpoints and just let the operation continue 
>> through
>> and it seems to be working properly, but without being able to put
>> breakpoints before and after the Paste() code I really have no way of
>> debugging my code because I perform special operations specific to the 
>> kind
>> of shape being copied.
>>
>> Is there an event or something that needs to be processed in order for 
>> the
>> paste operation to succeed?
>>
>> Thanks.
>>
>> "AlEdlund" wrote:
>>
>> > If it's only a single shape I doubt that it is the same problem. I ran 
>> > into
>> > it when the shape count got around 50 shapes. Do you have your code 
>> > wrapped
>> > with error trapping (try-catch-end try, on error, whatever) to catch 
>> > what
>> > might be failing?
>> > al
>> >
>> > "Stumple"  wrote in message
>> > news:B5EF06C7-B665-40A4-9ABB-A2BA684013C6@microsoft.com...
>> > > Do you think this is the same problem eventhough I have only one 
>> > > shape
>> > > selected? Is there a way to create a group of selections from on 
>> > > shape?
>> > >
>> > > Thanks
>> > >
>> > > "AlEdlund" wrote:
>> > >
>> > >> this may not be the solution to what is happening, but, when I had a
>> > >> similar
>> > >> problem I observed that it appeared to be the number of objects in 
>> > >> the
>> > >> selection that was causing the hang. The workaround was to create a 
>> > >> group
>> > >> of
>> > >> the selections before attempting the paste of the group.
>> > >> al
>> > >>
>> > >> "Stumple"  wrote in message
>> > >> news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
>> > >> > Sorry, I posted the wrong code. It is not a Cut() that is hanging 
>> > >> > the
>> > >> > visio
>> > >> > document. Those seem to work fine. It is instead the Copy() that 
>> > >> > hangs
>> > >> > visio.
>> > >> >
>> > >> > Selection cutCopyPasteSelection = null;
>> > >> > this.cutCopyPasteSelection = visioCtl.Window.Selection;
>> > >> > this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
>> > >> >
>> > >> > "Stumple" wrote:
>> > >> >
>> > >> >> Hi,
>> > >> >>
>> > >> >> I have created my own cut/copy/paste for visio.
>> > >> >>
>> > >> >> Sometimes, when I try to cut a selection the entire application 
>> > >> >> hangs
>> > >> >> and
>> > >> >> I
>> > >> >> have to close it and restart.
>> > >> >>
>> > >> >> This is the code I use:
>> > >> >>
>> > >> >> Selection cutCopyPasteSelection = null;
>> > >> >> this.cutCopyPasteSelection = visioCtl.Window.Selection;
>> > >> >> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
>> > >> >>
>> > >> >> Sometimes this code does work, so it doesn't always hang.  Am I 
>> > >> >> doing
>> > >> >> the
>> > >> >> cut wrong? I copied the code from the sample in the 
>> > >> >> documentation.
>> > >> >>
>> > >> >> Thank you.
>> > >>
>> >
date: Tue, 8 Jul 2008 10:55:18 -0500   author:   AlEdlund

Re: Custom Cut/Copy/Paste   
Something is going on. When the application hangs I right click it and tell 
it to close and then I get a form for closing it and asking to restart it 
when I close it. Then The current execution goes back to Visual Studio but I 
am unable to change anything because VS is still waiting. Eventually I can 
click the stop button at top of VS. I then have to wait for VS to prompt me 
to stop debugging. 



"AlEdlund" wrote:

> might not be the application, might be a system event since the visio is 
> unaware of break points.
> al
> 
> "Stumple"  wrote in message 
> news:950A12F2-8DB8-472D-9AB4-5CDC09E0993F@microsoft.com...
> >I did try doing System.Windows.Forms.Application.DoEvents() and then 
> >placing
> > a breakpoint after that. So my code goes like this:
> >
> > Paste()
> > DoEvents()
> > --Breakpoint--
> >
> > What I saw was the copied shape drop onto the page and then my appliction
> > hung up. It appears the application only hangs if I have a breakpoint
> > somewhere after I do the paste. I am not sure what is going on though and 
> > why
> > a breakpoint would cause the application to hang.
> >
> > Thanks.
> >
> > "Stumple" wrote:
> >
> >> It is quite odd behavior and I am unsure how to track it down since it is
> >> after I make a call to the visio code.
> >>
> >> I did put a try-catch block around the code today just to catch anything
> >> that might fall out in the future but I don't think that was the problem.
> >> Before, I was just walking/stepping through the code one line at a time 
> >> in
> >> the debugger. I had actually set a beakpoint right before the .Paste() 
> >> and
> >> then tried to walk over the .Paste() line and that is when the whole
> >> application locks up.
> >>
> >> Today, I removed all breakpoints and just let the operation continue 
> >> through
> >> and it seems to be working properly, but without being able to put
> >> breakpoints before and after the Paste() code I really have no way of
> >> debugging my code because I perform special operations specific to the 
> >> kind
> >> of shape being copied.
> >>
> >> Is there an event or something that needs to be processed in order for 
> >> the
> >> paste operation to succeed?
> >>
> >> Thanks.
> >>
> >> "AlEdlund" wrote:
> >>
> >> > If it's only a single shape I doubt that it is the same problem. I ran 
> >> > into
> >> > it when the shape count got around 50 shapes. Do you have your code 
> >> > wrapped
> >> > with error trapping (try-catch-end try, on error, whatever) to catch 
> >> > what
> >> > might be failing?
> >> > al
> >> >
> >> > "Stumple"  wrote in message
> >> > news:B5EF06C7-B665-40A4-9ABB-A2BA684013C6@microsoft.com...
> >> > > Do you think this is the same problem eventhough I have only one 
> >> > > shape
> >> > > selected? Is there a way to create a group of selections from on 
> >> > > shape?
> >> > >
> >> > > Thanks
> >> > >
> >> > > "AlEdlund" wrote:
> >> > >
> >> > >> this may not be the solution to what is happening, but, when I had a
> >> > >> similar
> >> > >> problem I observed that it appeared to be the number of objects in 
> >> > >> the
> >> > >> selection that was causing the hang. The workaround was to create a 
> >> > >> group
> >> > >> of
> >> > >> the selections before attempting the paste of the group.
> >> > >> al
> >> > >>
> >> > >> "Stumple"  wrote in message
> >> > >> news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
> >> > >> > Sorry, I posted the wrong code. It is not a Cut() that is hanging 
> >> > >> > the
> >> > >> > visio
> >> > >> > document. Those seem to work fine. It is instead the Copy() that 
> >> > >> > hangs
> >> > >> > visio.
> >> > >> >
> >> > >> > Selection cutCopyPasteSelection = null;
> >> > >> > this.cutCopyPasteSelection = visioCtl.Window.Selection;
> >> > >> > this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
> >> > >> >
> >> > >> > "Stumple" wrote:
> >> > >> >
> >> > >> >> Hi,
> >> > >> >>
> >> > >> >> I have created my own cut/copy/paste for visio.
> >> > >> >>
> >> > >> >> Sometimes, when I try to cut a selection the entire application 
> >> > >> >> hangs
> >> > >> >> and
> >> > >> >> I
> >> > >> >> have to close it and restart.
> >> > >> >>
> >> > >> >> This is the code I use:
> >> > >> >>
> >> > >> >> Selection cutCopyPasteSelection = null;
> >> > >> >> this.cutCopyPasteSelection = visioCtl.Window.Selection;
> >> > >> >> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
> >> > >> >>
> >> > >> >> Sometimes this code does work, so it doesn't always hang.  Am I 
> >> > >> >> doing
> >> > >> >> the
> >> > >> >> cut wrong? I copied the code from the sample in the 
> >> > >> >> documentation.
> >> > >> >>
> >> > >> >> Thank you.
> >> > >>
> >> > 
>
date: Tue, 8 Jul 2008 09:12:05 -0700   author:   Stumple

Re: Custom Cut/Copy/Paste   
I installed the C# Express 2008 and it seemed to fix my problem. It appears 
MS has a problem with threads in VS 2005. It is a known issue which 2008 
addresses.

"Stumple" wrote:

> Something is going on. When the application hangs I right click it and tell 
> it to close and then I get a form for closing it and asking to restart it 
> when I close it. Then The current execution goes back to Visual Studio but I 
> am unable to change anything because VS is still waiting. Eventually I can 
> click the stop button at top of VS. I then have to wait for VS to prompt me 
> to stop debugging. 
> 
> 
> 
> "AlEdlund" wrote:
> 
> > might not be the application, might be a system event since the visio is 
> > unaware of break points.
> > al
> > 
> > "Stumple"  wrote in message 
> > news:950A12F2-8DB8-472D-9AB4-5CDC09E0993F@microsoft.com...
> > >I did try doing System.Windows.Forms.Application.DoEvents() and then 
> > >placing
> > > a breakpoint after that. So my code goes like this:
> > >
> > > Paste()
> > > DoEvents()
> > > --Breakpoint--
> > >
> > > What I saw was the copied shape drop onto the page and then my appliction
> > > hung up. It appears the application only hangs if I have a breakpoint
> > > somewhere after I do the paste. I am not sure what is going on though and 
> > > why
> > > a breakpoint would cause the application to hang.
> > >
> > > Thanks.
> > >
> > > "Stumple" wrote:
> > >
> > >> It is quite odd behavior and I am unsure how to track it down since it is
> > >> after I make a call to the visio code.
> > >>
> > >> I did put a try-catch block around the code today just to catch anything
> > >> that might fall out in the future but I don't think that was the problem.
> > >> Before, I was just walking/stepping through the code one line at a time 
> > >> in
> > >> the debugger. I had actually set a beakpoint right before the .Paste() 
> > >> and
> > >> then tried to walk over the .Paste() line and that is when the whole
> > >> application locks up.
> > >>
> > >> Today, I removed all breakpoints and just let the operation continue 
> > >> through
> > >> and it seems to be working properly, but without being able to put
> > >> breakpoints before and after the Paste() code I really have no way of
> > >> debugging my code because I perform special operations specific to the 
> > >> kind
> > >> of shape being copied.
> > >>
> > >> Is there an event or something that needs to be processed in order for 
> > >> the
> > >> paste operation to succeed?
> > >>
> > >> Thanks.
> > >>
> > >> "AlEdlund" wrote:
> > >>
> > >> > If it's only a single shape I doubt that it is the same problem. I ran 
> > >> > into
> > >> > it when the shape count got around 50 shapes. Do you have your code 
> > >> > wrapped
> > >> > with error trapping (try-catch-end try, on error, whatever) to catch 
> > >> > what
> > >> > might be failing?
> > >> > al
> > >> >
> > >> > "Stumple"  wrote in message
> > >> > news:B5EF06C7-B665-40A4-9ABB-A2BA684013C6@microsoft.com...
> > >> > > Do you think this is the same problem eventhough I have only one 
> > >> > > shape
> > >> > > selected? Is there a way to create a group of selections from on 
> > >> > > shape?
> > >> > >
> > >> > > Thanks
> > >> > >
> > >> > > "AlEdlund" wrote:
> > >> > >
> > >> > >> this may not be the solution to what is happening, but, when I had a
> > >> > >> similar
> > >> > >> problem I observed that it appeared to be the number of objects in 
> > >> > >> the
> > >> > >> selection that was causing the hang. The workaround was to create a 
> > >> > >> group
> > >> > >> of
> > >> > >> the selections before attempting the paste of the group.
> > >> > >> al
> > >> > >>
> > >> > >> "Stumple"  wrote in message
> > >> > >> news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
> > >> > >> > Sorry, I posted the wrong code. It is not a Cut() that is hanging 
> > >> > >> > the
> > >> > >> > visio
> > >> > >> > document. Those seem to work fine. It is instead the Copy() that 
> > >> > >> > hangs
> > >> > >> > visio.
> > >> > >> >
> > >> > >> > Selection cutCopyPasteSelection = null;
> > >> > >> > this.cutCopyPasteSelection = visioCtl.Window.Selection;
> > >> > >> > this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
> > >> > >> >
> > >> > >> > "Stumple" wrote:
> > >> > >> >
> > >> > >> >> Hi,
> > >> > >> >>
> > >> > >> >> I have created my own cut/copy/paste for visio.
> > >> > >> >>
> > >> > >> >> Sometimes, when I try to cut a selection the entire application 
> > >> > >> >> hangs
> > >> > >> >> and
> > >> > >> >> I
> > >> > >> >> have to close it and restart.
> > >> > >> >>
> > >> > >> >> This is the code I use:
> > >> > >> >>
> > >> > >> >> Selection cutCopyPasteSelection = null;
> > >> > >> >> this.cutCopyPasteSelection = visioCtl.Window.Selection;
> > >> > >> >> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
> > >> > >> >>
> > >> > >> >> Sometimes this code does work, so it doesn't always hang.  Am I 
> > >> > >> >> doing
> > >> > >> >> the
> > >> > >> >> cut wrong? I copied the code from the sample in the 
> > >> > >> >> documentation.
> > >> > >> >>
> > >> > >> >> Thank you.
> > >> > >>
> > >> > 
> >
date: Tue, 8 Jul 2008 14:17:04 -0700   author:   Stumple

Re: Custom Cut/Copy/Paste   
glad you've got a circumvention.
al

"Stumple"  wrote in message 
news:6F96BB13-2DED-4378-9FCD-6120C1C0F67E@microsoft.com...
>I installed the C# Express 2008 and it seemed to fix my problem. It appears
> MS has a problem with threads in VS 2005. It is a known issue which 2008
> addresses.
>
> "Stumple" wrote:
>
>> Something is going on. When the application hangs I right click it and 
>> tell
>> it to close and then I get a form for closing it and asking to restart it
>> when I close it. Then The current execution goes back to Visual Studio 
>> but I
>> am unable to change anything because VS is still waiting. Eventually I 
>> can
>> click the stop button at top of VS. I then have to wait for VS to prompt 
>> me
>> to stop debugging.
>>
>>
>>
>> "AlEdlund" wrote:
>>
>> > might not be the application, might be a system event since the visio 
>> > is
>> > unaware of break points.
>> > al
>> >
>> > "Stumple"  wrote in message
>> > news:950A12F2-8DB8-472D-9AB4-5CDC09E0993F@microsoft.com...
>> > >I did try doing System.Windows.Forms.Application.DoEvents() and then
>> > >placing
>> > > a breakpoint after that. So my code goes like this:
>> > >
>> > > Paste()
>> > > DoEvents()
>> > > --Breakpoint--
>> > >
>> > > What I saw was the copied shape drop onto the page and then my 
>> > > appliction
>> > > hung up. It appears the application only hangs if I have a breakpoint
>> > > somewhere after I do the paste. I am not sure what is going on though 
>> > > and
>> > > why
>> > > a breakpoint would cause the application to hang.
>> > >
>> > > Thanks.
>> > >
>> > > "Stumple" wrote:
>> > >
>> > >> It is quite odd behavior and I am unsure how to track it down since 
>> > >> it is
>> > >> after I make a call to the visio code.
>> > >>
>> > >> I did put a try-catch block around the code today just to catch 
>> > >> anything
>> > >> that might fall out in the future but I don't think that was the 
>> > >> problem.
>> > >> Before, I was just walking/stepping through the code one line at a 
>> > >> time
>> > >> in
>> > >> the debugger. I had actually set a beakpoint right before the 
>> > >> .Paste()
>> > >> and
>> > >> then tried to walk over the .Paste() line and that is when the whole
>> > >> application locks up.
>> > >>
>> > >> Today, I removed all breakpoints and just let the operation continue
>> > >> through
>> > >> and it seems to be working properly, but without being able to put
>> > >> breakpoints before and after the Paste() code I really have no way 
>> > >> of
>> > >> debugging my code because I perform special operations specific to 
>> > >> the
>> > >> kind
>> > >> of shape being copied.
>> > >>
>> > >> Is there an event or something that needs to be processed in order 
>> > >> for
>> > >> the
>> > >> paste operation to succeed?
>> > >>
>> > >> Thanks.
>> > >>
>> > >> "AlEdlund" wrote:
>> > >>
>> > >> > If it's only a single shape I doubt that it is the same problem. I 
>> > >> > ran
>> > >> > into
>> > >> > it when the shape count got around 50 shapes. Do you have your 
>> > >> > code
>> > >> > wrapped
>> > >> > with error trapping (try-catch-end try, on error, whatever) to 
>> > >> > catch
>> > >> > what
>> > >> > might be failing?
>> > >> > al
>> > >> >
>> > >> > "Stumple"  wrote in message
>> > >> > news:B5EF06C7-B665-40A4-9ABB-A2BA684013C6@microsoft.com...
>> > >> > > Do you think this is the same problem eventhough I have only one
>> > >> > > shape
>> > >> > > selected? Is there a way to create a group of selections from on
>> > >> > > shape?
>> > >> > >
>> > >> > > Thanks
>> > >> > >
>> > >> > > "AlEdlund" wrote:
>> > >> > >
>> > >> > >> this may not be the solution to what is happening, but, when I 
>> > >> > >> had a
>> > >> > >> similar
>> > >> > >> problem I observed that it appeared to be the number of objects 
>> > >> > >> in
>> > >> > >> the
>> > >> > >> selection that was causing the hang. The workaround was to 
>> > >> > >> create a
>> > >> > >> group
>> > >> > >> of
>> > >> > >> the selections before attempting the paste of the group.
>> > >> > >> al
>> > >> > >>
>> > >> > >> "Stumple"  wrote in message
>> > >> > >> news:63EC1A51-5D4B-4276-8333-DE1B8B4C740A@microsoft.com...
>> > >> > >> > Sorry, I posted the wrong code. It is not a Cut() that is 
>> > >> > >> > hanging
>> > >> > >> > the
>> > >> > >> > visio
>> > >> > >> > document. Those seem to work fine. It is instead the Copy() 
>> > >> > >> > that
>> > >> > >> > hangs
>> > >> > >> > visio.
>> > >> > >> >
>> > >> > >> > Selection cutCopyPasteSelection = null;
>> > >> > >> > this.cutCopyPasteSelection = visioCtl.Window.Selection;
>> > >> > >> > this.cutCopyPasteSelection.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
>> > >> > >> >
>> > >> > >> > "Stumple" wrote:
>> > >> > >> >
>> > >> > >> >> Hi,
>> > >> > >> >>
>> > >> > >> >> I have created my own cut/copy/paste for visio.
>> > >> > >> >>
>> > >> > >> >> Sometimes, when I try to cut a selection the entire 
>> > >> > >> >> application
>> > >> > >> >> hangs
>> > >> > >> >> and
>> > >> > >> >> I
>> > >> > >> >> have to close it and restart.
>> > >> > >> >>
>> > >> > >> >> This is the code I use:
>> > >> > >> >>
>> > >> > >> >> Selection cutCopyPasteSelection = null;
>> > >> > >> >> this.cutCopyPasteSelection = visioCtl.Window.Selection;
>> > >> > >> >> this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
>> > >> > >> >>
>> > >> > >> >> Sometimes this code does work, so it doesn't always hang. 
>> > >> > >> >> Am I
>> > >> > >> >> doing
>> > >> > >> >> the
>> > >> > >> >> cut wrong? I copied the code from the sample in the
>> > >> > >> >> documentation.
>> > >> > >> >>
>> > >> > >> >> Thank you.
>> > >> > >>
>> > >> >
>> >
date: Tue, 8 Jul 2008 21:59:30 -0500   author:   AlEdlund

Re: Custom Cut/Copy/Paste   
On Mon, 7 Jul 2008 08:46:00 -0700, Stumple
 wrote:

>Hi,
>
>I have created my own cut/copy/paste for visio. 
>
>Sometimes, when I try to cut a selection the entire application hangs and I 
>have to close it and restart. 
>
>This is the code I use: 
>
>Selection cutCopyPasteSelection = null;
>this.cutCopyPasteSelection = visioCtl.Window.Selection;
>this.cutCopyPasteSelection.Cut(VisCutCopyPasteCodes.visCopyPasteNormal);
>
>Sometimes this code does work, so it doesn't always hang.  Am I doing the 
>cut wrong? I copied the code from the sample in the documentation.

Something to bear in mind is that once the first paste has happened
then the Selection becomes invalid.


-- 
Regards, Paul Herber, Sandrila Ltd.
Electronics for Visio        http://www.electronics.sandrila.co.uk/
date: Wed, 09 Jul 2008 11:20:24 +0100   author:   Paul Herber

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us