cancelar
Mostrando resultados para 
Pesquisar então 
Você quer dizer: 

.NET events, what am I doing wrong?

I'm trying to register for a .NET event and I can't seem to get it to work. The Main.vi is posted in the snippet below but I've attached the Main and Callback vi's as a zip (2020 and 2016 versions). I don't really know much about .NET so I have a feeling I'm just not understanding something fundamental. I'm sure there are other ways to do what this example is attempting (detecting a network availability change) but the important point for me is to resolve the event problem and understand how to make this work, so please don't focus on alternatives.

 

NetworkAvailability NET Event Test Main.png

0 Kudos
Mensagem 1 de 4
1.662Exibições

Have you tried to make your VIs run in UI thread?

 

George Zou
0 Kudos
Mensagem 2 de 4
1.640Exibições

@zou wrote:

Have you tried to make your VIs run in UI thread?

 


I haven't done anything "special" so I guess not. How do I do that? Also, can you explain some of the background of why that would be significant?

0 Kudos
Mensagem 3 de 4
1.574Exibições

VI Properties => Execution => Preferred Execution System => user interface

 

Some .Net functions require "Single Threaded Apartment" or STA.  i.e. UI thread.

 

You can google "LabVIEW .NET single-threaded apartment (STA)" for better explanation.

 

 

George Zou
0 Kudos
Mensagem 4 de 4
1.561Exibições