Passing handle type parameter to a server's .p procedure

eMe

New Member
Hi, I have defined the next temp-table:

DEF TEMP-TABLE TTPDF NO-UNDO
FIELD ......
.............
.............
FIELD hBROWSE AS HANDLE.

The last field (hBrowse) contains the "data" of a browse (query, num-columns...) and iI have checked that in the client side it has everything correct. I'm calling to a remote procedure .p in a server, passing that temp-table as an input-output parameter, my problem is that when trying to access to that field of the temp-table in the server's .p procedure the content of the handle is null (?) (guess that is because in the server that browse doesn't exist)

how can I pass that handle without losing the data?

Thanks in advance.
 
For any doubt:
- Progress 10.1B
- The other fields (not handle) are correct in both sides, server and client.
 
A handle is nothing more than a pointer to an object that is instantiated on a machine in a progress session. So if you pass it to another machine it will point to an object that does not exist in that machine and therefor it will loose it's validity. If you want to have a browse on the other machine (or progress session) that is based on the clientside browse (although I do not see any use for it, because on the server machine you will most likely do only processing and there will be no user interaction ( a browse is a UI object) ) you will have to pass the static definitions for that browse to the other machine and instantiate a new browse based on these definitions. The same is with temp-tables. You cannot pass a temp-table handle to another machine (or progress session). You can only pass the complete temp-table.
 
I have a huge app with a lot of diferent windows, with diferent browses, I'm fetching out the data of that browse to a pdf document, I want a handle to a browse in the server side because It must be a generic code, I mean, This code it's going to be called from different windows, and it's browse may hace different columns, different widths, rows... and so on.

I need the info of the browse so I can generate a pdf from any window, just including in the windows of the client side a small temp table with a few fields.

I have the pdf_include to generate it, and it has an example similar to what i'm doing.. but not running like client-server.
 
Is it possible to pass somehow all the info into a MEMPTR, and then, in the server side, get it from the MEMPTR to a handle?

I'm not sure, but I the handle is, somehow, like a pointer to a region of memory...so if a could know the size of it, set the size of the pointer, and copy to the memptr... Maybe I'm think in a C/C++ way...

Ive been reading a lot, but I haven't found anything...
 
Is it possible to pass somehow all the info into a MEMPTR, and then, in the server side, get it from the MEMPTR to a handle?

I'm not sure, but I the handle is, somehow, like a pointer to a region of memory...so if a could know the size of it, set the size of the pointer, and copy to the memptr... Maybe I'm think in a C/C++ way...

Ive been reading a lot, but I haven't found anything...


I think the best and most simple solution to your problem is to create a dynamic temp-table on the client side that is based on the browsers columns and rows and pass this temp-table to the server to create your pdf documents.
 
Is it possible to pass somehow all the info into a MEMPTR, and then, in the server side, get it from the MEMPTR to a handle?

I'm not sure, but I the handle is, somehow, like a pointer to a region of memory...so if a could know the size of it, set the size of the pointer, and copy to the memptr... Maybe I'm think in a C/C++ way...

Ive been reading a lot, but I haven't found anything...


Only since you already have a static temp-table you can pass this to the server and create a dynamic query on the server side to generate the documents. This will be also a generic solution.
 
Only since you already have a static temp-table you can pass this to the server and create a dynamic query on the server side to generate the documents. This will be also a generic solution.

I understood (I think) the first solution you gave me, to create a dynamic Temp-table on the client side, and pass it to the server, ... but the second one...

Can you explain me a litle bit more: "...create a dynamic query on the server site..."? Thanks a lot.
 
Back
Top