   passing my device to my function
  I am trying to embed the render command into my class .cpp filehere is what I got...// at the top of the .cpp#include <d3d9.h>#include <D3dx9core.h>#include "Dust.h"// render functionvoid Dust::Render(LPDirect3DDevice9 d3ddev, this* thisDust){ D3DXMatrixScaling(&matScale,    Scale,    Scale,    Scale   ); D3DXMatrixTranslation(   &matTranslate,   Position.x,   Position.y,   Position.z  ); D3DXMatrixRotationX( &matRotateX, Rotation.x); D3DXMatrixRotationY( &matRotateY, Rotation.y); D3DXMatrixRotationZ( &matRotateZ, Rotation.z); d3ddev->SetTransform(  D3DTS_WORLD,  &(    matScale *    matRotateX *    matRotateY *    matRotateZ *    matTranslate   ) ); thisDust->DrawSubset(0);};Anyway what I'm having a problem with is the IDirect3DDevice9 is coming back as an undefined symbol?[C++ Error] Dust.cpp(78): E2451 Undefined symbol 'LPDirect3DDevice9'I am confused by this, is there something obvious I am doing wrong?[Edited by - Ebola0001 on September 24, 2006 10:48:28 AM]
  You made a typo: IDirect3DDevice9.You should probably declare it as a pointer: IDirect3DDevice9* pD3ddev.Otherwise, you would be copying the entire IDirect3DDevice9 structure in your function call.Alternatively (and this may be the source of your confusion), you could use LPDIRECT3DDEVICE9 instead (but without the * in that case). This is really just a typedef of a pointer to IDirect3DDevice9, as far as I'm aware.   ;  Recap:There is no "LPDirect3DDevice9", because C++ is case-sensitive."LPDIRECT3DDEVICE9" == "IDirect3DDevice9 *" (i.e., pointer to IDirect3DDevice9).Also, you can't have a parameter of type "this*". It looks like you're very confused here.'this' isn't a type-name, but a keyword. 'this' is already a pointer; in your case it's of type 'Dust*' (pointer to Dust). It exists *automatically*, and you should *not* try to create a parameter to represent the this-pointer. It points to "the current object", i.e. the object upon which you call the member function.If you want to call another member function from the current one, then, you can just write 'this->member_function(args)'. However, you normally don't even need 'this->'; you can just write 'member_function(args)'. The C++ name-lookup rules are such that it will first try to interpret that as a call to another member function (which will use the same object that's currently in use).#include <iostream>class Test {  private:  int value;  public:  Test(int value): value(value) {}  void foo() {    Test* x = this; // makes a copy of the pointer; not useful :)    Test& y = *this; // similarly, aliases the current object, using a reference instead of a pointer    this->bar(); // explicitly says to invoke bar() upon the same object that  // foo() was invoked upon    bar(); // does the same thing, because of how the name lookup works    x->bar(); // invokes bar() upon the current object, via the other pointer    y.bar(); // similarly with the reference    // in all, bar() gets called 4 times from foo(), all with the same object.  }  void bar() {    std::cout << value << std::endl; // gets printed 4 times.    // The 'value' is implicitly this->value, i.e. the one that is stored in    // the object upon which bar() is invoked.  }};// Now we have a data type called Test, so we can make variables of type Test.int main() {  Test t(42); // creates a Test object, with 'value' initialized to 42.  t.foo(); // invokes foo() "on" t; "tells t to foo()", idiomatically.  // The object named 't' therefore does bar() four times, and thus  // the value 42 is printed four times. 't' is supplied as the object pointed  // to by 'this' when foo() happens, and t.value is what gets found by 'value'  // in bar().  Test t2(23);  t2.foo();  // Now we do the same with a different object, and we get different results,  // because the different object has its own state (which happens to be  // different).}