Re: [Lazarus] Panel Top Negative Limitation

2016-02-04 Thread Graeme Geldenhuys
On 2016-02-04 17:51, i...@voiceliveeditor.com wrote:
> How can this be corrected; or is there a workaround?

I'm not 100% sure, but I believe some windowing environments have a
65535px (or around that) upper limit. It might be that you are hitting
that boundary.

Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Free Pascal and Lazarus learning center

2016-02-04 Thread Graeme Geldenhuys
On 2016-02-01 14:24, Michael Schnell wrote:
> Indy is exceptionally complex.

It depends on the developer I guess. ;-)

Regards,
  - Graeme -


My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Stopping a service from within a service

2016-02-04 Thread Jy V
On Thu, Feb 4, 2016 at 8:57 PM, Richard Mace  wrote:

> On 4 February 2016 at 17:39, Jy V  wrote:
> XMLRAD stop a program registered as a service running following code,
>
> ​So, would I run this code by creating a TProcess from within my service,
> to get it to "stop" my service?
>

Just run the code from within your program as it is done inside any XMLRAD
program.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Free Pascal and Lazarus learning center

2016-02-04 Thread Graeme Geldenhuys
On 2016-02-04 16:31, Bo Berglund wrote:
> But Remy Lebeau keeps it compatible to Free Pascal too, he says...

Indeed he does, and brilliant in answering questions. I'm using the
latest Indy 10 from SVN now, and pretty much moved all my Synapse based
projects over to Indy now.

Regards,
  - Graeme -


My public PGP key:  http://tinyurl.com/graeme-pgp

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Stopping a service from within a service

2016-02-04 Thread Jy V
On Thu, Feb 4, 2016 at 8:57 PM, Richard Mace  wrote:

> On 4 February 2016 at 17:39, Jy V  wrote:
>
>> On Thu, Feb 4, 2016 at 5:41 PM, Richard Mace 
>> wrote:
>> XMLRAD stop a program registered as a service running following code,
>>
>
> ​So, would I run this code by creating a TProcess from within my service,
> to get it to "stop" my service?
>

if you have the SvcHandle available inside your program since you are the
very own running service,
you can even skip OpenSCManagerA and OpenServiceA and stop the process
directly
calling ControlService(SvcHandle, SERVICE_CONTROL_STOP, Status)
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] FreePascal TCPIP data tunnel code sample?

2016-02-04 Thread Kenny D. Lee
Are your looking for hybrid tcp/ip proxies & bind to n3tm/c3po? 

 More some the (snmp) proto-call maybe of help? I know their is an rfc's on the 
number is ???
I've ported some material look up "overbyte ics sockets" dig around!

From: Koenraad Lelong 
Sent: February 4, 2016 3:10 PM
To: lazarus@lists.lazarus.freepascal.org
Subject: Re: [Lazarus] FreePascal TCPIP data tunnel code sample?

Op 04-02-16 om 17:17 schreef Bo Berglund:
> I wonder if someone has built a program that can be used as a "tunnel"
> of data from one TCP server to a TCP client on another network?
> The program should sit in between in a computer connected to both
> networks (Ethernet and WiFi).
> If so I would be grateful to share the solutions.
>
> Reason:
> I am trying to develop a client program for controlling a data
> collection instrument, which has WiFi connectivity only.
> Its connection is implemented as a WiFi Access Point to which you
> connect. Then you have access to the data source via TCP port 1001.
> The source is actually operating via RS232 internally.
> There is a protocol involved for commanding actions and for
> transferring data in both directions.
>
> Now, I would like to be able to connect to this unit from my place of
> coding by having a multi-homed device sitting close to the instrument
> and connecting to it via the WiFi AP, but at the same time it is also
> connected to the office network by Ethernet.
> The device should run a program to connect it to the data port
> (TCP:1001) of the WiFi AP and start a TCP server on the Ethernet
> connection on TCP port 1001.
> Then whatever data comes in through the Ethernet port should be sent
> via the WiFi connection to the instrument.
> All data received from the instrument should be sent out to the
> connected client on the Ethernet connection.
> So the program I am looking for should not do anything at all with the
> data content, except transfer byte-by-byte between the networks.
>
> And this should be running on a Raspberry Pi2B so it can be easily
> deployed in the place the instrument is located. Meanwhile I can sit
> in another building and test the actual client code.
>
> Is there something like this available already?
>
>
Hi,

