Win32 data types equivalant in Linux
c++, linux
Solution
`CString` will not convert directly to `std::string`, but it is a rough equivalent.
`BYTE` is indeed `unsigned char` and `DWORD` is `unsigned int`. `WORD` is `unsigned short`.
You should definitely use `typedef actual_type WINDOWS_NAME;` to fix the code up, don't go through everywhere to replace the types. I would add a new headerfile that is called something like "wintypes.h", and include that everywhere the "windows.h" is used.
Edit for comment: With `CString`, it really depends on how it is used (and whether the code is using what MS calls "Unicode" or "ASCII" strings). I would be tempted to create a class `CString` and then use `std::string` inside that. Most of it can probably be done by simply calling the equivalent `std::string` function, but some functions may need a bit more programming - again, it does depend on what member functions of `CString` are actually being used.
For `LP<type>`, that is just a pointer to the `<type>`, so `typedef BYTE* LPBYTE;` and `typedef DWORD* LPDWORD;` will do that.
Problem
I am trying to convert a C++ library which is using widely DWORD, CString and BYTE in the program, and now I am converting the code from C++ Win32 library to linux program . Also I am using openSUSE 12.3 and Anjuta IDE to do this , please help me which types I should use instead of mentioned types ? I think I should use unsigned int for DWORD and string for CString and unsigned char instead of BYTE is it right ?