1S how to make global variable a COM object?

Work with com object of 1C, the problem with the namespace, this object exists only within the function in which it was created. The props attach can't swear 1C , in a global variable you can believe, but 1S work with it refuses. Don't understand what the problem is, because of this, the functionality is severely limited.
March 19th 20 at 08:36
4 answers
March 19th 20 at 08:38
Solution
If you want to reuse COM between server invocations, it is possible to try General module re return values. Then if a user session is migrated to another rphost, and less than 20 minutes between calls, then the com connection will be installed only once. On the client simpler - in the beginning of the form module to write
&Naciente
AC Mojeremane

and use it to com object. In General, the technology is outdated, I would look for alternatives.
on the server it will not work, I only link as it is necessary to store in the global space of names. To pass it to another function. - Tyler_Schu commented on March 19th 20 at 08:41
@Tyler_Schu, I'm writing: on the server use instead of the result of the function from the module with the re-return values - Ulises.Hansen commented on March 19th 20 at 08:44
@Ulises.Hansen, Yes, as if yet lived, called a function, or passing an argument of profit. the problem started there when the functions are unrelated, and need to access this space of names - Tyler_Schu commented on March 19th 20 at 08:47
Thank you, and how it declares the variable, and she did not want to work. In the book on 1C were silent about it. - Tyler_Schu commented on March 19th 20 at 08:50
March 19th 20 at 08:40
We use the session values stored in this address to a temporary warehouse
When you create a COM connection, store it in temporary storage and the address in the session option
If necessary, at get the connection from the repository
It's only for old compatibility modes, running. - Ulises.Hansen commented on March 19th 20 at 08:43
March 19th 20 at 08:42
Swears when the global <server> variable trying to get on the client?
COM swears when I try to do props. On the client as it works. - Tyler_Schu commented on March 19th 20 at 08:45
March 19th 20 at 08:44
1) If working with COM going on in a single module (the form's module, module, processing facility, etc.), then the procedures in the section variables to declare a new variable, and then to initiate a new connection and use, while associated with a module object in memory.

2) If one connection is needed to "drive" (as an option) between the different treatments, which (further complicate) are invoked from the background process, then you can pass using parameters.

*) Here in the comments wrote about the ability to place in temporary storage. Maybe it is possible - never tried. But keep in mind that placed in a temporary storage of values without specifying a unique identifier for a lifetime only to the first server call, and then the value is removed, while specifying the unique identifier, the valid ID only existing form and the lifetime limited by the lifetime of a form (it's easier to make the export variable on the form).

Find more questions by tags 1C