brian71us
(brian71us)
July 25, 2023, 10:41pm
1
I see there’s a Windows Service template using Oxygene and .NET, but is it possible to create one in Island?
mh
(marc hoffman)
July 26, 2023, 1:19am
2
We don’t have one, but it should be possible to do, for sure.
brian71us
(brian71us)
July 26, 2023, 10:36am
3
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?
mh
(marc hoffman)
July 26, 2023, 1:06pm
4
This should translate/covert easily then.
brian71us
(brian71us)
July 29, 2023, 2:11am
5
Actually, I think I’ve found a better reference. Namely the ServiceBase source code from mono:
//
// System.ServiceProcess.ServiceBase.cs
//
// Authors:
// Cesar Octavio Lopez Nataren (cesar@ciencias.unam.mx)
// Duncan Mak (duncan@ximian.com)
// Joerg Rosenkranz (joergr@voelcker.com)
// Vincent Povirk (madewokherd@gmail.com)
//
// (C) 2003, Ximian Inc and Cesar Octavio Lopez Nataren.
// (C) 2005, Voelcker Informatik AG
// (C) 2014, CodeWeavers Inc.
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
This file has been truncated. show original
There are some bits that I’m not sure about.
For example, there are marshal items such as
[MarshalAs (UnmanagedType.LPWStr)]
public string lpServiceName;
and
IntPtr arg = Marshal.ReadIntPtr (argPointer, IntPtr.Size * i);
args[i] = Marshal.PtrToStringUni (arg);
Are the equivalents?
1 Like
mh
(marc hoffman)
July 29, 2023, 12:05pm
6
brian71us:
For example, there are marshal items such as
[MarshalAs (UnmanagedType.LPWStr)]
public string lpServiceName;
and
IntPtr arg = Marshal.ReadIntPtr (argPointer, IntPtr.Size * i);
args[i] = Marshal.PtrToStringUni (arg);
Are the equivalents?
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
.