CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Location
    St. Cugat - Catalunya
    Posts
    441

    [RESOLVED] PCONTEXT undefined

    I don't use C++ often, so probably doing everything wrong ...

    I'm trying to use some simple functions found on the forum.
    Getting some errors about
    * LONG being undefined, so included <Windef.h>
    * FILETIME being undefined, so included <WinBase.h>
    ...

    Now PCONTEXT is undefined (in WinBase.h line typedef PCONTEXT LPCONTEXT;) and I don't know where to get it's definition.
    And also other syntax errors on WinBase (line IN va_list *Arguments)

    I'm using VisualStudio.NET, VC++ version 7.

    What am I doing wrong?

    Thks
    Last edited by DeepButi; September 9th, 2008 at 03:04 AM.
    Did it help? rate it.

    The best conversation I had was over forty million years ago ... and that was with a coffee machine.

  2. #2
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: PCONTEXT undefined

    Remove those includes and replace them with windows.h
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

  3. #3
    Join Date
    Dec 2003
    Location
    St. Cugat - Catalunya
    Posts
    441

    Re: PCONTEXT undefined

    Thks a lot. It works.
    Did it help? rate it.

    The best conversation I had was over forty million years ago ... and that was with a coffee machine.

  4. #4
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: PCONTEXT undefined

    Was in bit of hurry when writing that previous post...

    Including windows.h is surprisingly often sufficient and when it's not enough it's mentioned in MSDN. Check out these examples:

    For the function CreateWindow, http://msdn.microsoft.com/en-us/library/ms632679.aspx, MSDN states: declared in Winuser.h, include Windows.h; requires linking to User32.lib. This is kind of the normal situation, even if another header declares the stuff windows.h shall be included.

    Some functions requires other headers and MSDN also clearly states this. For instance the function getsockname, http://msdn.microsoft.com/en-us/libr...43(VS.85).aspx, MSDN states: is declared in Winsock2.h; requires linking with Ws2_32.lib
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

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