Please help me in fix this problem. I have a VB application which I wanted to make it as a windows service. I got a VC++ code which I registered as Service and which will run my vb application as service.

I have a exe file which in turn uses two dll's to run the application.

In one of the init methods of my dll I tried to set a property to my MainForm as follows:

MainForm.ds = Me

When it reaches this code my application stops proceeding when I start it through the service. And sometimes it throws Runtime Error 380, Invalid property value. And says Automation Error.

This doesnt happen if I am not running my application as service.

Please help to fix this problem.