Hello,
I have never had these problems before. It seems that I correctly wrapped the api in vb.net.
I think your problem likely lies within the wrapper itself. It is weird enough to wrap the api in Perl and C and then run on Cygwin. As far as I know, mt3 api doesn't work well with Cygwin. The mt3 api is already in C, so no need to rewrap in C, and Perl is not the right language to do the job--the main problem might due to the structure marshalling of Perl as well. Have you check the type/structure interoperatibily of C and Perl?
Anyway, which language do you use to write the trading bot?