Hi all,
I have one COM dll server and in that I have one
member which is a class. I want the instance of this
member to be shared among all the processes which
instantialtes my Dll server.
I have used SECTION in .def
and #prgama in .cpp as follows.
#pragma data_seg(“Name”)
MyClass Server::Obj1;
#pragma data_seg()
class Server
{ …
private:
static MyClass Obj1;
}
But when i compile this code it gives this warning.
LNK4039 section specified with /section doesnt exist.
But if I use Int type instead MyClass the compiles
properly.
where am i going wrong…
and is it OK to neglect this warning and proceed.
Rgds,
Manish
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Hello,
You need to add the following to the linker switches
/SECTION:Name,RWS
Alternatively, you can include the following pragma in
your source file if your compiler supports it.
#pragma comment(linker, “/SECTION:Name,RWS”)
Also, using ‘Int’ type is not giving you errors,
because you are probably not initializing that
variable in its defination (in this case the variable
is put in default data section). Try to put “int
x=10;” there, and you will get the same error that you
get for MyClass.
HTH.
-Prasad
— Manish Sapariya wrote:
> Hi all,
> I have one COM dll server and in that I have one
> member which is a class. I want the instance of this
> member to be shared among all the processes which
> instantialtes my Dll server.
>
> I have used SECTION in .def
> and #prgama in .cpp as follows.
>
> #pragma data_seg(“Name”)
> MyClass Server::Obj1;
> #pragma data_seg()
>
> class Server
> { …
>
> private:
> static MyClass Obj1;
> }
>
> But when i compile this code it gives this warning.
>
> LNK4039 section specified with /section doesnt
> exist.
>
> But if I use Int type instead MyClass the compiles
> properly.
>
> where am i going wrong…
> and is it OK to neglect this warning and proceed.
>
> Rgds,
> Manish
>
>
>
>
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great
> prices! http://auctions.yahoo.com/
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
=====
Prasad S. Dabak
Director of Engineering, Windows NT/2000 Division
Cybermedia Software Private Limited
http://www.cybermedia.co.in
Co-author of the book “Undocumented Windows NT”
ISBN 0764545698
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Hi,
I tried both the things,
specifying /SECTION ing .def file and as linker option
also.
But this doesnt help.
And one more thing, If i specity int data type and
initialize it it doesnt give the warning message,
But if i leave it uninitialize it does give the same
error message,
i.e.
#pragma data_seg(“Name”)
int Server::nInt;
#pragma data_seg()
I dont know where am i going wrong.
Rgds,
Manish
— Prasad Dabak wrote:
> Hello,
>
> You need to add the following to the linker switches
>
> /SECTION:Name,RWS
>
> Alternatively, you can include the following pragma
> in
> your source file if your compiler supports it.
>
> #pragma comment(linker, “/SECTION:Name,RWS”)
>
> Also, using ‘Int’ type is not giving you errors,
> because you are probably not initializing that
> variable in its defination (in this case the
> variable
> is put in default data section). Try to put “int
> x=10;” there, and you will get the same error that
> you
> get for MyClass.
>
> HTH.
>
> -Prasad
>
>
> — Manish Sapariya wrote:
> > Hi all,
> > I have one COM dll server and in that I have one
> > member which is a class. I want the instance of
> this
> > member to be shared among all the processes which
> > instantialtes my Dll server.
> >
> > I have used SECTION in .def
> > and #prgama in .cpp as follows.
> >
> > #pragma data_seg(“Name”)
> > MyClass Server::Obj1;
> > #pragma data_seg()
> >
> > class Server
> > { …
> >
> > private:
> > static MyClass Obj1;
> > }
> >
> > But when i compile this code it gives this
> warning.
> >
> > LNK4039 section specified with /section doesnt
> > exist.
> >
> > But if I use Int type instead MyClass the compiles
> > properly.
> >
> > where am i going wrong…
> > and is it OK to neglect this warning and proceed.
> >
> > Rgds,
> > Manish
> >
> >
> >
> >
> > Do You Yahoo!?
> > Yahoo! Auctions - Buy the things you want at great
> > prices! http://auctions.yahoo.com/
> >
> > —
> > You are currently subscribed to ntdev as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> =====
> Prasad S. Dabak
> Director of Engineering, Windows NT/2000 Division
> Cybermedia Software Private Limited
> http://www.cybermedia.co.in
> Co-author of the book “Undocumented Windows NT”
> ISBN 0764545698
>
>
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great
> prices! http://auctions.yahoo.com/
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
The following URL:
http://msdn.microsoft.com/library/devprods/vs6/visualc/vccore/_core_how_do_i_share_data_in_my_dll_with_an_application_or_with_other_dlls.3f.htm
talks about the need to use memory-mapped files for sharing C++ class
instances across processes.
I hope that helps.
Sheela.
On 02/21/01, “Manish Sapariya ” wrote:
> Hi,
> I tried both the things,
> specifying /SECTION ing .def file and as linker option
> also.
>
> But this doesnt help.
> And one more thing, If i specity int data type and
> initialize it it doesnt give the warning message,
>
> But if i leave it uninitialize it does give the same
> error message,
> i.e.
> #pragma data_seg(“Name”)
> int Server::nInt;
> #pragma data_seg()
>
> I dont know where am i going wrong.
>
> Rgds,
> Manish
>
> — Prasad Dabak wrote:
> > Hello,
> >
> > You need to add the following to the linker switches
> >
> > /SECTION:Name,RWS
> >
> > Alternatively, you can include the following pragma
> > in
> > your source file if your compiler supports it.
> >
> > #pragma comment(linker, “/SECTION:Name,RWS”)
> >
> > Also, using ‘Int’ type is not giving you errors,
> > because you are probably not initializing that
> > variable in its defination (in this case the
> > variable
> > is put in default data section). Try to put “int
> > x=10;” there, and you will get the same error that
> > you
> > get for MyClass.
> >
> > HTH.
> >
> > -Prasad
> >
> >
> > — Manish Sapariya wrote:
> > > Hi all,
> > > I have one COM dll server and in that I have one
> > > member which is a class. I want the instance of
> > this
> > > member to be shared among all the processes which
> > > instantialtes my Dll server.
> > >
> > > I have used SECTION in .def
> > > and #prgama in .cpp as follows.
> > >
> > > #pragma data_seg(“Name”)
> > > MyClass Server::Obj1;
> > > #pragma data_seg()
> > >
> > > class Server
> > > { …
> > >
> > > private:
> > > static MyClass Obj1;
> > > }
> > >
> > > But when i compile this code it gives this
> > warning.
> > >
> > > LNK4039 section specified with /section doesnt
> > > exist.
> > >
> > > But if I use Int type instead MyClass the compiles
> > > properly.
> > >
> > > where am i going wrong…
> > > and is it OK to neglect this warning and proceed.
> > >
> > > Rgds,
> > > Manish
> > >
> > >
> > >
> > >
> > > Do You Yahoo!?
> > > Yahoo! Auctions - Buy the things you want at great
> > > prices! http://auctions.yahoo.com/
> > >
> > > —
> > > You are currently subscribed to ntdev as:
> > > xxxxx@yahoo.com
> > > To unsubscribe send a blank email to
> > leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > =====
> > Prasad S. Dabak
> > Director of Engineering, Windows NT/2000 Division
> > Cybermedia Software Private Limited
> > http://www.cybermedia.co.in
> > Co-author of the book “Undocumented Windows NT”
> > ISBN 0764545698
> >
> >
> > Do You Yahoo!?
> > Yahoo! Auctions - Buy the things you want at great
> > prices! http://auctions.yahoo.com/
> >
> > —
> > You are currently subscribed to ntdev as:
> > xxxxx@yahoo.com
> > To unsubscribe send a blank email to
> leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/
>
> —
> You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com