Undo/Redo generating unclear COMException

J

Johnny

Hi all,

I am working on a Multi Document Visio application with an ActiveX visio
drawing control in each of the opened window. I am trying implement the undo
function by using the aDC.Document.Application.Undo() function. This works
fine on single opened window or even multiple opened windows. However, this
generate an COMException if the window is opened through a QueueMarkerEvent.
What I mean is that I modified one of the shape's double click property in
the sharpsheet to execute a QueueMarkerEvent. I also implemented the
interface to handle those events. One of them as mention is when that sharp
is double click, it will open another window. Undo doesn't work on that new
window. I hope I am being clear enough. Any suggestion?? Thanks in advance.

Johnny
 
J

JuneTheSecond

How about using api, for ex. in VB.Net,
Declare Function PostMessage Lib "user32.dll" Alias "PostMessageA" _
(ByVal hWnd As Integer, ByVal wMsg As Integer, _
ByVal wParam As Integer, ByVal lParam As Integer) As Integer

Sub DoUndo()
Dim hwnd As Integer
hwnd = AxDrawingControl1.Window.WindowHandle32
Call PostMessage(hwnd, &H111, &H3F9, hwnd)
End Sub

Sub DoRedo()
Dim hwnd As Integer
hwnd = AxDrawingControl1.Window.WindowHandle32
Call PostMessage(hwnd, &H111, &H3FA, hwnd)
End Sub

sub test
DoUndo()
end sub
 

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