Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
See more:
Need Help regarding setting the value of a variable dynamically using memory mapped file.
Here i want to get the address of the variable from memory mapped file using varible name and then set the value using that address

EX:

#include <stdio.h>

int aStr;

main(...)
{

    addressofvar (aStr) ;// want to get the address of aStr using memory map file 
    addressof..aStr = value ;//then set the value for aStr using the address

}

Please help

[edit]Sorted the spurious close tag - OriginalGriff[/edit]
Posted
Updated 22-Jun-11 2:26am
v3
Comments
Timberbird 22-Jun-11 8:45am    
What kind of task is that? Is your file mapping created by yourself or is it coming from elsewhere? Does your file contain a lot of data, and if yes, do you know its structure?

1 solution

The code samples on this page provide complete picture on how to use file mapping as shared memory:

http://msdn.microsoft.com/en-us/library/aa366551(v=vs.85).aspx[^].

—SA
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 24-Jun-11 19:05pm    
Well ***you*** did not. It does not mean it is not useful. In fact, it explains all you need. Perhaps it you need something different in fact. Then explain what.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900