X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/3d939725e66414faa7684bbcd5f4ffe95ee2108d..7cad80355c81569210547a281e30cd491b5bb353:/lcorewsaasyncselect.pas?ds=sidebyside diff --git a/lcorewsaasyncselect.pas b/lcorewsaasyncselect.pas index b64797a..075d558 100755 --- a/lcorewsaasyncselect.pas +++ b/lcorewsaasyncselect.pas @@ -2,9 +2,14 @@ unit lcorewsaasyncselect; interface +procedure lcoreinit; implementation -uses wcore,lcore,bsearchtree,sysutils,windows,winsock,pgtypes,messages,classes,lsocket; + +uses + dnswin, //to call init + wcore,lcore,bsearchtree,sysutils,windows,winsock,pgtypes,messages,classes,lsocket; + type twineventcore=class(teventcore) public @@ -197,7 +202,14 @@ var lpszClassName : 'lcoreClass'); GInitData: TWSAData; +var + inited:boolean; +procedure lcoreinit; begin + if (inited) then exit; + + dnswin.init; + eventcore := twineventcore.create; if Windows.RegisterClass(MyWindowClass) = 0 then halt; //writeln('about to create lcore handle, hinstance=',hinstance); @@ -216,6 +228,12 @@ begin onaddtask := winaddtask; timerwrapperinterface := twintimerwrapperinterface.create(nil); - WSAStartup($200, GInitData); + WSAStartup(2, GInitData); absoloutemaxs := maxlongint; + + wcoreinit; + + inited := true; +end; + end.