Re: DLL:s and global variables

From: KLinZ (klinz_at_NOSPAMzenobitsSPAMNO.com.invalid)
Date: 10/25/03


Date: Sat, 25 Oct 2003 11:47:05 +0200

In news:_irmb.75$Z_6.19@read3.inet.fi, Kalle Rutanen typed:

> It seems that a DLL has it's own copies of applications global
> variables. How do you use application's global variables in a DLL ?

What you is a thing called shared memory. Under win32 this is often
implemented as calls to CreateFileMapping() and MapViewOfFile(), do a search
on google for more details. People have done it before :-)

-- 
www.zenobits.com


Relevant Pages

  • Re: Queries about DLL Exports
    ... global variables for use it. ... dll with out redefining?Macros are for use at compile-time, so #define them within your project. ... shared memory concept in dll? ... makes header file for Exporting things from dll in other project.Look up __declspec dllexport and dllimport. ...
    (microsoft.public.vc.language)
  • Re: Queries about DLL Exports
    ... global variables for use it. ... global variable from dll? ... shared memory concept in dll? ... makes header file for Exporting things from dll in other project. ...
    (microsoft.public.vc.language)
  • Re: A DLL Question..
    ... how to use the shared memory for our variables in the DLL ?? ... >> I have a DLL and it has some global variables, ... > Martin Richter WWJD ...
    (microsoft.public.vc.language)
  • Queries about DLL Exports
    ... I am developing an application which has some logic in dll by exporting ... global variables for use it. ... I think this will be worked fine in case of shared memory, ... We use dll for exporting functions only. ...
    (microsoft.public.vc.language)
  • Re: convert an MFC application to MFC DLL
    ... This suggests that there are too many global variables. ... All the header files which contain extern ... Once the variables are in the DLL, they cannot be accessed by the main program. ... The whole notion that there is a "single" main.cpp which contains the declarations of the ...
    (microsoft.public.vc.mfc)