C
Chandrakant Shinde
Hi there,
I want to copy a Image to the clipboard. When i try to do so following
exception occurs :
"The current thread must set to Single Thread Apartment (STA) mode before
OLE calls can be made. Ensure that your Main function has
STAThreadAttribute marked on it"
Following are the points i want to say :
1. Which is the main method in windows forms ? When i tried to assign
<STAThread()> attribute to Public sub New () it gave me error.
2. I tried adding module contaning public sub main() assigning <STAThread()>
attribute, but above exception continues.
3. When i am checking the Threading.Thread.CurrentThread.ApartmentState
property in the function where exception is there , it is showing me the
value 1.
4. In my whole application I have never used Threads manually.But it does
contain many events.
Application i am working on is based on Client Server Architecure and
the code which gives exception is written on Server Side.This code gets
executed when request is received from the client.
Plz give me suggestions, its very URGENT.
Thanks in advance.
Chandrakant Shinde
I want to copy a Image to the clipboard. When i try to do so following
exception occurs :
"The current thread must set to Single Thread Apartment (STA) mode before
OLE calls can be made. Ensure that your Main function has
STAThreadAttribute marked on it"
Following are the points i want to say :
1. Which is the main method in windows forms ? When i tried to assign
<STAThread()> attribute to Public sub New () it gave me error.
2. I tried adding module contaning public sub main() assigning <STAThread()>
attribute, but above exception continues.
3. When i am checking the Threading.Thread.CurrentThread.ApartmentState
property in the function where exception is there , it is showing me the
value 1.
4. In my whole application I have never used Threads manually.But it does
contain many events.
Application i am working on is based on Client Server Architecure and
the code which gives exception is written on Server Side.This code gets
executed when request is received from the client.
Plz give me suggestions, its very URGENT.
Thanks in advance.
Chandrakant Shinde