
Share variables or properties of an object between programs
In the .BAS module Dim the variables as Private
Then Call a procedure from the exposed class(es) to get/set these
variables.
You could simply Dim the variables as Public and access them from the
exposed Class(es) - but IMO that is not really good practice.
BTW the exposed Class's Instancing Property needs to be set to 5 -
Multiuse
5 MultiUse. Allows other applications to create objects from the
class. One instance of your component can provide any number of
objects created in this fashion.
On Fri, 29 Mar 2002 10:47:24 -0600, "Tommy Martin"
Quote:
>I have tried this. I am not getting seeing the variable. I can create the
>object in the ax exe. I wrote a routine in the ax exe cls module to read and
>set the public variable but it always comes back empty from the other
>program.
>I must be doing something wrong. In my main I am creating the object. Is
>this correct? Any ideas what I may be doing wrong?
>Thanks in advance.
>Tommy
>> no, you can't, because dll objects have one variable set for each thread
>> you have to use an ActiveX EXE (which live in a separate process) with a
>> multiuse class, so
>> that every instance of the class lives in the same process. Then declare
>> some global variables
>> in a standard module.
>> In order to ensure all objects to live in the same thread you must have,
>in
>> the General tab
>> of project properties, Threading model set to 'Thread pool' with '1' in
>the
>> text box
>> > I need to share data between programs. Is it possible to create a dll
>with
>> > an object in it that I can set properties or variables in and see it
>from
>> > more than 1 program?
>> > Any tips are really appreciated.
>> > Tommy