Re: Can this be done?




"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



.



Relevant Pages

  • Re: Can this be done?
    ... That's got a great primer on attaching multiple applications to a single ActiveX EXE, and some of the issues involved. ... 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, ...
    (microsoft.public.vb.general.discussion)
  • Re: Can this be done?
    ... I have a second standard EXE that wants to ... access the already created ActX DLL to read settings that are already set. ... alternative is when one app changes a piece of data then it should send a ...
    (microsoft.public.vb.general.discussion)
  • Re: WSE 3.0 settings
    ... I can make it work by putting all settings in main ... I want to use third party DLL (Or I have to develop a DLL to be used in other ... config file and put it in my main exe file. ...
    (microsoft.public.dotnet.framework.webservices.enhancements)
  • Re: access the calling users config info from a dll?
    ... You should not read exe's app settings directly from inside dll's code. ... reasons to use dll). ... with certain exe, the dll's reuseability is go partially or completely, even ... I'd never read user/app config in dll. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • global variables in dynamic libraries
    ... I have a dll whose methods work in a global variable. ... declared in a header file used by the application (exe). ... If it is in the data segment, is there a limit to the data ... global variables to the dll and expect the exe to work fine? ...
    (comp.lang.c)

Loading