Hi all I have created a DLL that reads the data in a text file on the server and everything works correctly.
Now I want to split the URL in the DLL and pass part of the path as an input parameter in my mql code but it does not work.
my DLL is:
My code Test Mql4 is:
Now I want to split the URL in the DLL and pass part of the path as an input parameter in my mql code but it does not work.
my DLL is:
Inserted Code
extern "C" { __declspec(dllexport) int main(std::wstring Patc) { std::ofstream fout(L"c:\\test\\_test.htm"); std::wstring url = L"https://mysite.com/" + Patch; HINTERNET hopen = InternetOpen(L"MyAppName", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); if (hopen) { DWORD flags = INTERNET_FLAG_DONT_CACHE; if (url.find(L"https://") == 0) flags |= INTERNET_FLAG_SECURE; HINTERNET hinternet = InternetOpenUrl(hopen, url.c_str(), NULL, 0, flags, 0); if (hinternet) { char buf[10000]; DWORD received = 0; int i; while (InternetReadFile(hinternet, buf, sizeof(buf), &received)) { if (!received) break; //fout.write(buf, received); int I = 0; int II = 5; for (i = 0; i <= received; i++) { //-- my read code is good!!! } system("PAUSE"); } InternetCloseHandle(hinternet); } InternetCloseHandle(hopen); } return 0; } }
My code Test Mql4 is:
Inserted Code
#import "Dll1.dll" int main(string Patch); #import nt OnInit() { Print("Serial: ", main("Read.txt")); return(INIT_SUCCEEDED); }