Windows Service application with Island?

I see there’s a Windows Service template using Oxygene and .NET, but is it possible to create one in Island?

We don’t have one, but it should be possible to do, for sure.

Do you have any documentation or examples that you can provide?
Does IslandRTL currently have any facilities to support this?

For example, I have found this documentation for creating one in C++:

From the looks of it this example is referencing “advapi32.lib” which I am guessing is a wrapper for advapi32.dll. Is there a similar wrapper in IslandRTL or do I need to start from scratch?

This should translate/covert easily then.

Actually, I think I’ve found a better reference. Namely the ServiceBase source code from mono:

There are some bits that I’m not sure about.

For example, there are marshal items such as

[MarshalAs (UnmanagedType.LPWStr)]
public string lpServiceName;


IntPtr arg = Marshal.ReadIntPtr (argPointer, IntPtr.Size * i);
args[i] = Marshal.PtrToStringUni (arg);

Are the equivalents?

1 Like

These would be specific to .NET/Mono. Assuming you’re still targeting native/Island here, you could just pass/treat these as they are. an LPWStr, as I recall, is a long pointer to a wide string, IOW a standard null-terminated ^Char.