How to use render target in directx9

I want to use .fx effect file that use off screen render target.The effect file have 2 passess . Do i need to create the off screen render target manually at my application? or does the scripting create the needed render target? Can you please provide me small demo application that uses effect file with 2 passess and use rendertarget .