X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/f04d9ac0ffbe96ead372b84dad0786daba7f5ed7..85ef2ce64f0cc31a063fccea69fdcc7281d51548:/lcorewsaasyncselect.pas diff --git a/lcorewsaasyncselect.pas b/lcorewsaasyncselect.pas index b64797a..622c92e 100755 --- a/lcorewsaasyncselect.pas +++ b/lcorewsaasyncselect.pas @@ -2,8 +2,10 @@ unit lcorewsaasyncselect; interface +procedure lcoreinit; implementation + uses wcore,lcore,bsearchtree,sysutils,windows,winsock,pgtypes,messages,classes,lsocket; type twineventcore=class(teventcore) @@ -197,7 +199,12 @@ var lpszClassName : 'lcoreClass'); GInitData: TWSAData; +var + inited:boolean; +procedure lcoreinit; begin + if (inited) then exit; + eventcore := twineventcore.create; if Windows.RegisterClass(MyWindowClass) = 0 then halt; //writeln('about to create lcore handle, hinstance=',hinstance); @@ -216,6 +223,11 @@ begin onaddtask := winaddtask; timerwrapperinterface := twintimerwrapperinterface.create(nil); - WSAStartup($200, GInitData); + WSAStartup(2, GInitData); absoloutemaxs := maxlongint; + + + inited := true; +end; + end.