12-22-2014 01:51 PM
Hello -
I've used the CVI (2012 SP1) "Create ActiveX Server" tool to create a server, and have also used the "Create ActiveX Controller" tool to produce the companion controller code. All of this seems to be working. However, I'm wondering about controlling server invocation. I notice that the server is invoked automatically when a corresponding controller library "New" method is invoked to obtain an object handle. If I start the server from a Windows command shell, then start a test that uses the controller library, a new copy of the server is started (the running server is ignored). Is there any way to direct the client code / controller library to use the already-running server instead of starting a new one? The help for the controller "New" methods says:
"If the server application is already running, this function may or may not start another copy of the application. This is determined by the server application."
Can I use the CVI ActiveX server tools to configure the server for the desired behavior, then? I don't notice anything among the obvious configuration options that seems to address this behavior.
Thanks in advance!
--Barry
12-23-2014 01:49 PM
Hey Barry,
What particular behavior are you trying to obtain? Is it possible for you to process multiple objects per invocation?
12-23-2014 03:03 PM
Hi, Haley -
The desired behavior would be for the client code to bind to the already-running server application rather than starting a new copy of the server. We'd like to be able to start the server from the command line and have this become the one and only active server.
Regarding your question about processing multiple objects, I'm not sure if this applies. Our server implements multiple interfaces and the same number of objects, with a one-to-one mapping between interfaces and objects. The server interface methods don't really do any object processing, per-se, I think; the object handle received by these methods is not used. I'm not sure I'm answering your question - let me know if I can clarify further.
Barry
12-26-2014 12:32 PM
Hey Barry,
From what I understood you are just trying to bind to the already created server (ie, you don't want to create another copy of the server). IS this correct? If so, I will look into this and see what I can find to help you resolve this.
12-26-2014 06:18 PM
Hi, Rob. Yes, I think you have it exactly. Thanks in advance! --Barry
12-29-2014 01:48 PM
Hey Barry,
As you stated before, "If the server application is already running, this function may or may not start another copy of the application. This is determined by the server application." I'm going to have to try creating a new server application to poke around. I know you've already poked around to find the configuration, but I'll double check to see what I can find. It might take me a bit, but I'll let you know. Thanks
12-29-2014 07:48 PM
Much appreciated, Rob. --Barry
12-30-2014 04:05 PM
Barry,
Would it be possible to post some screen shots of what your Server Setup looks like? You should just be able to go to Tools>>Edit ActiveX Server and take the screen shots of the Server Settings (e.g. the server name, type, etc...) and one of the Advanced Options tab you can open from the Server Settings. This would help me to double check and make sure I'm getting the same behaviour.
01-05-2015 10:39 AM
Hi, Rob -
I'm attaching the requested screenshots. Let me know if I can provide anything further.
Barry
01-06-2015 03:14 PM
After poking around in the code, this function might be where you need to make the changes, or around there. The configuration boxes look like they don't have the option to make the changes you requested, therefore we could try diving into the code created when we make the server.