The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,087 other followers

Archive for the ‘Software Development’ Category

Not to self: ERROR_ALREADY_EXIST (183) can also mean your named Mutex already exists

Posted by jpluimers on 2020/09/16

A while ago, I had an error like this when debugging plugins:

Project bds.exe raised exception class EOSError with message ‘System Error.  Code: 183.
Cannot create a file when that file already exists’.

It got was raised when [WayBackGetLastError returned ERROR_ALREADY_EXIST which according to [WayBackSystem Error Codes (0-499) (Windows) has this description:

ERROR_ALREADY_EXISTS

183 (0xB7)
Cannot create a file when that file already exists.

 

The last line is the same description that [WayBackFormatMessage returns. And it put me on the wrong foot as it wasn’t a file, but a mutex that was created: indeed [WayBackCreateMutex documents it:

If the mutex is a named mutex and the object existed before this function call, the return value is a handle to the existing object, GetLastError returns ERROR_ALREADY_EXISTS, bInitialOwner is ignored, and the calling thread is not granted ownership. However, if the caller has limited access rights, the function will fail with ERROR_ACCESS_DENIED and the caller should use the OpenMutex function.

In the mean time, the plugin doesn’t raise that as an exception any more.

–jeroen

 

Posted in Development, Software Development, Windows Development | Leave a Comment »

Using Delphi for jiggling the mouse – twm’s blog

Posted by jpluimers on 2020/09/16

To prevent a screen-saver from kicking in [WayBack] jiggling the mouse – twm’s blog:

My solution then is this procedure:

procedure JiggleMouse;
var
  Inpt: TInput;
begin
  Inpt.Itype := INPUT_MOUSE;
  Inpt.mi.dx := 0;
  Inpt.mi.dy := 0;
  Inpt.mi.mouseData := 0;
  Inpt.mi.dwFlags := MOUSEEVENTF_MOVE;
  Inpt.mi.time := 0;
  Inpt.mi.dwExtraInfo := 0;
  SendInput(1, Inpt, SizeOf(Inpt));
end;

Call it in regular intervals and the screen saver will not start.

This is now (or soon will be) in the u_dzOsUtils unit which is part of my dzlib utility library.

–jeroen

Posted in Delphi, Development, Power User, Software Development, Windows | 1 Comment »

Delphi, soap and wrapping values in cdata – Stack Overflow

Posted by jpluimers on 2020/09/15

For my link archive: [WayBack] Delphi, soap and wrapping values in cdata – Stack Overflow

–jeroen

Posted in Delphi, Development, SOAP/WebServices, Software Development, XML/XSD | Leave a Comment »

GitHub – arendst/Sonoff-Tasmota: Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE or PlatformIO

Posted by jpluimers on 2020/09/15

On my things to try on IoT stuff list: [WayBack] GitHub – arendst/Sonoff-Tasmota: Provide ESP8266 based itead Sonoff with Web, MQTT and OTA firmware using Arduino IDE or PlatformIO

Many Sonoff based devices are never updated, so this firmware will likely be a much more secure solution.

Since it supports MQTT, it should be far easier to integrate into home automation solutions.

Via a comment on [WayBack] +ITEAD Studio has just launched one of the cheapest WiFi smart plug, and it should work in most of the world thanks to 6 different plug types. https://… – Jeroen Wiert Pluimers – Google+

  • How safe would “cheap” be?
  • Linas Naginionis:
    Just flash with Tasmota firmware and you can do whatever you want with it.

The device was announced at

[WayBack] Sonoff S26 WiFi Smart Plug Works in All/Most Countries, Sells for under $10

–jeroen

Read the rest of this entry »

Posted in Development, MQ Message Queueing/Queuing, MQTT, Software Development | Leave a Comment »

Reminder to self: iocp-delphi/ThreadPool.pas at master · tondrej/iocp-delphi · GitHub

Posted by jpluimers on 2020/09/15

If I ever need a thread pool in Delphi, then I need to look at this class: [WayBack] iocp-delphi/ThreadPool.pas at master · tondrej/iocp-delphi · GitHub.

Via: [WayBack] Don’t lose time with a known Delphi bug affecting TParallel.Join Don’t lose time with a known Delphi bug affecting TParallel.Join; Ondrej Kelle – Google+

Full repository: [WayBack] GitHub – tondrej/iocp-delphi: Windows I/O Completion Port wrapper class for Delphi and Free Pascal. Wide support too:

  • compilers: Delphi 7 or higher, Free Pascal 3.0.4 or higher
  • targets: Windows XP/Windows Server 2003 or higher, both 32 and 64-bit

–jeroen

Posted in Delphi, Development, Software Development | 1 Comment »

 
%d bloggers like this: