determine Drawing document active

I have created a dll using vb & I am accessing drawing documents using vb form

when first drawing document is opened & accessed, all the functions in dll gets executed

but when I am opening second drawing document, dll functions does not work.

How to overcome this problem, kindly guide me

- Sanjay Phadke

SolidworksApi macros