Author |
Message |
David Youngbloo #1 / 13
|
 Read File Properties
How would I read the file version properties of a standard DLL? In particular I need the company name property from VISA32.dll. VISA32.dll is a standardized Virtual Instrumentation Software Architecture function library that is published by several manufacturers. I need the manufacturer name of the *installed* library. David
|
Tue, 08 May 2012 19:56:21 GMT |
|
 |
Jeff Johnso #2 / 13
|
 Read File Properties
Quote: > How would I read the file version properties of a standard DLL? In > particular I need the company name property from VISA32.dll. > VISA32.dll is a standardized Virtual Instrumentation Software Architecture > function library that is published by several manufacturers. I need the > manufacturer name of the *installed* library.
Maybe... http://vbnet.mvps.org/index.html?code/fileapi/filesearchinfo.htm ?
|
Tue, 08 May 2012 22:27:34 GMT |
|
 |
Nobod #3 / 13
|
 Read File Properties
Quote: > How would I read the file version properties of a standard DLL? In > particular I need the company name property from VISA32.dll. > VISA32.dll is a standardized Virtual Instrumentation Software Architecture > function library that is published by several manufacturers. I need the > manufacturer name of the *installed* library.
Search the newsgroups for "vb -dotnet VerQueryValue CompanyName".
|
Tue, 08 May 2012 22:30:53 GMT |
|
 |
Mike #4 / 13
|
 Read File Properties
GetFileVersionInfo Function Start Here: http://msdn.microsoft.com/en-us/library/ms647003(VS.85).aspx
Quote: > How would I read the file version properties of a standard DLL? In > particular I need the company name property from VISA32.dll. > VISA32.dll is a standardized Virtual Instrumentation Software Architecture > function library that is published by several manufacturers. I need the > manufacturer name of the *installed* library. > David
|
Wed, 09 May 2012 00:04:33 GMT |
|
 |
Dave O #5 / 13
|
 Read File Properties
Quote: > How would I read the file version properties of a standard DLL? In > particular I need the company name property from VISA32.dll. > VISA32.dll is a standardized Virtual Instrumentation Software Architecture > function library that is published by several manufacturers. I need the > manufacturer name of the *installed* library. > David
In addition to what the others have said there is another issue, there may be multiple copies of the file from different vendors on the machine but probably only one is registered and that would be the one you are interested in. You should consider finding some code to read the registry or to get associations out of the registry. I suspect this is going to be a non-trivial task. A interesting start might be to search your registry for any "VISA32.DLL" entries. Dave O.
|
Wed, 09 May 2012 00:31:52 GMT |
|
 |
Nobod #6 / 13
|
 Read File Properties
Quote:
>> How would I read the file version properties of a standard DLL? In >> particular I need the company name property from VISA32.dll. >> VISA32.dll is a standardized Virtual Instrumentation Software >> Architecture function library that is published by several manufacturers. >> I need the manufacturer name of the *installed* library. >> David > In addition to what the others have said there is another issue, there may > be multiple copies of the file from different vendors on the machine but > probably only one is registered and that would be the one you are > interested in. You should consider finding some code to read the registry > or to get associations out of the registry. > I suspect this is going to be a non-trivial task. A interesting start > might be to search your registry for any "VISA32.DLL" entries.
And if it's a standard DLL then one could use SearchPath() API function, which search for a file in the search path, and returns the full path.
|
Wed, 09 May 2012 00:39:12 GMT |
|
 |
dwy #7 / 13
|
 Read File Properties
Thanks Jeff, Nobody, MikeB, Thats exactly what I needed, I just didn't know what to search on. David Quote:
> GetFileVersionInfo Function > Start Here: http://msdn.microsoft.com/en-us/library/ms647003(VS.85).aspx
> > How would I read the file version properties of a standard DLL? In > > particular I need the company name property from VISA32.dll. > > VISA32.dll is a standardized Virtual Instrumentation Software Architecture > > function library that is published by several manufacturers. I need the > > manufacturer name of the *installed* library. > > David > .
|
Wed, 09 May 2012 01:03:01 GMT |
|
 |
dwy #8 / 13
|
 Read File Properties
Quote:
> > How would I read the file version properties of a standard DLL? In > > particular I need the company name property from VISA32.dll. > > VISA32.dll is a standardized Virtual Instrumentation Software Architecture > > function library that is published by several manufacturers. I need the > > manufacturer name of the *installed* library. > > David > In addition to what the others have said there is another issue, there may > be multiple copies of the file from different vendors on the machine but > probably only one is registered and that would be the one you are interested > in. You should consider finding some code to read the registry or to get > associations out of the registry. > I suspect this is going to be a non-trivial task. A interesting start might > be to search your registry for any "VISA32.DLL" entries. > Dave O.
Not an issue with this dll. There can be only one in the system path and it is the single access point to the VISA library. It is a standard dll, not AxtiveX. I need the vendor name so that I'll know where to search the registry for the information that I need. David
|
Wed, 09 May 2012 01:30:03 GMT |
|
 |
Dave O #9 / 13
|
 Read File Properties
Quote: >> In addition to what the others have said there is another issue, there >> may >> be multiple copies of the file from different vendors on the machine but >> probably only one is registered and that would be the one you are >> interested >> in. > Not an issue with this dll. There can be only one in the system path
That would be impossible to enforce. You probably want the first one in the system paths order. So the easiest method would be to get the system path, break it down into separate folders then search them in order until you find your file. Dave O.
|
Fri, 11 May 2012 17:47:33 GMT |
|
 |
