By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,925 Members | 1,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,925 IT Pros & Developers. It's quick & easy.

share object between DLLs

P: n/a
hello,

I'd like to know if it possible to share objects between several DLLs.
I read I had to use #pragma data_seg() but how to specify this "area"
to the others DLLs ? ( I put the #pragma in my header and added SECTION
..... in my .def)
If there is another (easier) way to do it, I'll be glad to hear it.

thanks in advance

yann

Aug 2 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
cyan wrote:
hello,

I'd like to know if it possible to share objects between several DLLs.
I read I had to use #pragma data_seg() but how to specify this "area"
to the others DLLs ? ( I put the #pragma in my header and added SECTION
.... in my .def)
If there is another (easier) way to do it, I'll be glad to hear it.

As standard C++ knows not of `DLL's, please ask your question in a
newsgroup specific to your platform.

HTh,
--ag
--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays
"If you have nothing to hide, you're not trying!"
Aug 2 '05 #2

P: n/a

cyan wrote:
hello,

I'd like to know if it possible to share objects between several DLLs.
I read I had to use #pragma data_seg() but how to specify this "area"
to the others DLLs ? ( I put the #pragma in my header and added SECTION
.... in my .def)
If there is another (easier) way to do it, I'll be glad to hear it.

thanks in advance

yann

Why do not use classFactory paradigm ?

Dll 1
MyObject myObjl
MyObject * GetMyObject ()
{
return myObj;
}

Dll 2,3,4
LoadLibrary (Dll1);
GetProcAddres ("GetMyObject");

Aug 2 '05 #3

P: n/a
On 2 Aug 2005 08:23:03 -0700, "cyan" <ya***********@yahoo.fr> wrote:
hello,

I'd like to know if it possible to share objects between several DLLs.
I read I had to use #pragma data_seg() but how to specify this "area"
to the others DLLs ? ( I put the #pragma in my header and added SECTION
.... in my .def)


It's better to ask in comp.os.ms-windows.programmer.win32 or for whatever
OS you are trying to write for.

In any case, you should take a look at Interprocess Communication methods,
which is the most traditional way of doing stuff.

Aug 2 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.