-
ActiveX EXE Input Please
Need some suggestions on how to deal with Mouse interaction between Client and ActiveX?
This will be ultimately be interactive drawing tools which will
draw in the client picturebox?
BACKGROUND
Created (and posted this forum) an out of process program using messaging to draw lines in the Client App. This worked, but the line always appeared underneath the Client graphics.
I believe the reason for this was that the Z-Order method comes into play in that graphic methods even though originated from another process still are graphic methods, and NO z-order exists for them.
Since ActiveX supports z-order, hopefully this will allow line placement above the client graphics.
QUESTIONS:
If I create a Mouse event in the ActiveX and raise it to the client
how do I get the currentX and currentY location to the ActiveX
without delaying the client?
Any example would be appreciated.
-
Do you mean an ActiveX control? Normally its a control that has a mouse event because it has a windowed client space. ActiveX exes are generally used as object thus being windowless and normally not having any mouse events. Or are you displaying a form from the ActiveX exe? I guess I didn't understand the situation.
-
Hi Edneeis, thanks for responding.
I meant ActiveX control. I have a whole set of drawing routines that currently reside within the client process. Since I have a realtime datafeed which draws to the window (PBoxes) every second or two, a conflict exists between the drawing routines and the tools (called from the PBox mouse events).
Trying for some time to find a way to get the tools into another process to eliminate this conflict -- messaging worked but
no zorder method existed to allow tools to show above the client graphics.
Looking for an example on how to do this -- THAT IS
call the tool from the client and have the tool draw in the client window interactively -- dragging a line around for example.
-
So the 'tool' is the control and the 'client' is any program using it? But the tool is suppose to draw on the client surface not on its own, is that correct? What is used for the drawing? An input device (i.e. Mouse)? Some coordinates (i.e. x,y)?
-
Based on my searches and reading of your posts I know your really good at this so let me explain HOW I want it to work and then maybe you can get me in the right direction.
1. I have a MDI which has a toolbar. This toolbar has various tool choices.
2. When I click on the toolbar, currently I invoke the tool I want.
(This is a constant such as TOOL_LINE.)
3. When I then click on the child form, the mouse down event is called for that child and a select/case is used to call the TOOL_LINE routine. The mouse_move and mouse_Up events also use the TOOL_LINE constant so that the line can be dragged around the screen into position.
4. The above works great in a static enviroment. For example if you put a picture into the picturebox and draw on top of it or use graphic methods and use the tools to draw on top of them.
5. ONCE you have a realtime link which updates the underlying graphics (say ever second or so), when the tools are used a conflict exits because the mouse events (TOOLS) are tied to the client window where the graphics are being drawn.
6. Using DoEvents or setting up a delay timer does NOT work.
7. Putting the TOOLS into another process works, but because
the Tool routines and realtime graphic routines both use
graphic methods (MoveTo, LineTo), no z order exists.
8. Consequently, need to get tool in another process (ActiveX) which HOPEFULLY, will allow tools to be placed ontop of graphic methods used in client.
I went back and reread a section on ActiveX components (servers) and controls and if I'm reading correctly, if I created a control I would still have to include the control inside and ActiveX component (EXE) otherwise the control would run inprocess.
So I want to recreate the ability to to just click on the toolbar in the MDI but have it call an ActiveX to do all the processing.
Hope this is clear.