How can I identify a process with an active transaction from outside the process

2018-12-17 Thread Kirk Brooks via 4D_Tech
Here's the deal - I only want a user logged in once. So if I am logged in
and walk into another room and attempt to login using a different computer
I get a message informing me I'm already logged in and asking if I want to
cancel that session.

The mechanism for managing this involves registering the clients. Clients
are registered with a string starting with their name and session id. The
check comes before a new session is created. This has been working great
for a long time.

Today I became aware of an issue involving a situation where a user had an
open transaction, got up and went to the other room and logged in. The
transaction wasn't completed. This is the first time I've been aware of an
issue because an invoice was being created in the open transaction. The
issue came to light when another user created an invoice with the same
number moments later.

The easy way to resolve this is for my method that kills the remote client
to be able to check if a process has an open transaction. I'm not coming up
with a way to do that, though. At least not one that requires adding a
bunch of overhead to track transactions.

So that's the question - can I tell a process has a transaction 'from the
outside' as it were?

From a larger perspective this illustrates how beneficial it is to
structure transactions such that they start and complete in the context of
a single operation. And yeah that means you don't open a record and start
data entry in a transaction.

-- 
Kirk Brooks
San Francisco, CA
===

*We go vote - they go home*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Appearance of Tab Control objects

2018-12-17 Thread Chip Scheide via 4D_Tech
not using v17, but maybe a method which returns an RGB value in the 
background(?) color of the tab object

Chip


> Using v17 -
> Is there any way to control the appearance of tab control objects? I have 3
> tab controls on a form and I'd like to differentiate them by maybe giving
> them a background colour or setting the font in a different colour. The
> only options seem to be the font style. I tried using *OBJECT SET COLOR *but
> that doesn't have any effect.
> 
> Pat

Hell is other people 
 Jean-Paul Sartre
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: How to print a document from LEP?

2018-12-17 Thread Keisuke Miyako via 4D_Tech
if you have already figured out how to do it via the CLI,
you are just one step away from doing the same with LEP.

if the application (AcroRd32.exe in your case) does not run directly via LEP,
you probably need to start it via cmd.exe (the console application).

see ex.10

http://doc.4d.com/4Dv17/4D/17/LAUNCH-EXTERNAL-PROCESS.301-3729951.en.html

---

passing paths to LEP can be tricky, you can find a wrapper method here:

https://github.com/miyako/4d-component-sublaunch

or a plugin here:

https://github.com/miyako/4d-plugin-shell-execute

---

unlike macOS, Windows does not support direct printing of PDF.
you need to delegate to an app that had the capability to process PDF

https://github.com/miyako/4d-plugin-direct-print

2018/12/18 5:04、Bob Miller via 4D_Tech 
<4d_tech@lists.4d.com>のメール:

I know the path to Acrobat reader and to Excel.  I can print from both of
them by bringing up the command line (Windows) and typing in something
like C:\path_to_Acrobat\AcroRd32.exe /tor
c:\path_to_Excel\Excel.exe 

However, I can't get these to work with LEP.  I'm sure I'm missing
something fundamental.



**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: How to print a document from LEP?

2018-12-17 Thread Darin Schroeder via 4D_Tech
Bob,

Is the printer you are using IP-based and understand PCL? If it is, we
basically turn the PDF into PCL using GhostScript (using LEP) and then push
the PCL to the printer using TCP commands.

This only works for PDF with GhostScript though. Maybe there's a PCL
convertor for other programs, but I'm not sure about that.

It's pretty straightforward ... TCP_Open, TCP_SendBLOB, TCP_Close.
Occasionally you may get an error with TCP_Open if the connection is
refused if the printer is busy, but a simple delay generally works the
second time around.

Darin



On Mon, Dec 17, 2018 at 2:04 PM Bob Miller via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> Hi Everyone,
>
> This is a most fundamental thing, but I've now wasted enough time on it
> that I think that either I should take some time off OR lay off the
> holiday egg nog (maybe both).
>
> If I programatically create a file using 4D, such as an Acrobat PDF file
> or an Excel file, and then I want to print it from 4D-Windows (yes, we
> have users who want to have things waiting for them _on the printer_ in
> the morning), how can I do this?
>
> I know the path to Acrobat reader and to Excel.  I can print from both of
> them by bringing up the command line (Windows) and typing in something
> like C:\path_to_Acrobat\AcroRd32.exe /tor
> c:\path_to_Excel\Excel.exe 
>
> However, I can't get these to work with LEP.  I'm sure I'm missing
> something fundamental.
>
> Thoughts?
>
>
> Bob Miller
> Chomerics, a division of Parker Hannifin Corporation
>
>
> ll
> "PLEASE NOTE: The preceding information may be confidential or privileged.
> It only should be used or disseminated for the purpose of conducting
> business with Parker. If you are not an intended recipient, please notify
> the sender by replying to this message and then delete the information from
> your system. Thank you for your cooperation."
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Appearance of Tab Control objects

