Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by THANHNM


    Could not load OpenSSL library.

    Oh tks, it's working now! I thought the bit version is about the OS, didn't read the document carefully

    Could not load OpenSSL library.

    I'm currently facing this kind of problem "Could not load OpenSSL library". "WhichFailedToLoad" always returns "failed to load libeay32.dll" although I used "IdOpenSSLSetLibPath" Using Delphi 10.2 with Indy and tried all DLL from https://github.com/IndySockets/OpenSSL-Binaries for version 1.0.2 x64 (My app writing in 32bit and run on 64bit window 10)
  3. So Is that mean I can't simply call RegisterServiceCtrlHandlerEx from Delphi? And does windows 10 fast-startup throws those events too? Because I need to stop my service when Hibernate/Shutdown and resume it on after Waked-up/Startup. I'm trying this: function MySvcHandlerFunctionEx(dwControl, dwEventType: DWORD; lpEventData, lpContext: Pointer): DWORD; stdcall; var _lpContext: PMyDefine; F: TextFile; begin AssignFile(F, 'C:\Test.txt'); try if FileExists('C:\Test.txt') then Append(F) else Rewrite(F); WriteLn(F, 'Got Data: ' + inttostr(dwControl)); if dwEventType = WM_POWERBROADCAST then begin _lpContext := PMyDefine(lpContext); WriteLn(F, 'MySvcHandler: ' + IntToStr(dwControl) + ' - ' + _lpContext.s); end; finally Result := NO_ERROR; CloseFile(F); end; end; procedure TCMCRTEngine.ServiceStart(Sender: TService; var Started: Boolean); var lpContext: PMyDefine; begin ... New(lpContext); lpContext.s := 'My_Test_Svc'; SvcHandler := RegisterServiceCtrlHandlerEx(PWideChar('MyService'), @MySvcHandlerFunctionEx, lpContext); end; And I didn't receive anything yet