08-22-2021 05:23 PM
I tested programming a .NET control and Properties and Methods all worked fine. So I decided to buy and license the control. Just to find out that the registered callback events will NOT fire in LabVIEW.
I searched the forums and do see some posts on this but no clear solution.
Does this mean that LabVIEW does not support .NET CallBackEvents registration? And is this now official?
I am using LabVIEW 2020 on Windows 10 OS.
Grateful for any advise on this.
AnthonyL
08-22-2021 06:45 PM
By control do you mean you have a new class that has System.Windows.Forms.Control as a base class? https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control?view=netframework-4.8 Or are you referring to the use of a generic assembly and ensuring event handlers are called?
An example showing your issue would also be helpful.
08-23-2021 02:19 AM - edited 08-23-2021 02:20 AM
(un?)Fortunately, this is presumably a problem in either the control or your use, so as tyk said an example would be helpful.
I can confirm that I have used .NET callbacks in 2019 and 2020, both 32-bit although I believe it should also work in 64-bit (but you need the correct assembly in each case).
08-23-2021 03:34 AM
As tyk said your explanation leaves a lot open for interpretation and guessing. While I usually try to avoid .Net whenever possible I can confirm that I have used .Net events with the Register Callback node and got them to work as expected in LabVIEW since many many moons.
08-23-2021 03:59 AM
Hello tyk and rolfk:
I am using a licensed third party (paid) grid display GUI component by the name of c1FlexGridClassic.NET. I add the grid to a .NET container and make the Grid editable, and then I register the AFTER EDIT callback event. I then run the program in a loop to see if I can capture the AFTER EDIT event; which I do not.
To know if I am capturing the AFTER EDIT event, I added code to increment a global variable counter by 1. And also to show a dialog box of the incremented counter.
After running the program and changing some cell contents, and hitting <ENTER>, none of those two things happened. i.e. The counter stayed at 0, and the dialog to show the incremented counter never showed up.
Conclusion was that the .NET registered callback event did not get recognized in LabVIEW. This event feature though works in Visual Studio,
Attached is the LabVIEW code as well as the front panel showing the grid display component in a .NET container with some added text.
BIG QUESTION
============
I just want to know if NI is no longer supporting third party .NET components in LabVIEW. Because there is also a .NET license activation issue, where LabVIEW fails to recognize that the .NET component license has been activated. As of this writing, there is an on-going support ticket logged with NI on this issue.
That same license is being recognized in Visual Studio.
Anthony L.
08-23-2021 05:08 AM - edited 08-23-2021 05:10 AM
@Anthony_L wrote:
I just want to know if NI is no longer supporting third party .NET components in LabVIEW. Because there is also a .NET license activation issue, where LabVIEW fails to recognize that the .NET component license has been activated. As of this writing, there is an on-going support ticket logged with NI on this issue.
.Net is certainly supported. The .Net license activation is a fairly recent Microsoft feature (that IMHO is rather poorly implemented). NI has not made any substantial new features for .Net support since a long time as it worked pretty fine for most of the things. How and even if they plan to support the license feature will depend also on how well the mechanism is documented by Microsoft. The way it looks to me, part of the security for it seems to be obscurity too. But even without that problem it's definitely not a high priority feature by any means.
Managing proper licensing of individual components should not be the responsibility of the hosting application, but of the component itself.
08-23-2021 11:03 AM
08-23-2021 11:22 AM
To add to what cbutcher said, that .NET Grid looks a lot like a native LabVIEW table grid.
08-23-2021 12:18 PM
Hello Eric1977 and cbutcher:
AnthonyL