Thanks all! I got it to work! There was 2 mistakes with my thing - first, i had an empty definition for DllMain which caused the error 126 and then , well, i called the wrong function from metatrader. I shouldve been calling MyWinFunction. I guess i wasn't doing this because i wasn't seeing it when doing nm MyWin.dll.so, i guess all that magic is done by some wine functions in the dll which i see are there!