2018-12-17 Thread Pat Bensky via 4D_Tech
Using v17 -
Is there any way to control the appearance of tab control objects? I have 3
tab controls on a form and I'd like to differentiate them by maybe giving
them a background colour or setting the font in a different colour. The
only options seem to be the font style. I tried using *OBJECT SET COLOR *but
that doesn't have any effect.

Pat

-- 
*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: UI Form Updates

2018-12-17 Thread Chip Scheide via 4D_Tech
you need to update the current selection of records in the selection 
from the table the listbox is displaying.
ex:
create set([table];"$Temp")
use set("Listbox_Selection_Set")
delete selection([table])
difference("$Temp";"Listbox_Selection_Set";"$Temp")
use set("$Temp")
clear set("$Temp")

Chip

On Mon, 17 Dec 2018 16:00:33 -0500, Sandor Szatmari via 4D_Tech wrote:
> I added a page to an existing form.  I can add and delete rows.  I 
> have + button to show the data entry form and a '-' button to display 
> a 'confirm the deletion of the selected row' dialog.  However, once 
> the entry form or the dialog are dismissed the ListBox in the table 
> does not update to show that the new data has been entered or 
> deleted.  If I switch to one of the other tabs in form and then 
> switch back, the ListBox reflects the addition or deletion of the 
> data.  Thanks for any help you can give.
> 
> Sandor Szatmari
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Senior Software Developer
> Bristol Capital Inc. - InfoPlus
> 201 746 7215
> www.infoplusonline.com
> 
> CONFIDENTIALITY NOTICE: This email (and any related attachments) 
> contains information from InfoPlus (a service of Bristol Capital, 
> Inc.). It is intended only for the addressee and may contain 
> information that is confidential and/or otherwise exempt from 
> disclosure under applicable law. If you are not the intended 
> recipient or are acting as agent for the intended recipient, any use 
> or disclosure of this communication is prohibited. If you have 
> received this communication in error, please notify us immediately to 
> arrange for the appropriate method of returning or disposing of the 
> communication. If our respective Companies have confidentiality 
> provisions in effect, this email and the materials contained herein 
> are deemed CONFIDENTIAL and should be treated accordingly unless 
> expressly provided otherwise.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
---
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

UI Form Updates

2018-12-17 Thread Sandor Szatmari via 4D_Tech
I added a page to an existing form.  I can add and delete rows.  I have + 
button to show the data entry form and a '-' button to display a 'confirm the 
deletion of the selected row' dialog.  However, once the entry form or the 
dialog are dismissed the ListBox in the table does not update to show that the 
new data has been entered or deleted.  If I switch to one of the other tabs in 
form and then switch back, the ListBox reflects the addition or deletion of the 
data.  Thanks for any help you can give.

Sandor Szatmari


















Senior Software Developer
Bristol Capital Inc. - InfoPlus
201 746 7215
www.infoplusonline.com

CONFIDENTIALITY NOTICE: This email (and any related attachments) contains 
information from InfoPlus (a service of Bristol Capital, Inc.). It is intended 
only for the addressee and may contain information that is confidential and/or 
otherwise exempt from disclosure under applicable law. If you are not the 
intended recipient or are acting as agent for the intended recipient, any use 
or disclosure of this communication is prohibited. If you have received this 
communication in error, please notify us immediately to arrange for the 
appropriate method of returning or disposing of the communication. If our 
respective Companies have confidentiality provisions in effect, this email and 
the materials contained herein are deemed CONFIDENTIAL and should be treated 
accordingly unless expressly provided otherwise.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

How to print a document from LEP?

2018-12-17 Thread Bob Miller via 4D_Tech
Hi Everyone,

This is a most fundamental thing, but I've now wasted enough time on it 
that I think that either I should take some time off OR lay off the 
holiday egg nog (maybe both).

If I programatically create a file using 4D, such as an Acrobat PDF file 
or an Excel file, and then I want to print it from 4D-Windows (yes, we 
have users who want to have things waiting for them _on the printer_ in 
the morning), how can I do this?

I know the path to Acrobat reader and to Excel.  I can print from both of 
them by bringing up the command line (Windows) and typing in something 
like C:\path_to_Acrobat\AcroRd32.exe /tor 
c:\path_to_Excel\Excel.exe 

However, I can't get these to work with LEP.  I'm sure I'm missing 
something fundamental. 

Thoughts?


Bob Miller
Chomerics, a division of Parker Hannifin Corporation


ll
"PLEASE NOTE: The preceding information may be confidential or privileged. It 
only should be used or disseminated for the purpose of conducting business with 
Parker. If you are not an intended recipient, please notify the sender by 
replying to this message and then delete the information from your system. 
Thank you for your cooperation."
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

