TheSwamp
Code Red => .NET => Topic started by: mohnston on August 24, 2009, 06:37:09 PM
-
I'm getting tangled up in COM/.NET interop.
I'm updating some code for upgrade to 2010 so I'm running into compatability issues.
I've written a component in C#.NET that I use in VBA to allow dragging (jigging) of entities. So far, so good.
The component works fine when I use it from VBA.
Are you still reading? good.
Now I would like to use the same component from VB (a dll. referenced into VBA) and I'm running into problems.
When I try I get this error message:
Microsoft.VisualStudio.Debugger.Runtime.CrossThreadMessagingException
Are you still reading? good.
So . . . I've got a VBA project (dvb) with a reference to a VB program (dll) that references a .NET component (dll).
Plus, the VBA project itself ALSO references the same .NET component.
Is this a recipe for disaster? Or should this work and I'm just missing something?
-
you might try using [STAThread] in your managed code
-
you might try using [STAThread] in your managed code
said the wise man.
That is exactly what it needed.
Thanks a million.
-
Glad it worked :-)
-
Well done.
I imagine a few people would like a cheat sheet for doing this ( in the near future).