Isn't this just port-forwarding ? Set up the firewall to forward data to
the wired NIC to the device's address and port.

If you want it secure, you could use stunnel.

My 2 cents,

Koenraad.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Panel Top Negative Limitation

2016-02-04 Thread Martin Schreiber
On Thursday 04 February 2016 23:09:39 Graeme Geldenhuys wrote:
> On 2016-02-04 17:51, i...@voiceliveeditor.com wrote:
> > How can this be corrected; or is there a workaround?
>
> I'm not 100% sure, but I believe some windowing environments have a
> 65535px (or around that) upper limit. It might be that you are hitting
> that boundary.
>
X11 has a range of -32768..32767. Although the OP is on Windows AFAIK.

Martin

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Stopping a service from within a service

2016-02-04 Thread Richard Mace
Hi,

What's the best way of shutting down a service that is a service, having
the same effect as the user clicking stop.

Basically, I want my service to monitor a condition, which if met, it will
stop itself.

Windows Lazarus 1.4.4

Thanks

Richard
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] FreePascal TCPIP data tunnel code sample?

2016-02-04 Thread Bo Berglund
Note: I tried posting this via Gmane in my newsreader, but it did not show
up.
So I post it now directly to the mail list.
Must have been lost at Gmane because another post I made later came through.

-
I wonder if someone has built a program that can be used as a "tunnel" of
data from one TCP server to a TCP client on another network?
The program should sit in between in a computer connected to both networks
(Ethernet and WiFi).
If so I would be grateful to share the solutions.

Reason:
I am trying to develop a client program for controlling a data collection
instrument, which has WiFi connectivity only.
Its connection is implemented as a WiFi Access Point to which you connect.
Then you have access to the data source via TCP port 1001. The source is
actually operating via RS232 internally.
There is a protocol involved for commanding actions and for transferring
data in both directions.

Now, I would like to be able to connect to this unit from my place of coding
by having a multi-homed device sitting close to the instrument and
connecting to it via the WiFi AP, but at the same time it is also connected
to the office network by Ethernet.
The device should run a program to connect it to the data port (TCP:1001) of
the WiFi AP and start a TCP server on the Ethernet connection on TCP port
1001.
Then whatever data comes in through the Ethernet port should be sent via the
WiFi connection to the instrument.
All data received from the instrument should be sent out to the connected
client on the Ethernet connection.
So the program I am looking for should not do anything at all with the data
content, except transfer byte-by-byte between the networks.

And this should be running on a Raspberry Pi2B so it can be easily deployed
in the place the instrument is located. Meanwhile I can sit in another
building and test the actual client code.

Is there something like this available already?

-- 
Bo Berglund
Developer in Sweden


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Free Pascal and Lazarus learning center

2016-02-04 Thread Bo Berglund
On Mon, 01 Feb 2016 15:24:13 +0100, Michael Schnell
 wrote:

>On 02/01/2016 03:00 PM, Bo Berglund wrote:
>> And very complex to hack into as well. 
>If I can provide any help., please let me know.
>
>> So I turned to Indy10 now
>
>Not a good idea IMHO, Indy is exceptionally complex.

But Remy Lebeau keeps it compatible to Free Pascal too, he says...


-- 
Bo Berglund
Developer in Sweden


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] FreePascal TCPIP data tunnel code sample?

2016-02-04 Thread Bo Berglund
I wonder if someone has built a program that can be used as a "tunnel"
of data from one TCP server to a TCP client on another network?
The program should sit in between in a computer connected to both
networks (Ethernet and WiFi).
If so I would be grateful to share the solutions.