4D WritePro Toolbar xliff

2018-12-17 Thread David Ringsmuth via 4D_Tech
4D v17 32bit 17.2.0.0 227919
WP_Toolbar

The tab titles show:

:xliff:Home
:xliff:insertAndView
:xliff:margins
:xliff:borders
:xliff:images
:xliff:printing
:xliff:spell

I dragged the WP_Toolbar into this database from another v17 structure that 
correctly shows the WP_Toolbar tab titles.

I compared the to form properties and they appear to be the same.

Please help!

Thanks!

David Ringsmuth

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Windows Server Machine TCP Overload?

2018-12-17 Thread Tony Ringsmuth via 4D_Tech
Thanks Miyako,

This link:

https://serverfault.com/questions/648424/windows-server-2012-r2-runs-out-of-ephemeral-ports-though-it-shouldnt
... seems like it's leading me on the right path.
I'm having our IT guys follow up on that.



On 12/14/18, 8:26 PM, "4D_Tech on behalf of Keisuke Miyako via 4D_Tech" 
<4d_tech-boun...@lists.4d.com on behalf of 4d_tech@lists.4d.com> wrote:

quick Google results, so don't quote me on this


https://support.microsoft.com/en-us/help/832017/service-overview-and-network-port-requirements-for-windows

other pages (old, window server 2008-ish)
says the number socket ports is 65535-49152=16383
but the range can be expanded with "netsh"

e.g

netsh int ipv4 set dynamicport tcp start=1025 num=64511


https://support.microsoft.com/en-gb/help/929851/the-default-dynamic-port-range-for-tcp-ip-has-changed-in-windows-vista

see also


https://serverfault.com/questions/648424/windows-server-2012-r2-runs-out-of-ephemeral-ports-though-it-shouldnt

This feels like some kind of TCP overload to me.


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Excel copy error while 4D is running (Windows)

2018-12-17 Thread Epperlein, Lutz (agendo) via 4D_Tech
Yes, I've seen this error message in the past too. But I wasn't aware there is 
a connection to 4D. I got it using Excel without 4D even on computers without 
4D installed.
And regarding the rdpclip.exe problem, AFAIK this bug is fixed in a recent 
version of 4D, I'm think at least in 4D V13 (but I'm not sure).

Sorry, I couldn't help

Regards
Lutz

> -Original Message-
> Subject: Re: Excel copy error while 4D is running (Windows)
> 
> I should have said - I've googled it myself and found the suggestions
> about  clearing the Excel/Office clipboard.  I've tried clearing the temp
> folder and the clipboard items from Excel.  It did not help.
> 
> We've seen this problem with the rdpclip.exe process in remote desktop
> sessions, and I've heard of it showing up with TeamViewer, Delphi, and
> third party clipboard managers.
> If you exit 4D, and keep copying in Excel, it stops happening, so it is
> definitely related to 4D, if not caused by 4D.
> The bottom line is that this happens consistently for a customer, and they
> know that if they exit 4D it stops happening, so they expect us to find a
> solution.
> 
> Thanks,
> 
> Jim
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Excel copy error while 4D is running (Windows)

2018-12-17 Thread Jim Hays via 4D_Tech
I should have said - I've googled it myself and found the suggestions
about  clearing the Excel/Office clipboard.  I've tried clearing the temp
folder and the clipboard items from Excel.  It did not help.

We've seen this problem with the rdpclip.exe process in remote desktop
sessions, and I've heard of it showing up with TeamViewer, Delphi, and
third party clipboard managers.
If you exit 4D, and keep copying in Excel, it stops happening, so it is
definitely related to 4D, if not caused by 4D.
The bottom line is that this happens consistently for a customer, and they
know that if they exit 4D it stops happening, so they expect us to find a
solution.

Thanks,

Jim

