Results 1 to 5 of 5

Thread: LPDWORD and C++

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Beans
    91

    LPDWORD and C++

    So, I have a program that was in Windows and I have to make work on Linux.
    Now, it contains a reference to LPDWORD, which it says is not defined in the scope. Indeed, I cannot find it anywhere defined, either in the header files or the program itself. In fact, the only place it seems to exist in any form is in this one line in this one file.
    However, I did comment out windows.h, but with the research I have done, I cannot confirm as to whether it is in windows.h.

    Granted, LPDWORD may be specialized to the program I am working with, but in the event that it is not, I want to figure out how to fix this error.

    Any advice?

  2. #2
    Join Date
    Jun 2007
    Location
    Maryland, US
    Beans
    6,288
    Distro
    Kubuntu

    Re: LPDWORD and C++

    I came across this with a Google search...
    Code:
    typedef unsigned long DWORD;
    typedef DWORD* LPDWORD;
    So in your code, just replace "LDPWORD" with "unsigned long*".

  3. #3
    Join Date
    Aug 2006
    Location
    Madrid, Spain
    Beans
    299
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: LPDWORD and C++

    That might not do what the OP wants, since in Windows code, "long" is 32 bits even in 64-bit machines, whereas in the wide *nix world that is not guaranteed. Porting an application is not as easy as find & replace (though if all coders were nice, it would be). Most likely you are using Windows APIs and you'll have to either find some equivalent POSIX/Linux/whatever call or use winelib. This last option might seem dirty, but it means you can be up and running fast, then have all the time in the world to port your application in The Right Way (tm). IIrc, when Apple moved from the M68K to the PPC, big parts of the OS ran on a 68K emulator until they were finally able to port all of it.
    May the Source be with you.

  4. #4
    Join Date
    Oct 2007
    Beans
    1,914
    Distro
    Lubuntu 12.10 Quantal Quetzal

    Re: LPDWORD and C++

    Quote Originally Posted by Habbit View Post
    That might not do what the OP wants, since in Windows code, "long" is 32 bits even in 64-bit machines, whereas in the wide *nix world that is not guaranteed.
    No problem. Then you can adapt dwitney's example to:
    Code:
    #include <stdint.h>
    
    typedef uint32_t DWORD;
    typedef DWORD* LPDWORD;

  5. #5
    Join Date
    Jun 2009
    Beans
    91

    Re: LPDWORD and C++

    Okay, I think that worked.
    I don't get the error anymore, and I don't get any new errors...so...its cool I guess.

Tags for this Thread

Bookmarks

Posting Permissions

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