I think you should at least read the fundamentals of the vst technical documentation before hacking further. Start here and read at least until the end of this page. This may prevent you to make mistakes in early stages of your development.