But are you creating the cube instance somewhere? such as cube1 = new Cube() and there could be another device variable defined with the same name, such as a protected member of GameObject?
Try removing "static" from static ID3D10Device* device; and see if that fixes the problem. Not sure about this though
Like this:
void Initialise(HWND hWnd)
{
cube1 = new Cube();
initD3D(hWnd);
init_pipeline();
test();
cube1->Init();
// Init(); }