CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Guest

    How to prevent app's code from being swaped to disk

    I need to declare that both data and code segments can not be swaped to disk.
    How to do it in MFC based app.

    Thanking in anticipation.

    Adam


  2. #2
    Join Date
    Apr 1999
    Posts
    10

    Re: How to prevent app's code from being swaped to disk

    Make .DEF file and write entry:
    CODE PRELOAD


    Do not ......... never mind

  3. #3
    Guest

    Re: How to prevent app's code from being swaped to disk

    I've done what you suggested and it seems to be a good way, but had a linker warning:
    CODE statement not supported for the target platform; ignored.
    I'm using VC++ 6.0 and Win98 or NT.
    Unfortunately MSDN does not explain clerly which statements are supported and which are not.

    Adam
    Thanks


  4. #4
    Join Date
    May 1999
    Posts
    3,332

    Re: How to prevent app's code from being swaped to disk

    IMHO PRELOAD only preloads code (as the name implies). NONDISCARDABLE is the "right" keyword for avoiding discarding of segments.


  5. #5
    Join Date
    May 1999
    Location
    Houston
    Posts
    21

    Re: How to prevent app's code from being swaped to disk

    Unfortunately, CODE NONDISCARDABLE flag is ignored by windows (as you found out) for applications. However, this is not true for DLLS. Thus, the code you want to prevent from being swapped out, put that in a DLL. Then use the NONDISCARDABLE flag.

    Hope this helps.

    Vali


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured