Page 1 of 1

FolderBrowserDialog crashing application

Posted: Thu Oct 26, 2017 10:56 am
by gutihz
Hi Everyone,

In my form I'm having the user select a folder and I get the folder path. When I run my application within the Sapien everything works. But when I build the app and run the executable on another computer everything works except the folder browser dialog. When I click on the button to open the folder browser dialog the application goes in to "not responding" mode.
I tried both "FolderBrowserDialog" and "FolderBrowserModernDialog" with same result.
I tried changing the build settings from V3 to V5 and V2with same result.

here is how I call it

Code: Select all

$btnopenfb_Click={
	
		if ([Void]$fb.ShowDialog() -eq 'OK')
		{
			$txtboxPaths.AppendText($fb.SelectedPath)
			$txtboxPaths.AppendText("`n")
		}
	}
Does anyone know if this is a bug or something?

Thanks in advance.


PowerShell Studio 2017 5.4.145
Version of product: 64
Operating system: Windows 7
OS: 64 bit

Re: FolderBrowserDialog crashing application

Posted: Thu Oct 26, 2017 11:02 am
by jvierra
Be sure to build in STA mode.

Re: FolderBrowserDialog crashing application

Posted: Thu Oct 26, 2017 11:06 am
by gutihz
YOU ARE A FREAKING GENIUS!!!!

I've always wondered how do you know all this s..t. I truly admire you!

Re: FolderBrowserDialog crashing application

Posted: Thu Oct 26, 2017 11:29 am
by jvierra
I have been a developer for more than 30 years and have studied Windows and most other operating systems extensively at the internals level. The stuff just accumulates. I also use a lot of PowerShell and have read all of the current advanced books on PS and continue to refer to them when I am in doubt.

Anyone who puts in sufficient effort can get to where I am and many have gone way past me. Today I meet young programmers out of college for only a couple of years that are way advanced and moving at high speed. They grab new technologies even faster than I can.

All of this is based on your level of interest, curiosity and sweat.