Hello !
It seems you're approaching the problem from a wrong point of view. If you
have a static library that contains the data, then you put this data into a
database, and have several dynamic-link libraries that use this data, then
why don't you use the database itself to share the data ?
The static library can be linked with multiple DLLs, but the instance of
data is not consistent (= is not the same) across DLLs linked with the
library. Each DLL will get a seperate copy of the data via the static
library. If the static library is not linked with the DLL, the DLL will not
have the data at all.
The best solution to this problem is to utilize the database. This means
that the static library contains routines that will automatically invoke a
connection to the database, download the necessary data, and place it into a
data structure usable by the DLL to which it's linked. The advantage is that
whenever the DLL is loaded, the data received by the static library is
dictated by the database. Thus, if the database access is updatable
(refreshable recordset), each DLL will constantly have an updated copy of
the data to work with. The downside of this solution is it's complexity:
database access and synchronization are not the easiest of tasks.
Other alternative solutions might exist, such as using the Clipboard, but
they're quite prone to errors caused by simultaneous execution of other
software (like a drawing program or Office program accessing the clipboard).
I hope this answers your question. If it does not, post a follow-up,
describing your problem in further detail. The original scenario post wasn't
very clear on what you were trying to do, and what available resources you
had to do it with.
-Antti Keskinen
"Rich" <Ri**@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
Hi there,
For a quite big application, I need to get large amount of data within a
static library (xxx.lib) and put them in a database (a class, say we call
it
CData), and then make it accessible by a few different dynamic library
files
(yyy.dll, .). I've tried to create a global class object of CData*, say
pData, by declaring it as an external in the header and initiate it in the
cpp of a dll file. But it doesn't work. Other dlls will complain about
undefined variable of CData * pData in their obj when I am trying to link
them. It would be greatly appreciated if anyone could give me some
suggestions how to realize this.
Thanks in advance.
Rich