Control two data sections

J

John K.

Hi all,
I'm writing a Win32 DLL. I'd like to create two data sections:
one shared (among all the processes that will load this DLL),
and the other not shared. Then I would like to place some
variables (or arrays) in one data section or in the other.

In assembly it's quite simple (dunno if it applies to DLLs,
though) to create several sections, each one with the wanted
attributes.. but in C++?

Must I create independently-compiled-OBJ files and then link
them together to achieve this result, or can I use some simple,
more intuitive way to declare variables to be put in this or
that section?

In assembly I'd just put a "SECTION" directive.. is there maybe
some #pragma (for VisualC++ 7.0) that allows me to use such a
simple solution also in C++?

To sum it all, I'd want to have two data sections: one RW and
the other RWS.. and then easily declare where to put each
variable.. in which of the two sections.

Thank you!
John
 
J

John Harrison

John K. said:
Hi all,
I'm writing a Win32 DLL. I'd like to create two data sections:
one shared (among all the processes that will load this DLL),
and the other not shared. Then I would like to place some
variables (or arrays) in one data section or in the other.

In assembly it's quite simple (dunno if it applies to DLLs,
though) to create several sections, each one with the wanted
attributes.. but in C++?

The concepts of DLL's and data sections don't exist in the C++ language.
This is a C++ language group.

You need a group that discusses how one particular implementation of the C++
language interfaces with one particular platform. Suggest you ask this
question again in a Windows programming group such as

john
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,188
Latest member
Crypto TaxSoftware

Latest Threads

Top