|
-
Jan 20th, 2003, 09:02 AM
#1
Thread Starter
New Member
Windows Service
Hi i have written a windows service. In the service main i load a Windows From. The form is containing some ActiveX Controls. Whne the form is loaded the active controls are instantiated.However the moment the code for instatiating an Active X Control is executed i get a "Thread.State.ThreadStateException" "Could not instantiate ActiveX control because the current thread is not in a single-threaded apartment.".
However if i try to run the same application as an standard exe by excluding the Service Class(derived from ServiceBase) the code runs fine.
Anybody who knows why is this behaviour and whats the remedy to it
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|