Reason:
I am trying to develop a client program for controlling a data
collection instrument, which has WiFi connectivity only.
Its connection is implemented as a WiFi Access Point to which you
connect. Then you have access to the data source via TCP port 1001.
The source is actually operating via RS232 internally.
There is a protocol involved for commanding actions and for
transferring data in both directions.

Now, I would like to be able to connect to this unit from my place of
coding by having a multi-homed device sitting close to the instrument
and connecting to it via the WiFi AP, but at the same time it is also
connected to the office network by Ethernet.
The device should run a program to connect it to the data port
(TCP:1001) of the WiFi AP and start a TCP server on the Ethernet
connection on TCP port 1001.
Then whatever data comes in through the Ethernet port should be sent
via the WiFi connection to the instrument.
All data received from the instrument should be sent out to the
connected client on the Ethernet connection.
So the program I am looking for should not do anything at all with the
data content, except transfer byte-by-byte between the networks.

And this should be running on a Raspberry Pi2B so it can be easily
deployed in the place the instrument is located. Meanwhile I can sit
in another building and test the actual client code.

Is there something like this available already?


-- 
Bo Berglund
Developer in Sweden


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Stopping a service from within a service

2016-02-04 Thread wkitty42

On 02/04/2016 11:41 AM, Richard Mace wrote:

Hi,

What's the best way of shutting down a service that is a service, having the
same effect as the user clicking stop.

Basically, I want my service to monitor a condition, which if met, it will stop
itself.

Windows Lazarus 1.4.4


i don't know of a ""best"" way but there are several... the easiest might be to 
monitor a disk-based semaphore file... if it exists, the service closes as you 
desire...


--
 NOTE: No off-list assistance is given without prior approval.
   *Please keep mailing list traffic on the list* unless
   private contact is specifically requested and granted.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Stopping a service from within a service

2016-02-04 Thread Jy V
On Thu, Feb 4, 2016 at 5:41 PM, Richard Mace  wrote:

> What's the best way of shutting down a service that is a service, having
> the same effect as the user clicking stop.

Basically, I want my service to monitor a condition, which if met, it will
> stop itself.


XMLRAD stop a program registered as a service running following code,

var
  SCMHandle, SvcHandle: THandle;
  Status: TServiceStatus;
begin
  Result := False;
  SCMHandle := 0;
  try
  SCMHandle := OpenSCManagerA(nil, nil, SC_MANAGER_CREATE_SERVICE);
  if SCMHandle = 0 then
  begin
SystemLogLastError('OpenSCManager');
Exit;
  end;
  SvcHandle := OpenServiceA(SCMHandle, PChar('MyService'),
SERVICE_ALL_ACCESS);
  if SvcHandle = 0 then
  begin
SystemLogLastError('OpenService');
Exit;
  end;
  if not ControlService(SvcHandle, SERVICE_CONTROL_STOP, Status) then
  begin
SystemLog(tlError, 'Error to ControlService STOP');
Exit;
  end;
  CloseServiceHandle(SvcHandle);
  finally
if SCMHandle <> 0 then
  CloseServiceHandle(SCMHandle);
  end;
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Stopping a service from within a service

2016-02-04 Thread Jy V
On Thu, Feb 4, 2016 at 5:41 PM, Richard Mace  wrote:
>
>> What's the best way of shutting down a service that is a service, having
>> the same effect as the user clicking stop.
>
> Basically, I want my service to monitor a condition, which if met, it will
>> stop itself.
>
>
Microsoft is using a loop waiting for the status to report as STOPPED
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686335%28v=vs.85%29.aspx

but since you are running the code from within your running service, it may
not be considered useful to wait for yourself (as a program) to have
completed stop.
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Panel Top Negative Limitation

2016-02-04 Thread info
Hi
I have a problem using a panel, that is large say 7.
If I try to bring areas of this into the view area by using panel.top:=-avalue, 
this works fine until you hit –32769; at which point the panel vanishes.
How can this be corrected; or is there a workaround?

