PxPlus User Forum

Main Board => Discussions => Thin Client/WindX => Topic started by: Jeff Wilder on May 04, 2020, 01:09:46 PM

Title: Does ObjectID user object function over WindX?
Post by: Jeff Wilder on May 04, 2020, 01:09:46 PM
Does the ObjectID user object method feature work over a WindX connection? I am having trouble attaching my custom object.
When I run the following program locally, it prints the objectID for my user object and sets the value. When ran over a WindX connection, it prints 0 (zero) and gives an error 88.

Code: [Select]
0010 BEGIN
0020 LET X=10
0030 GRID X,@(1,1,60,10)
0040 LET O=NEW("myGrid",X)
0050 LET X'OBJECTID=O
0060 PRINT 'LF','LF',X'OBJECTID
0070 X'SETVALUE(1,1,"hi")
0080 INPUT "Press Enter",*
0090 GRID REMOVE X
0100 END

myGrid.pvc is a clone of the example provided in the manual at https://manual.pvxplus.com/PXPLUS/properties/objectid.htm (https://manual.pvxplus.com/PXPLUS/properties/objectid.htm)
I am using PxPlus 15.10 on the server and WindX.

Thank you,
Jeff
Title: Re: Does ObjectID user object function over WindX?
Post by: EVa on May 06, 2020, 05:30:44 AM
Jeff,

It will probably work when your custom object exists on the WindX PC (or is accessible from the WindX PC) and you change line 40 to:

LET O=NEW("[LCL]{path}myGrid",X)

where {path} is optional (and a true path).


-Eric-
Title: Re: Does ObjectID user object function over WindX?
Post by: Jeff Wilder on May 06, 2020, 02:55:55 PM
Thank you Eric. That does appear to work.

However, moving the custom object to the client defeats the purpose I had in mind for using the object in the first place. I had created some methods that aided a particular application's responsiveness by reducing the network traffic to the workstation. I suppose I can make it into a standalone class, but I really liked the idea of extending the grid's properties and having PxPlus manage the life of the class with the graphical control.

Best Regards,
Jeff
Title: Re: Does ObjectID user object function over WindX?
Post by: Thomas Bock on May 07, 2020, 02:20:10 AM
Jeff,

As long as you want to delegate the life time to PxPlus you can use "for control" in the new function.
We do a lot of instantiations in the post create logic like this:
Code: [Select]
myObj = new("myClass", id for control id)This doesn't reduce network traffic, but you can improve the API of any control with your classes.