On Mon, Dec 17, 2018 at 5:11 AM Epperlein, Lutz (agendo) via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> I'm pretty sure the problem hasn't any relation to 4D. A quick search with
> the
> engine of your choice shows many results: "Excel The picture is too large
> and
> will be truncated"
> e.g.
>
> https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_win10/error-the-picture-is-too-large-and-will-be/fc8f6431-13c8-47f2-a4ee-2e8c04e50227
>
> In short: The user should delete the temp folder and all clipboard items.
>
> Regards
> Lutz
>
>
> > -Original Message-
> > We've seen this error over the years, but not so much recently.   Now it
> > seems to be back.
> > This is using Windows 10 build 1803, Office Professional Plus build 1811
> ,
> > 4D v12.6, _and_ 4D v17hf3 (32 bit).
> >
> > "The picture is too large and will be truncated"
> >
> > Select a fairly large Range in Excel and Copy.  If 4D is running and not
> > minimized, you may get the message.
> > Super annoying to accounting types who live in Excel.
> >
> > It may depend on what is showing in 4D. An window with enterable
> objects, a
> > plug-in like AreaList, etc.
> > It's similar to the old hang when running a Remote Desktop session to a
> > server running 4D Server.  Killing the rdpclip.exe process fixed that.
> >
> > Does anyone have any answers to prevent this?  Can we tell 4D to not try
> to
> > interpret the clipboard?
> > "On Deactivate 4D" set Focus to a non-enterable form object?
> >
> > For what its worth, I did some tests with this code, based on the
> > documentation.
> > Copying a Sheet from Excel could produce a 100MB emf picture format,
> along
> > with UTF16 and native text.
> >
> >
> > ARRAY TEXT(4Dsignatures;0)
> > ARRAY TEXT(nativeTypes;0)
> > ARRAY TEXT(formatNames;0)
> >
> > GET PASTEBOARD DATA TYPE(4Dsignatures;nativeTypes;formatNames)
> > $totalSize_r:=0
> > For ($i;1;Size of array(4Dsignatures))
> >   If (4Dsignatures{$i}#"")
> > $size_r:=Pasteboard data size(4Dsignatures{$i})
> > $totalSize_r:=$totalSize_r+$size_r
> > $msg:=4Dsignatures{$i}+": "+String($size_r;"###,###,### bytes")
> > ALERT($msg)
> >   End if
> > End for
> >
> > ALERT("Total Size:  "+String($totalSize_r;"###,###,###"))
> >
> > Thanks,
> >
> > Jim
> > *
> > *
> > 4D Internet Users Group (4D iNUG)
> > Archive:  http://lists.4d.com/archives.html
> > Options: https://lists.4d.com/mailman/options/4d_tech
> > Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> > *
> > *
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Excel copy error while 4D is running (Windows)

2018-12-17 Thread Epperlein, Lutz (agendo) via 4D_Tech
I'm pretty sure the problem hasn't any relation to 4D. A quick search with the
engine of your choice shows many results: "Excel The picture is too large and 
will be truncated"
e.g.
https://answers.microsoft.com/en-us/msoffice/forum/msoffice_excel-mso_win10/error-the-picture-is-too-large-and-will-be/fc8f6431-13c8-47f2-a4ee-2e8c04e50227

In short: The user should delete the temp folder and all clipboard items.

Regards
Lutz


> -Original Message-
> We've seen this error over the years, but not so much recently.   Now it
> seems to be back.
> This is using Windows 10 build 1803, Office Professional Plus build 1811 ,
> 4D v12.6, _and_ 4D v17hf3 (32 bit).
>
> "The picture is too large and will be truncated"
>
> Select a fairly large Range in Excel and Copy.  If 4D is running and not
> minimized, you may get the message.
> Super annoying to accounting types who live in Excel.
>
> It may depend on what is showing in 4D. An window with enterable objects, a
> plug-in like AreaList, etc.
> It's similar to the old hang when running a Remote Desktop session to a
> server running 4D Server.  Killing the rdpclip.exe process fixed that.
>
> Does anyone have any answers to prevent this?  Can we tell 4D to not try to
> interpret the clipboard?
> "On Deactivate 4D" set Focus to a non-enterable form object?
>
> For what its worth, I did some tests with this code, based on the
> documentation.
> Copying a Sheet from Excel could produce a 100MB emf picture format, along
> with UTF16 and native text.
>
>
> ARRAY TEXT(4Dsignatures;0)
> ARRAY TEXT(nativeTypes;0)
> ARRAY TEXT(formatNames;0)
>
> GET PASTEBOARD DATA TYPE(4Dsignatures;nativeTypes;formatNames)
> $totalSize_r:=0
> For ($i;1;Size of array(4Dsignatures))
>   If (4Dsignatures{$i}#"")
> $size_r:=Pasteboard data size(4Dsignatures{$i})
> $totalSize_r:=$totalSize_r+$size_r
> $msg:=4Dsignatures{$i}+": "+String($size_r;"###,###,### bytes")
> ALERT($msg)
>   End if
> End for
>
> ALERT("Total Size:  "+String($totalSize_r;"###,###,###"))
>
> Thanks,
>
> Jim
> *
> *
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> *
> *
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Coding/Development Style Guide?

2018-12-17 Thread Jeremy Roussak via 4D_Tech
And one that I’ve seen frequently: there are 10 kinds of people in the world: 
those who understand binary and those who don’t.

Jeremy

> On 17 Dec 2018, at 03:51, Tom Benedict via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> 
>> On Dec 16, 2018, at 14:24, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> Remember what they say, there are only 2 hard things in writing code:
>> naming things, clearing the cache and the off-by-one problem.
>> 
> That reminds me a signature I’ve seen thousands of times here. "There are 
> three kinds of mathematicians, those who can count and those who can’t.


**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**