Gamestudio Links
Zorro Links
Newest Posts
Indicator coding
by Grat. 06/05/20 09:29
MT4/5 - wrong M1 time
by Grat. 06/05/20 08:34
fce for close signal
by Grat. 06/05/20 06:09
TMF - Chandelier
by danatrader. 06/05/20 05:03
The Black Book
by danatrader. 06/05/20 04:29
Multiple CCY
by DdlV. 06/04/20 23:33
Python Bridge Crash
by TipmyPip. 06/04/20 17:40
AUM Magazine
Latest Screens
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Who's Online Now
7 registered members (Morris, Grat, 3run, ChrstphFr, Mio, jenGs, 1 invisible), 458 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Frank_Shieh, PBSeven, Hardi01, Giuseppe, AdamWu
18461 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
broken plugin help #477159
05/25/19 14:26
05/25/19 14:26
Joined: Jul 2017
Posts: 10
F
fab Offline OP
Newbie
fab  Offline OP
Newbie
F

Joined: Jul 2017
Posts: 10
Hello, Im a zorro beginner. I've recently bought zorro S and Im working on implementing a broker plugin for wcx exchange.
I've managed to implement a few broker plugin functions with no issue. Using TestTrade.c I can connect to the exchange, get my balance, get tradable assets, get prices, send orders etc. This is all done using REST. However wcx encourages the use of WSS rather than REST when it comes to ticking data like prices, and order/trades updates.
So I thought to use libwebsocket for the purpose, and by linking it in, with or without openssl support, zorro does not recognize my dll any more. I cannot see it in the dropdown for the broker selection, but I dont get any error at all, not even something in any log file.
How would I find out what is wrong?

Re: broken plugin help [Re: fab] #477160
05/25/19 15:21
05/25/19 15:21
Joined: Feb 2017
Posts: 983
Chicago
AndrewAMD Offline
User
AndrewAMD  Offline
User

Joined: Feb 2017
Posts: 983
Chicago
It's hard to say with this small amount of context. It might depend on how and when that library is getting loaded.

I made a TCP socket plugin, using Boost Asio. If I had to do websockets, I would use Beast + Asio.

I've always needed to make sure that no networking objects were allocated into memory before BrokerLogin is called. Otherwise, the plugin would not be recognized.

Re: broken plugin help [Re: AndrewAMD] #477186
05/28/19 19:33
05/28/19 19:33
Joined: Jul 2017
Posts: 10
F
fab Offline OP
Newbie
fab  Offline OP
Newbie
F

Joined: Jul 2017
Posts: 10
apologize for the lack of context, but there is not much else I can see.
your suggestion is interesting, I went through my code and Im not directly doing any network object allocation before broker login, however, libwebsocket.h include might declare, but hopefully not define, something that is causing the problem.
when you say "I've always needed to make sure that no networking objects were allocated into memory before BrokerLogin", what was actually preventing zorro from seeing the dll ?
thanks

Re: broken plugin help [Re: fab] #477187
05/28/19 20:31
05/28/19 20:31
Joined: Feb 2017
Posts: 983
Chicago
AndrewAMD Offline
User
AndrewAMD  Offline
User

Joined: Feb 2017
Posts: 983
Chicago
No idea, Zorro.exe loads the DLL and then unloads it for reasons I do not understand.

Just play around with your plugin until it works. wink

Re: broken plugin help [Re: AndrewAMD] #477190
05/29/19 07:52
05/29/19 07:52
Joined: Jul 2000
Posts: 27,225
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,225
Frankfurt
Zorro first checks if the DLL can be opened with LoadLibrary. If so, it checks if there is a BrokerOpen function and if it returns 2. If both conditions are fulfilled, the DLL is registered and appears in the scrollbox. BrokerLogin is not relevant for registering.

LoadLibrary fails when DllMain uses locks or something like that, or when the DLL relies on another module that's missing. The more complex libraries you're using, the more likely is your DLL to fail on some PCs. Maybe you get details about LoadLibrary requirements on Microsoft forums.

Check your DLL's dependencies with Dependencywalker. Often you can then already see the problem. For debugging, place breakpoints in DllMain and BrokerOpen and check what's happening when Zorro starts.


Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1