I have a forum thread; where I have attached simple project demonstrating the 
problem.
http://forum.lazarus.freepascal.org/index.php/topic,31355.msg200797.html#msg200797

Any thoughts appreciated.

Josh



This email and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. 
If you have received this email in error please notify 
i...@voiceliveeditor.com. This message contains confidential information and is 
intended only for the individual named. If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail. Please notify the 
sender immediately by e-mail if you have received this e-mail by mistake and 
delete this e-mail from your system. If you are not the intended recipient you 
are notified that disclosing, copying, distributing or taking any action in 
reliance on the contents of this information is strictly prohibited.
Voiceliveeditor.com accepts no liability for the content of this email, or for 
the consequences of any actions taken on the basis of the information provided.



--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Stopping a service from within a service

2016-02-04 Thread Richard Mace
But what code would you out in the service to terminate itself? Effectively
doing the same as calling close in a GUI app?

Richard
On 4 Feb 2016 19:11,  wrote:

> On 02/04/2016 11:41 AM, Richard Mace wrote:
>
>> Hi,
>>
>> What's the best way of shutting down a service that is a service, having
>> the
>> same effect as the user clicking stop.
>>
>> Basically, I want my service to monitor a condition, which if met, it
>> will stop
>> itself.
>>
>> Windows Lazarus 1.4.4
>>
>
> i don't know of a ""best"" way but there are several... the easiest might
> be to monitor a disk-based semaphore file... if it exists, the service
> closes as you desire...
>
> --
>  NOTE: No off-list assistance is given without prior approval.
>*Please keep mailing list traffic on the list* unless
>private contact is specifically requested and granted.
>
> --
> ___
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Stopping a service from within a service

2016-02-04 Thread Richard Mace
On 4 February 2016 at 17:39, Jy V  wrote:

>
>
> On Thu, Feb 4, 2016 at 5:41 PM, Richard Mace 
> wrote:
>
>> What's the best way of shutting down a service that is a service, having
>> the same effect as the user clicking stop.
>
> Basically, I want my service to monitor a condition, which if met, it will
>> stop itself.
>
>
> XMLRAD stop a program registered as a service running following code,
>
>
​So, would I run this code by creating a TProcess from within my service,
to get it to "stop" my service?

Richard​
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] FreePascal TCPIP data tunnel code sample?

2016-02-04 Thread Koenraad Lelong

Op 04-02-16 om 17:17 schreef Bo Berglund:

I wonder if someone has built a program that can be used as a "tunnel"
of data from one TCP server to a TCP client on another network?
The program should sit in between in a computer connected to both
networks (Ethernet and WiFi).
If so I would be grateful to share the solutions.

Reason:
I am trying to develop a client program for controlling a data
collection instrument, which has WiFi connectivity only.
Its connection is implemented as a WiFi Access Point to which you
connect. Then you have access to the data source via TCP port 1001.
The source is actually operating via RS232 internally.
There is a protocol involved for commanding actions and for
transferring data in both directions.

Now, I would like to be able to connect to this unit from my place of
coding by having a multi-homed device sitting close to the instrument
and connecting to it via the WiFi AP, but at the same time it is also
connected to the office network by Ethernet.
The device should run a program to connect it to the data port
(TCP:1001) of the WiFi AP and start a TCP server on the Ethernet
connection on TCP port 1001.
Then whatever data comes in through the Ethernet port should be sent
via the WiFi connection to the instrument.
All data received from the instrument should be sent out to the
connected client on the Ethernet connection.
So the program I am looking for should not do anything at all with the
data content, except transfer byte-by-byte between the networks.

And this should be running on a Raspberry Pi2B so it can be easily
deployed in the place the instrument is located. Meanwhile I can sit
in another building and test the actual client code.

Is there something like this available already?



Hi,

Isn't this just port-forwarding ? Set up the firewall to forward data to 
the wired NIC to the device's address and port.


If you want it secure, you could use stunnel.

My 2 cents,

Koenraad.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus