API Support Forum
OEC API > API Support > OEC Remoting
Author Topic: OEC Remoting
(36 messages, Page 2 of 2)
Moderators: VPfau
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Nov 01, 2009 @ 03:01 PM             Msg. 2 of 36
You need to fix your code according recommendations above in this thread about calling Connect() when ConnectionClosed indicates that connection is not closed.
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Nov 01, 2009 @ 03:15 PM             Msg. 4 of 36
Regarding the issue with Automation: CreateInstance(true) returns the interface IOECClient, not the coclass. I believe the original VBA source code of the sample should be modified in your case also to take it into account.
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Nov 04, 2009 @ 05:44 AM             Msg. 6 of 36
Quote: You need to fix your code according recommendations above in this thread about calling Connect() when ConnectionClosed indicates that connection is not closed.
--- Original message by VictorV on Nov 1, 2009 03:01 PM
Thank you for explains. However:

Quote: calling Connect() when ConnectionClosed indicates that connection is not closed.


Is bolded right?
I.e. ConnectionClosed() must return "False"?
How it will return "False" when connection was not opened at all?
Client application was just started. OECAPI Class and Client are initialized only at this monent. There wasn't any trials to connect at all.

Refine please bolded statement.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Nov 04, 2009 @ 05:57 AM             Msg. 8 of 36
How the interference between Client application and Terminal may raise on if ...
... Terminal is logged to prod.openecry.api with real login-password and ....
... Client try log to api.openecry.com with its own lg-pw.

When I stop Client code execution to debug it, terminal may hung and not responce at all. It may disconnect when I continue code execution.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Nov 04, 2009 @ 08:29 AM             Msg. 10 of 36
Could you please clarify what is "Terminal" and "Client" there?

Note that remoting applications share OEC API instance and connection with the host application.
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Nov 04, 2009 @ 09:10 AM             Msg. 12 of 36
Sorry.

"Terminal" - OEC Trader (trading platform by OEC)
"Client" - my VBA client application under Excel or Access

Lets in future I will use Trader & Excel. OK?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Nov 04, 2009 @ 09:12 AM             Msg. 14 of 36
"... Terminal is logged to prod.openecry.api with real login-password and ....
... Client try log to api.openecry.com with its own lg-pw. "


this scenario is not possible using remoting. Excel app as a remoting client will use the same connection that Trader has.
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Nov 04, 2009 @ 09:33 AM             Msg. 16 of 36
I also thought that it is impossible.
Trader has own connection with own server. Excel has owns. They must not to cross in anyway ?egardless, if Excel use CreateInstance or it use standart OECClient initiating. That's right?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Nov 04, 2009 @ 09:37 AM             Msg. 18 of 36
the whole OEC Remoting feature, which is what this topic about, is intended for sharing OEC API instance between OEC Trader and 3rd party application.

If you do not need this, do not use remoting - create separate API instance not using CreateInstance(true).
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Nov 04, 2009 @ 09:50 AM             Msg. 20 of 36
Sorry if I place my post in wrong topic. Move it please to more suitable place and please answer me on the merits.

Problem is present regardles where it was described.

And please answer for the post 26 above. You ignore it.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Nov 04, 2009 @ 09:52 AM             Msg. 22 of 36
Sorry, I can't see "post 26"

Could you please restate your problem?

Note that if you are trying to have two connections to one server with same login name, it is not permitted.
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Nov 04, 2009 @ 09:54 AM             Msg. 24 of 36
Sorry. Msg. 23
http://www.openecry.com/cfbb/index.cfm?page=newreply&topicID=314&replyID=1302#NEWMSG


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia

Edited by CChen15 on Nov 4, 2009 at 09:55:17
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Nov 04, 2009 @ 10:01 AM             Msg. 26 of 36
Victor said you should not call Connect when ConnectionClosed is false.
Apparently the connection was already open because you have got OEC Trader's API instance thru remoting.
CChen15
Posts: 121
Joined: Jul 23, 2009


Posted: Nov 04, 2009 @ 10:31 AM             Msg. 28 of 36
How "the connection was already open" if Connect was not called so far...?


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Chen Hua, Russia

Edited by CChen15 on Nov 4, 2009 at 10:31:33
SergeK
-Developer-
Posts: 475
Joined: Jan 26, 2007


Posted: Nov 04, 2009 @ 05:00 PM             Msg. 30 of 36
because it is OEC API instance from OEC Trader, which is already connected.