DX COM Componant References

I am writing a game engine using Direct 3D 11, I have some experience with C++ and the DirectX sdk but have much, much more to learn. I will explain what I would like to do, I am unsure if it is even possible.
I would like to keep my pointers to my DX COM components privately tucked away in my main Engine class, accessible via get functions. I would then obviously call the get function in other classes to access the components. The issue I am having is that I can return the pointer to the COM component perfectly, but I cannot reference the pointer as is needed for some of the DX functions. Bellow is generally what I would like to do.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class Engine
{
public:
	ID3D11InputLayout* GetInputLayout() { return inputLayout_; }
private:
	ID3D11InputLayout* inputLayout_;
}

class MyState
{
	virtual void Render()
	{
		//These types of functions work fine 
		_myEngine->GetD3DContext()->IASetInputLayout( _myEngine->GetInputLayout() );
	}
}

class DXInit
{
	// The issue I am haveing is with calls such as this one, I don't know how to reference it correctly
	myEngine->GetD3DDevice()->CreateInputLayout( ,,,, &_myEngine->GetInputLayout() );
	
	// This function will execute perfectly if it has acess to inputLayout_
	//myEngine->GetD3DDevice()->CreateInputLayout( ,,,, &inputLayout_ );
}


I know an easy way to get around this would be to make inputLayout_ public, but I really want to learn good programming practices, not just what gets the job done quickly. I hope I have explained myself sufficiently, I have failed to come across relevant information on the Internet. ( My ignorance of the concepts involved is to blame I am sure ) Thank you for your time.
Topic archived. No new replies allowed.