Question About []USING - Part 2

Using (or providing) Microsoft.NET Classes

Question About []USING - Part 2

Postby PGilbert on Sun Nov 06, 2011 10:51 pm

There is something that I don't understand. To access the dll used to create a Window in WPF (PresentationFramework.dll) you need to specify a directory because it is not store with the other dll of .Net 4.0.
I have been doing the following to reach that dll:

      ⎕USING←'System,mscorlib.dll'
progFiles←Environment.GetFolderPath Environment.SpecialFolder.ProgramFiles
_NetPath←progFiles,'\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\'
⎕USING←'System.Windows,',_NetPath,'PresentationFramework.dll'

⎕NEW Window
System.Windows.Window


I have seen Dyalog used instead of the above the following (that seems to be working very well and much simplier):

      ⎕USING←'System.Windows,WPF/PresentationFramework.dll'

⎕NEW Window
System.Windows.Window


I don't have any directory called 'WPF' with PresentationFramework.dll in it and still the last ⎕USING is working anyway. Why is that ?

Thanks in advance
User avatar
PGilbert
 
Posts: 362
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: Question About []USING - Part 2

Postby MikeHughes on Mon Nov 07, 2011 8:32 am

Pierre,

I am sure you have a directory called WPF. It is usually under the default directory that Dyalog uses to load the dlls.
This default is the reason you don't have to specify a directory for the others.

If you specify an incorrect path in the []using and tryt and access the dll. The status window will say ....cannot find "directory" file. I would be very surprised if the WPF directory is not under this directory since that is how I discovered it to work under my machine. Microsoft placed some of the WPF .net stuff into the sub directory WPF after Dyalog decided on their default.
User avatar
MikeHughes
 
Posts: 80
Joined: Thu Nov 26, 2009 9:03 am
Location: Market Harborough, Leicestershire, UK

Re: Question About []USING - Part 2

Postby Dick Bowman on Mon Nov 07, 2011 3:55 pm

I think Pierre is onto something, I certainly find that I'm having to tweak the "folder" part of ⎕USING to something different than I see in various postings here.

When I look at Microsoft .NET documentation it seems to take folders for granted.

Something which would be useful (at least in my opinion) would be a writeup of which folders we ought to be using (and I'm wondering whether it depends on OS version). It's the sort of bridge-building which can make using Microsoft's words so much more straightforward - I think they ought to have done it, but maybe I just don't know where to look in the torrent of words.
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm

Re: Question About []USING - Part 2

Postby PGilbert on Mon Nov 07, 2011 4:54 pm

Hello Michael, I was hoping to learn that 'WPF' was a special keyword that finds for us the WPF directory, but looks like its not the case from your answer. If I do a search for 'PresentationFramework.dll' on my computer I get five hits located like this:

1- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0
2- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
3- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client
4- C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client
5- C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0

None of them have 'WPF' directory or sub-directory in it. Could you tell us in wich directory with a 'WPF' in it that you have it in your computer because I can't find it on mine.

Pierre Gilbert
User avatar
PGilbert
 
Posts: 362
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada

Re: Question About []USING - Part 2

Postby Vince|Dyalog on Thu May 21, 2015 11:09 am

Hi Pierre and Michael,

On my computer, PresentationFramework.dll is here:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationFramework.dll

I ran the .NET Framework setup verification tool and it says that I have the following installed:

[05/21/15,12:06:20] Install state for .NET Framework 4 Client: installed with no service packs.
[05/21/15,12:06:20] Install state for .NET Framework 4 Full: installed with no service packs.

Regards,

Vince
Vince|Dyalog
 
Posts: 300
Joined: Wed Oct 01, 2008 9:39 am

Re: Question About []USING - Part 2

Postby Dick Bowman on Thu May 21, 2015 1:17 pm

For the record, I find PresentationFramework.dll in the same folder as Vince and also (same vital statistics) in Framework64 (rest of folder name the same).

Things do seem a little messy in .NETland.
Visit http://apl.dickbowman.com to read more from Dick Bowman
User avatar
Dick Bowman
 
Posts: 235
Joined: Thu Jun 18, 2009 4:55 pm

Re: Question About []USING - Part 2

Postby PGilbert on Fri May 22, 2015 1:23 am

Thanks Vince, I have found also this WPF sub-directory on my computers.
User avatar
PGilbert
 
Posts: 362
Joined: Sun Dec 13, 2009 8:46 pm
Location: Montréal, Québec, Canada


Return to Microsoft.NET

Who is online

Users browsing this forum: No registered users and 1 guest