I am using an undocumented library which came as an OSX file. I used AxImp.exe to create a dll file (Named AxLibraryName) and used it for my code.
When I initiate the class like this:
AxLibraryName n = new AxLibraryName();
I get a ThreadStateException. When I do it in a different thread like this:
var t = new Thread(SubClassThatInitiateAxLibraryName.Initiate);
t.SetApartmentState(ApartmentState.STA);
t.Start();
It works, but I cannot use any of the SubClassThatInitiateAxLibraryName methods since SubClassThatInitiateAxLibraryName.AxLibraryName is Null afterwards. (Of course, I call it inside some kind of SubClassThatInitiateAxLibraryName method, and it is called this.AxLibraryNameBlah)
Is there a way to initiate this library in main.cs?
Thanks :)