LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 7.1.1 w/.NET 2.0 patch, objects still missing

Hi Folks,
      A co-worker [using LV 7.1] asked how to do a Clipboard.Clear while manipulating an Excel document.  I don't know what the easiest way is.  Looked briefly through the Excel Automation methods and tried Windows User32.EmptyClipboard which gave an error I didn't explore - am currently looking at a method of the .NET System.Windows.Forms\Clipboard object.  This object is visible in System.Windows.Forms(2.0.0.0) assembly - but only when I'm using LV 8.2(.1).  I was unable to see this 2.0.0.0 assembly from LV 7.1.1 until applying the 7.1.1 .NET patch - now the 2.0.0.0 assembly is listed in the object-browser, but the "clipboard" object is not a listed member. Smiley Sad
 
I'd be grateful for your Clipboard.Clear solution - and any info as to why the .NET-patched 7.1.1 should or shouldn't see all 2.0.0.0 objects. Smiley Happy
 
Cheers!
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 1 of 8
(5,252 Views)
Hi tbd,

On a machine with LabVIEW 7.1 I tried looking for the Clipboard in System.Windows.Forms (2.0.0.0) with no success.

I then ran windows update (XP), installed 7.1.1 and then I installed the 7.1.1f2 patch located here:

http://joule.ni.com/nidu/cds/view/p/id/674/lang/en

and I was able to find Clipboard and the method Clear, as seen in the image.

Is the above patch the one that you installed?  Have you run Windows Update recently?

Trey B
Applications Engineering
National Instruments
0 Kudos
Message 2 of 8
(5,222 Views)

Hi Trey,

Thanks for the ideas tried everything, critical updates were up-to-date.  Installed NET 3.0 though it seemed silly - but it was the only net-related non-critical update.  Restart, no joy.  Had 7.1.1f2 but re-"installed" it anyway - it's essentially a couple (3) replaced files.  Still no clipboard object to select in NET-constructor browser.

Do you have the Windows.System.Forms(1.0.5000.0) assembly on your 7.1.1f2 machine?  I do, and the reason I ask is because the object-listing under the 2.0.0.0 assembly looks exactly like the list for the (1.0.5000.0) assembly - as if LabVIEW isn't seeing the 2.0.0.0 objects, only the 1.0.5 objects.

BTW, before applying the patch, System.Windows.Forms (2.0.0.0) wasn't even listed in my [7.1.1] browser.  The statement below suggests it was listed in your browser before the patch - this is odd. Smiley Surprised 


On a machine with LabVIEW 7.1 I tried looking for the Clipboard in System.Windows.Forms (2.0.0.0) with no success.


Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 3 of 8
(5,206 Views)
Before the patch, only 1.0.5 appeared.  I did find clipboard in it, but when I tried to access methods, there were none listed.

After the patch, both 1.0.5 and 2.0.0.0 were there, both had clipboard, and both had the method Clear selectable among several others.

Is System.Windows.Forms something that comes with .NET?  Or is it Microsoft Office specific?  If the second case, what version of Office is installed on that particular machine?  I'm running version 2007.

Trey B
Applications Engineering
National Instruments


0 Kudos
Message 4 of 8
(5,193 Views)

Hi Trey,

      Again, thanks for the help in trying to understand this!


> Is System.Windows.Forms something that comes with .NET?

Yes, I think so - see MSDN link .  System.Windows.Forms and the Clibboard object, appear come with the ".NET Framework." as far back as 1.0!  This implies I should have been able to [at least] see the Clipboard object before the f2 patch - as you were able to.  Something very odd here. Smiley Sad

Note: I can see the 2.0.0.0 Clipboard object under LV 8.2.1, just not under LV7.1.1f2 (Win XP 2002, SP2).

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 5 of 8
(5,184 Views)
Do you have any other machines with LabVIEW 7.1.1 f2?  That way you could determine if problem is machine specific and then try to compare what the differences are between the machines to locate the problem.

Trey B
Applications Engineering
National Instruments
0 Kudos
Message 6 of 8
(5,160 Views)

Hi tbd,

I just saw this post so I thought I might put my two cents worth in. 

The behavior you are seeing is related to how we display .NET static classes in the Select .NET Constructor Dialog Box. In LabVIEW 7.1.1 and LabVIEW 8.0, we did not display static classes in that dialog box but in LabVIEW 8.2.1 (I can't remember if it was LabVIEW 8.2 or 8.2.1) we actually showed the user the static classes. Thus in LabVIEW 8.2.1, you can bring up and see the Clipboard class in the Select .NET Constructor dialog, but you can't click OK because there are no constructors (i.e. which makes sense since the Clipboard class is a static class). In LabVIEW 7.1.1, you get the behavior of not seeing this class as shown in the attached LV 7.1.1 Constructor snapshot.

It is important to note that .NET static classes cannot be instantiated (i.e. you can't create objects but rather you directly access the methods and properties). To call static methods or properties, you
1) Drop down an invoke node or property node from the .NET palette
2) Right-click on the top-left terminal and select
Select Class » .NET » Browse from the shortcut menu to display. Then browse to your .NET assembly (in this case it’s the System.Windows.Forms assembly) and choose your .NET class (in this case it’s the Clipboard class).

3) Choose a method or property (see the attached Select Object from 7.1.1 snapshot)
 

(Note You can invoke static methods if you have an instance - we know it's static and ignore the instance value passed in on the refnum)

Now before the 7.1.1 f2 patch, LabVIEW 7.1.1 would not display any of the .NET Framework 2.0 assemblies. After applying the patch you should see .NET 2.0 assemblies. 

Also, you may notice that when trying to select the System.Windows.Forms 1.0.5000.0 assembly a prompt appears indicating the version of the assembly was prompted to a later version by the .NET runtime engine. The reason for this is because LabVIEW automatically loads the latest installed version of the .NET CLR. Just thought I would let you know. This just means you are always targeting the latest version of that assembly on your system.

Hope this clarifies things.

Best Regards,
Jonathan N.
National Instruments
Download All
Message 7 of 8
(5,148 Views)

Hi Trey, Jonathan,

Sincere thanks to both of you for the continued support, for the solution, and for the education re: static classes.

Trey probably used the right tool by old-habit, where I haven't used .NET much yet and thought a "constructor" was a required first step.  Indeed, the Clipboard object is visible (in 7.1.1f2) by following Jonathan's instructions! Smiley Happy

Thanks for your patience in educating this .NET nube. Smiley Wink

Cheers!

 

 

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 8 of 8
(5,113 Views)