大家好我已经创建了一个DLL,它读取服务器上的文本文件中的数据,一切正常。
现在我想在DLL中拆分URL并将部分路径作为输入参数传递给我的mql代码,但它不起作用。
我的DLL是:
插入代码extern C {__ declspec(dllexport)int main(std :: wstring Patc){std :: ofstream fout(Lc:\\ test \\ _ test.htm); std :: wstring url = Lhttps://mysite.com/ Patch; HINTERNET hopen = InternetOpen(LMyAppName,INTERNET_OPEN_TYPE_PRECONFIG,NULL,NULL,0); if(hopen){DWORD flags = INTERNET_FLAG_DONT_CACHE; if(url.find(Lhttps://)== 0)flags | = INTERNET_FLAG_SECURE; HINTERNET hinternet = InternetOpenUrl(hopen,url.c_str(),NULL,0,flags,0); if(hinternet){char buf#91; 10000#93 ;; DWORD收到= 0; int i; while(InternetReadFile(hinternet,buf,sizeof(buf),收到)){if(!received)break;/fout.write(buf,received); int I = 0; int II = 5; for(i = 0; i lt; = received; i ){// - 我的读代码很好!!!系统(PAUSE); InternetCloseHandle(hinternet); InternetCloseHandle(hopen); } return 0; }}
我的代码Test Mql4是:
插入代码#import Dll1.dll int main(string Patch); #import nt OnInit(){Print(Serial:,main(Read.txt));返回(INIT_SUCCEEDED); }