From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone ever implemented the SHBrowseForFolder in Shell32.dll from Labview 6.0.2 via a Lib Call Func

My customer feels the File Path Control is not as easy to use as the Browse for Folder box in Windows, I know I can call it from a library call function, but what do I need for parameters, as all I keep getting is a Labvview has preformed and illegal function and will be terminated error box from Windows.

Thanks for all I've learned on this list so far and in the future.

Rick
0 Kudos
Message 1 of 13
(11,496 Views)
> My customer feels the File Path Control is not as easy to use as the
> Browse for Folder box in Windows, I know I can call it from a library
> call function, but what do I need for parameters, as all I keep
> getting is a Labvview has preformed and illegal function and will be
> terminated error box from Windows.
>

You don't say what version you are using. In LV6, the path control
has a built-in browse button that can be configured for selecting
files/folders, new/existing, etc.

For older versions of LV, make a browse Boolean and conditionally
execute the File Dialog node. It is located in the File I/O >>
Advanced section. It really isn't advanced to use and will be
much easier than calling a Windows DLL.

Greg McKaskle
0 Kudos
Message 2 of 13
(11,495 Views)
Greg,

As stated in the question title, I use LV6.0.2. I have used the File Dialog in the past, and I agree that it is easy. This instance is not a matter of choice but 'customer' preference. I have found an activeX function to do as I want, but for my own understanding and knowledge, want to go throught the Windows API libraries, as it bypasses conversions, and goes directly to the op sys. I have the API .h files but don't understand what needs to be passed to the SBBrowseForFolder function, as it is stated that it needs a BrowseInfo structure, which I can pass, but not sure about other requirements or parameters, due to the error returned from WIN9X. Thanks for answering back my question though, as I think I have found a tough one, due to the lack of respons
es.

Rick
0 Kudos
Message 3 of 13
(11,496 Views)
> As stated in the question title, I use LV6.0.2. I have used the File
> Dialog in the past, and I agree that it is easy. This instance is not
> a matter of choice but 'customer' preference. I have found an activeX
> function to do as I want, but for my own understanding and knowledge,
> want to go throught the Windows API libraries, as it bypasses
> conversions, and goes directly to the op sys. I have the API .h files
> but don't understand what needs to be passed to the SBBrowseForFolder
> function, as it is stated that it needs a BrowseInfo structure, which
> I can pass, but not sure about other requirements or parameters, due
> to the error returned from WIN9X. Thanks for answering back my
> question though, as I think I have found a tough one, d
ue to the lack
> of responses.
>

Sorry about that. I missed the title. Apparently you are talking about
the SHBrowseForFolder function. If you haven't already, you might want
to read

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dncdev99/html/vc99c1.asp

You will need some additional WinAPI functions from the ftp site to get
the HWND for a VI to bring up the VI. I hope that gets you close enough.

Greg McKaskle
0 Kudos
Message 4 of 13
(11,495 Views)
Hi Derick,

I have been trying to do exactly the same. For users, it is confusing
to be confronted with a dialog different to the standard windows
"Select Folder..." dialog.

It would be very nice if you could tell me what solution you have
found for this.

Rodrigo

Derick wrote in message news:<506500000005000000EA380000-993342863000@exchange.ni.com>...
> Greg,
>
> As stated in the question title, I use LV6.0.2. I have used the File
> Dialog in the past, and I agree that it is easy. This instance is not
> a matter of choice but 'customer' preference. I have found an activeX
> function to do as I want, but for my own understanding and knowledge,
> want to go throught the Windows API libraries, as it bypasses
> conversions, and goes
directly to the op sys. I have the API .h files
> but don't understand what needs to be passed to the SBBrowseForFolder
> function, as it is stated that it needs a BrowseInfo structure, which
> I can pass, but not sure about other requirements or parameters, due
> to the error returned from WIN9X. Thanks for answering back my
> question though, as I think I have found a tough one, due to the lack
> of responses.
>
> Rick
0 Kudos
Message 5 of 13
(11,495 Views)
Rodrigo and all,

I have had several request for how I solved the Browse for Folder problem. Go to:

http://www.mwe.8m.com/vb/activex/

and download the pbffex.zip file, under the MW Browse For Folder Extensions ActiveX Control header. Unzip the file in your 'temp' folder and find the MPBFF.ocx file in that folder then copy it to your 'system' folder. Register the MPBFF.ocx with your system using regsvr32.exe. Then go into labview and insert an ActiveX container onto your front panel, and insert the MPBFF._MBFF control from the insert activeX object pulldown menu. You then have access to all of the properties and methods available to implement this component. I have attached a small VI, which I use to bring up the Browse for Folder
window.

Hope this helps you all out,

Rick
0 Kudos
Message 6 of 13
(11,495 Views)
You have to create the Windows API BROWSEINFO type and set the Call Dynamic Link Library input type to 'Any'. Here is a VI that displays the Browse for Folder Box for Windows.
Message 7 of 13
(11,483 Views)
Whoops, didn't notice that you have Labview version 6.0.2. Sorry about that. Here is the correct VI for your Labview 6.0.2 and WIndows 98 system. Under Win98, most System dll's live in 'C:\Windows\System'. Under Win NT, 2000 and XP, they reside under 'C:\WIndows\System32'.
0 Kudos
Message 8 of 13
(11,483 Views)
I like this dialog box, but it doesn't allow me to create a new folder.  Does anyone know how to add this functionality?  Also, is it possible to make this pop-up dialog box a modal window?
Thank you,
Steve
0 Kudos
Message 9 of 13
(10,724 Views)

We did a version in the LAVA forums recently:

http://forums.lavag.org/index.php?showtopic=8678&start=0&p=32971&#entry32971


___________________
Try to take over the world!
0 Kudos
Message 10 of 13
(10,721 Views)