Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6579469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:54:07+00:00 2026-05-25T15:54:07+00:00

I am trying to find a way to allocate memory dynamically for memory mapped

  • 0

I am trying to find a way to allocate memory dynamically for memory mapped files that are shared between different processes. My design is as follows: In Windows mobile, I am writing a Display Thread that handles the display part from different processes using shared memory. The plan is to create a memory mapped file that is equal to the size of the screen For eg: if the screen size is 640 X 480, then I create a BYTE array of 640 X 480 X 4 and then share this with another process so that the other process updates the in memory hDC display and then sends an update to the Display Thread to update the display on the device.
This works fine but one constraint is to allocate the memory at compile time as we cannot allocate the memory dynamically

(http://msdn.microsoft.com/en-us/library/aa366542%28v=vs.85%29.aspx). When you do not want the size of the file to change (for example, when mapping read-only files), call CreateFileMapping and specify zero for both dwMaximumSizeHigh and dwMaximumSizeLow. Doing this creates a file mapping object that is exactly the same size as the file. Otherwise, you must calculate or estimate the size of the finished file because file mapping objects are static in size; once created, their size cannot be increased or decreased.

  1. Is there a way to allocate the size of the memory mapped file after getting the device screen co-ordinates? One thing is to cater this for different screen sized devices like tablets, mobile devices etc. and another thing is that if an application wants to display only a part of the screen then we should be able to create the memory map with only that size.
  2. Is there any other alternative to memory mapped files? The reason why I chose Memory mapped files is that when the other process modifies the display, it need not send all the update details and can simply set a mutex to let Display thread know that it needs to refresh the screen. This way I could get a refresh rate of 50 frames per second with display from 5 different applications.

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:54:08+00:00Added an answer on May 25, 2026 at 3:54 pm

    Don’t use a file, there’s no value in having this data written to disk. Pass INVALID_HANDLE_VALUE to CreateFileMapping so that the memory is backed by the paging file and you can set any size you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find a way to determine at run-time how much memory
I'm trying find a way to have PHP to indicate to the browser that
I'm trying to find a way to avoid headline word wraps that leaves the
Trying to find a way to prove that my program is not running correctly
Im trying to find a way either with ajax or jquery that can angle
Trying to find a way to send a POST HTTPS request from Python to
I'm trying to find a way to list the (static) dependency requirements of a
I'm trying to find a way to validate a large XML file against an
I'm trying to find a way to fake the result of a method called
I'm trying to find a way to invoke the Ctrl+Alt+Delete dialog on a Windows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.