> Can I call a procedure from a MDI child window when i accepted a
> toolbar button on the frame? How to implement this?
I'm not sure that you really want it :)
What happens if you open the window a few times?
Anyway you can send a message to your MDI Child window from a frame.
You must know the thread of a child window.
It will look something like this:
At Global embeds you must define the global event:
MyEvent EQUATE(EVENT:User + 1)
You must define the global variable or queue to store the threads of
child windows:
MyChildThread LONG
OR
MyChildThreadQueue QUEUE
ThreadNo LONG
END
When child window is opened you must store the thread:
MyChildThread = THREAD()
OR
MyChildThreadQueue.ThreadNo = THREAD()
ADD(MyChildThreadQueue)
When child window closed you must delete the thread:
MyChildThreadQueue.ThreadNo = THREAD()
GET(MyChildThreadQueue,MyChildThreadQueue.ThreadNo)
IF NOT ERRORCODE()
DELETE(MyChildThreadQueue)
END
When you are work with a global variables you need to use a
CriticalSection!!!
At the toolbar button embed:
POST(MyEvent,,MyChildThread)
OR
LOOP j# = 1 TO RECORDS(MyChildThreadQueue)
GET(MyChildThreadQueue,j#)
POST(MyEvent,,MyChildThreadQueue.ThreadNo)
END
At the windows ACCEPT LOOP
IF EVENT() = MyEvent
...DO something
END
I think that is all :)
I implement like your sugestion.