Re: Can this be done?
- From: "MikeD" <nobody@xxxxxxxxxxx>
- Date: Fri, 30 Nov 2007 21:45:55 -0500
"Kevin Provance" <casey@xxxxxxxxxxx> wrote in message
news:eWy%23mTyMIHA.4136@xxxxxxxxxxxxxxxxxxxxxxx
Okay, lets say I have a standard EXE that uses an ActX DLL to store/read
and
write program settings. Now, I have a second standard EXE that wants to
access the already created ActX DLL to read settings that are already set.
Obviously I can use my second EXE to create an instance of that DLL, but
it
won't have the settings already selected. Is there some trick making the
second program use the instanced DLL without having to create a new one?
Put another way, I want two different programs to share one instance of
the
DLL and the settings it holks.
I don't think there's any way to share an instance of an object from an
ActiveX DLL because as others said, they're in-process components.
While I don't really recommend this because I think it's dangerous and can
potentially result in many problems, assign the data you want "shared" to
global variables (i.e. declared in a .bas file of your ActiveX DLL project).
IOW, the global variables are the member variables for the properties of
your DLL's class(es).
You're just going to have to be very careful that you don't change a
property in one EXE that the other EXE isn't expecting. There's really no
way you could make the properties read-only to one EXE and read/write to the
other, but you could have another property, ReadOnly, that you set either
True or False (don't use a global member variable for this)...and then write
appropriate code in the Let procedure to check the ReadOnly property before
making the assignment to the global member variable.
Let me know if this doesn't make sense. I could probably whip up a simple
demo pretty quickly.
--
Mike
Microsoft MVP Visual Basic
.
- Prev by Date: Re: Dumb question about AppId, CLSID and GUID...
- Next by Date: Re: Dumb question about AppId, CLSID and GUID...
- Previous by thread: Re: Form is truncated.....
- Next by thread: Re: Can this be done?
- Index(es):
Relevant Pages
|
Loading