David Youngbloo #10 / 13
|
 Read File Properties
Quote:
>>> In addition to what the others have said there is another issue, there >>> may >>> be multiple copies of the file from different vendors on the machine but >>> probably only one is registered and that would be the one you are >>> interested >>> in. >> Not an issue with this dll. There can be only one in the system path > That would be impossible to enforce. > You probably want the first one in the system paths order. > So the easiest method would be to get the system path, break it down into > separate folders then search them in order until you find your file.
It would appear that the only way to duplicate the windows search order is to let windows conduct the search. Private Sub Command1_Click() Print FindDllPath("VISA32.dll") End Sub Private Function FindDllPath(ByVal filename As String) As String Dim sPath As String Dim hModule As Long Dim iBytes As Long hModule = LoadLibrary(filename) If hModule Then sPath = Space(MAX_PATH) iBytes = GetModuleFileName(hModule, sPath, Len(sPath)) FindDllPath = Left$(sPath, iBytes) End If FreeLibrary hModule End Function David
|
Sat, 19 May 2012 20:11:32 GMT |
|
 |
Dave O #11 / 13
|
 Read File Properties
Quote:
>>>> In addition to what the others have said there is another issue, there >>>> may >>>> be multiple copies of the file from different vendors on the machine >>>> but >>>> probably only one is registered and that would be the one you are >>>> interested >>>> in. >>> Not an issue with this dll. There can be only one in the system path >> That would be impossible to enforce. >> You probably want the first one in the system paths order. >> So the easiest method would be to get the system path, break it down into >> separate folders then search them in order until you find your file. > It would appear that the only way to duplicate the windows search order is > to let windows conduct the search.
No, you get the path comspec. If you are not familiar with the environment variable "Path" open a command window and type: Path this will return the path list where each folder is separated by a semicolon and crucially the folders are listed in the order the system searches them (after first searching the current folder). So to expand on what I said before, you retrieve the Path environment variable, split it on ; then search each folder in the order returned by the Split command. But if GetModuleFileName works then use that, I'm just pointing out that you can do it directly. Regards Dave O.
|
Sat, 19 May 2012 22:49:44 GMT |
|
 |
dwy #12 / 13
|
 Read File Properties
Quote:
> >>>> In addition to what the others have said there is another issue, there > >>>> may > >>>> be multiple copies of the file from different vendors on the machine > >>>> but > >>>> probably only one is registered and that would be the one you are > >>>> interested > >>>> in. > >>> Not an issue with this dll. There can be only one in the system path > >> That would be impossible to enforce. > >> You probably want the first one in the system paths order. > >> So the easiest method would be to get the system path, break it down into > >> separate folders then search them in order until you find your file. > > It would appear that the only way to duplicate the windows search order is > > to let windows conduct the search. > No, you get the path comspec. If you are not familiar with the environment > variable "Path" open a command window and type: Path > this will return the path list where each folder is separated by a semicolon > and crucially the folders are listed in the order the system searches them > (after first searching the current folder). > So to expand on what I said before, you retrieve the Path environment > variable, split it on ; then search each folder in the order returned by the > Split command. > But if GetModuleFileName works then use that, I'm just pointing out that you > can do it directly.
http://msdn.microsoft.com/en-us/library/ms682586(VS.85).aspx This is where I got my information. Are you saying the documentation is wrong? In each case the PATH Environment variable is number 6 on the list of where to search. The dll should have been found by the time the search gets here. David
|
Sun, 20 May 2012 00:33:01 GMT |
|
 |
Dave O #13 / 13
|
 Read File Properties
Quote:
>> >>>> In addition to what the others have said there is another issue, >> >>>> there >> >>>> may >> >>>> be multiple copies of the file from different vendors on the machine >> >>>> but >> >>>> probably only one is registered and that would be the one you are >> >>>> interested >> >>>> in. >> >>> Not an issue with this dll. There can be only one in the system path >> >> That would be impossible to enforce. >> >> You probably want the first one in the system paths order. >> >> So the easiest method would be to get the system path, break it down >> >> into >> >> separate folders then search them in order until you find your file. >> > It would appear that the only way to duplicate the windows search order >> > is >> > to let windows conduct the search. >> No, you get the path comspec. If you are not familiar with the >> environment >> variable "Path" open a command window and type: Path >> this will return the path list where each folder is separated by a >> semicolon >> and crucially the folders are listed in the order the system searches >> them >> (after first searching the current folder). >> So to expand on what I said before, you retrieve the Path environment >> variable, split it on ; then search each folder in the order returned by >> the >> Split command. >> But if GetModuleFileName works then use that, I'm just pointing out that >> you >> can do it directly. > http://msdn.microsoft.com/en-us/library/ms682586(VS.85).aspx > This is where I got my information. Are you saying the documentation is > wrong? In each case the PATH Environment variable is number 6 on the list > of > where to search. The dll should have been found by the time the search > gets > here. > David
No the documentation is correct but also a bit disingenuous because the System folder and the Windows folder are also in the Path. Also I should have said current & application instead of just "current", mea culpa, however unless specifically set in the shortcut or changed in the program they will more often than not be one and the same. So the only one that I have not covered is the 16bit system folder which is not used by much except legacy drivers. Regards Dave O.
|
Sun, 20 May 2012 18:41:05 GMT |
|
|