pseudo variable

This is a discussion on pseudo variable within the Windows Programming forums, part of the Platform Specific Boards category; Can someone please explain me what is a Pseudo Variable and what exactly is the first parameter to the function ...

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    384

    pseudo variable

    Can someone please explain me what is a Pseudo Variable and what exactly is the first parameter to the function WinMain below??

    Code:
    GetStartupInfo(&StartupInfo);
    int nMainRetVal = WinMain((HINSTANCE)&__ImageBase, NULL, pszCommandLineAnsi,
       (StartupInfo.dwFlags & STARTF_USESHOWWINDOW)
          ? StartupInfo.wShowWindow : SW_SHOWDEFAULT);
    Also what does the following statement do??

    Code:
    extern "C" const IMAGE_DOS_HEADER __ImageBase;

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    what is a Pseudo Variable
    That's not a generally used term, so you would have to explain the context of your question.
    Given the other question, I assume you refer to __ImageBase as a pseudo variable, so let me explain what that is.

    Basically, __ImageBase is a magic variable name that is recognized by the compiler/linker/loader and replaced by something special. That special thing is your program as it is loaded into memory. Thus, &__ImageBase (taking the address) gets the base address where your module (the .exe or .dll) was loaded, which happens to be exactly what the HINSTANCE handle is as well. This handle is primarily used to load resources from that particular module.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Pseudo Code (Please Help)
    By slimdime in forum C++ Programming
    Replies: 1
    Last Post: 09-05-2010, 09:47 AM
  2. pseudo-code
    By Seb in forum C Programming
    Replies: 7
    Last Post: 04-27-2009, 01:36 PM
  3. using su with pseudo terminal
    By oncemyway in forum Linux Programming
    Replies: 2
    Last Post: 04-30-2007, 10:52 AM
  4. what is pseudo-code
    By The_Master in forum C++ Programming
    Replies: 2
    Last Post: 12-09-2006, 05:53 AM
  5. Pseudo Coding
    By davejigsaw in forum C++ Programming
    Replies: 1
    Last Post: 05-07-2005, 10:57 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21