Hello,
I created a docker for X7 with two buttons.
It works fine. (Thanks to bonus630. Great project).
Please could you explain or point me to other previous topic about :
1. How to check from other application if the docker is installed?
2. How to start or close the docker from other application?
3. How to press one of the buttons from other application?
Thank you in advance
When you say 'other application' can it be any type of application?
For instance, in the next VBS code, you can see how to solve the first two issues. Of course, you must know the docker guide.... In the following example I use my docker guide.
If the guide does not belong to any installed docker the code does not return any error... You can find the guide in AppUI.xslt: (in bonus630 47 line): check="*Docker('f3f09ab3-a8b6-4400-9152-62ffbe93ecb5')"
dim drawApp, Found Set drawApp = CreateObject("CorelDraw.Application") drawApp.Framework.ShowDocker "f3f09ab3-a8b6-4400-9152-62ffbe93ecb5" if drawApp.FrameWork.IsDockerVisible("f3f09ab3-a8b6-4400-9152-62ffbe93ecb5") = true then msgbox "Docker installed" Found = true else msgbox "Docker not installed" end if if Found then drawApp.FrameWork.HideDocker "f3f09ab3-a8b6-4400-9152-62ffbe93ecb5" set drawApp = nothing
Pressing the buttons is a little more difficult...
What did you succeed to do up to now? Do you have client and server already defined?
In principle, I think you shouldn't bother about the COM... If you make a server on a docker and a client on the other and they are able to communicate you do not need something else. I mean it is only necessary to define the sent messages and translate them on the receiver in whatever you wont. To press buttons, to send messages, populate list boxes, etc. For instance, if you send the character "A" and client is 'instructed' when receive it to press a specific button why the problem will not be solved? In order to be relevant you can send the button name_press. Just text...
You just have to take care that the client must listen on a specific port and the server must connect on that specific port for the known IP. If that IP is not internal and try to connect through internet, your router must forward it...
But can you tell me why this need? Is it just a way to experiment and learn, or you really need such an application? Otherwise you may use TeamViewer and take al the screen... I do not have two computers having Corel installed in a network at home and, if I will find time, I will try such an experiment at the office. Just for the sake of experimenting and learning...
On internet there are a lot of code samples to build client and server application. I would suggest the server/client like different classes and the rest of the docker project like it is now, just using the class for connection...
Can you explain how the scenario works well when the docker is loaded at Corel closing? Do you have a closing/unloaded event doing something when Corel closes?
If nothing confidential can you post the client/server code? Or to send those projects on my public mail (in my profile...)? I will try some tests on the problem you have.
Firstly, without knowing how/why all go well when the docker is loaded I would suggest using of MacroStorage QueryQuit event in order to load the docker if not loaded already. I would like to suggest the next VBA code. The code can be written on the fly by C# application and if you test and it looks to be a viable solution I will show you how can that be done:
Private Sub GlobalMacroStorage_QueryQuit(Cancel As Boolean) If Application.FrameWork.IsDockerVisible("f3f09ab3-a8b6-4400-9152-62ffbe93ecb5") = False Then Application.FrameWork.ShowDocker "f3f09ab3-a8b6-4400-9152-62ffbe93ecb5" End If End Sub
Of course, you must use your docker guide. I am afraid that if your good scenario involves the docker unloaded event it will not be triggered when Corel quits...
How can be the docker controlled by that 'helper application'? Is it used only for Corel application start or it does something for that mentioned controlling?
When you say that for having a good scenario 'On the mixed server-client-docker machine on one of the Corels I have manually to close client docker and start server docker' why that problem? Can't you use Loaded event of server docker and this one to be start by a Corel QueryQuit event?
Thank you, FaneDuru for going deep into my problem and I apologize for my English. 1. When I close Corel it saves configuration with loaded client docker and unloaded server docker. On the next starts of Corel instances Process class uses this configuration and loads all configurations as clients. After that I open CorelDraw.Application COM object and for me it is chosen randomly. In COM object I can close client and start server docker. When they are started control is mine :-). and "scenario works well ". 2. The suggestion to use QueryQuit event is excellent , I thing, I will use it. In addition I will clear an external flag (file or registry) and on the first instance of QueryQuit event the program will set it. All the rest will be clients. So thanks once again for the idea. 3. External helper is only for preparing the network configuration of clients and server .