directx c++
I Have done some VB6 and directX8 and now I am looking at c++.
in c++ in a sample directX program I see the variable LPDIRECT3D8. I want to know
1) how do you find out about this variable in help , I cant see this listed anywhere..what is it
2) variables types like this are being used as Pointers eg
LPDIRECT3D8 myone...
myone ->....
How can you do this as it isnt a pointer.
thanks
DirectX and many parts of windows commonly create pointer type aliases like this:
It's like they did this:
class IDirect3D8
{
};
typedef IDirect3D8 *LPDIRECT3D8;
so LPDIRECT3D8 is a "IDirect3D8 *". LP standing for Long Pointer, where the Long part is an old appendage from the days of 16 bit programming where pointers could be NEAR (16 bit), or FAR/LONG (32 bit)
You'll see LPCSTR all over windows which is a long pointer to a C string... or char *, and it's expecting the string to be null terminated.
It's like they did this:
class IDirect3D8
{
};
typedef IDirect3D8 *LPDIRECT3D8;
so LPDIRECT3D8 is a "IDirect3D8 *". LP standing for Long Pointer, where the Long part is an old appendage from the days of 16 bit programming where pointers could be NEAR (16 bit), or FAR/LONG (32 bit)
You'll see LPCSTR all over windows which is a long pointer to a C string... or char *, and it's expecting the string to be null terminated.
Sure it is.
Microsoft has the "wonderful" habit of typedef-ing pointers to LPCAPITOLSOMETHINGOROTHER. So anytime you see capitol LP at the front of a type, know that it's a pointer to the rest.
Generally google or msdn search is the best source of info for these sort of odd things.
Microsoft has the "wonderful" habit of typedef-ing pointers to LPCAPITOLSOMETHINGOROTHER. So anytime you see capitol LP at the front of a type, know that it's a pointer to the rest.
Generally google or msdn search is the best source of info for these sort of odd things.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement