I receive the following when trying to call a simple dll from LV. Works fine from a VB.NET GUI.
Error 1172 occurred at Error calling method Clipboard_Test.Clipboard.Test.Copy of ObjectId handle: 0x7A8110C for obj 0x7E[Clipboard_Test.Clipboard.Test] in domain [LabVIEW Domain for Run] and thread 3272 >> Exception has been thrown by the target of an invocation. >> 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. in ClipboardTest.vi
How do I set the dll to be single threaded to satisfy the OLE requirement. I can place the STAThread attribute before both subs, but still get the error from LV. I get a builed error if I try to place it in front of the class. I am new to .NET so I could use some help with this.
Ideally, I am trying to place a copy of an Excel Chart onto the Clipboard and save it as a METAFILE to later paste into PowerPoint. Am really stuck on this because of all the new syntax and terms.