API Support Forum
OEC API > API Support > Remoteing in Detail
Author Topic: Remoteing in Detail
(6 messages, Page 1 of 1)
Moderators: VPfau
TTrushar
Posts: 7
Joined: May 04, 2009


Posted: Sep 26, 2009 @ 04:09 AM             Msg. 1 of 6
hi,

i want to use remoting but i donot know how to... i tried pdf in documents but that way it is not working! i have a main application that connects using login and pass to server using client.connect(.....) and works fine in this primary app i mention oec.api.remotehostingenabled=true.

now i am working on diffrent solution where i make one object of client and i write client.createinstance(true). everything mentioned in document but i am not getting any event etc from primary application to this application. well in main application everything works fine....

can you please give me detailed info how to get connected to primary applciation... via remoting...

thanks

Trushar Kapadia
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Sep 30, 2009 @ 10:03 AM             Msg. 2 of 6
Hello,

What kind of application is the second one: Windows Forms or Console Application? All events go through a thread that created the instance of OECAPI and this thread should pump Windows messages.
TTrushar
Posts: 7
Joined: May 04, 2009


Posted: Oct 02, 2009 @ 02:39 AM             Msg. 3 of 6
the first and second application both are windows forms application.

first application has something like
OEC.API.OECClient.Global.RemoteHostingEnabled = True
Me.client.RemoteHostingEnabled = True

where me.client is a objectr of api.oecclient

here in this application all the events are handled and working fine eg. onlogin complete etc. iget all the data like trades charts etc.

---------

now the second application just do object.createinstance(true)... and has all the events of oecclietn object

is there anything else i need to do with second applciation???

and what is windows messages????

Trushar Kapadia
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Oct 06, 2009 @ 10:02 AM             Msg. 4 of 6
Hello,

did you test your second application with OEC Trader with enabled "Allow Remoting"?
TTrushar
Posts: 7
Joined: May 04, 2009


Posted: Oct 07, 2009 @ 06:52 AM             Msg. 5 of 6
my second application has just nothing

it only has client.createinstance(true) and events of client object. i read some tihing about remoting on google. so i want to know how to send windows messages to the remote application which is a main application and has a connection to oecapi. please provide me some syntex. if you have any example then that would be more helpful.

thanks

Trushar Kapadia
VictorV
Posts: 746
Joined: May 08, 2007


Posted: Oct 07, 2009 @ 04:04 PM             Msg. 6 of 6
If you are using Windows Forms, you don't need to code message pumping by yourself.

You can use our sample (http://www.openecry.com/services/api_highlights.cfm?ClientUpdate=0_5001) and modify it to test your applications. You need the next modifications there:
1. For master application please add m_cli.RemoteHostingEnabled = true;
in MainForm constructor
2. For second application please change
OECClient m_cli = new OECClient();
to
OECClient m_cli = OECClient.CreateInstance(true);

That's all. After that you need to run the master application and then the second one to see remoting in action.