From: beware Date: Thu, 4 Jul 2013 00:25:32 +0000 (+0000) Subject: dnswin init must be called from lcoreinit to support NT service X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/070ae4ab75671d43ff36f02f9773c3a23c2bd345?ds=sidebyside dnswin init must be called from lcoreinit to support NT service git-svn-id: file:///svnroot/lcore/trunk@125 b1de8a11-f9be-4011-bde0-cc7ace90066a --- diff --git a/dnswin.pas b/dnswin.pas index 567ea68..17a8a97 100644 --- a/dnswin.pas +++ b/dnswin.pas @@ -39,6 +39,8 @@ type end; +procedure init; + implementation uses { zipplet: moved pgtypes to interface because it's needed for the string definitions } @@ -330,6 +332,7 @@ var hbrBackground : 0; lpszMenuName : nil; lpszClassName : 'dnswinClass'); +procedure init; begin if Windows.RegisterClass(MyWindowClass) = 0 then halt; @@ -346,4 +349,7 @@ begin nil); { CreateParam } //writeln('dnswin hwnd is ',hwnddnswin); //writeln('last error is ',GetLastError); +end; + + end. diff --git a/lcorewsaasyncselect.pas b/lcorewsaasyncselect.pas index cde709b..075d558 100755 --- a/lcorewsaasyncselect.pas +++ b/lcorewsaasyncselect.pas @@ -6,7 +6,10 @@ 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 @@ -205,6 +208,8 @@ 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);