Sharing an object between instances of a C++ DLL -


good morning all,

forgive me if title not clear, i'll try explain more here:

i working asi vbs2. vbs2 executes functions vbs2 dll plugin. have own application want use modify variables within plugin whilst being used, change being executed vbs2. began by, foolish may be, directly changing variables application whilst vbs2 program running.

when did not work tested , found vbs2 program using different instance of "message" object, in storing variable, 1 being accessed application.

what have application access same instance of object being accessed vbs2. have experimented bit

#pragma data_seg(".testseg") message msg; void foo(...); //etc. #pragma data_seg() 

but reason or still appears there 2 instances being used.

i appreciate , help, , add c++ new language me please gentle. :)

thanks, m

you need use linker flags tell linker place segment in sharable memory.

see http://msdn.microsoft.com/en-us/library/ms933104.aspx

i belive need add like

#pragma comment(linker, "/section:.testseg,rws") 

to program. i'm not sure, may work in dll...


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -