473,793 Members | 2,922 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Open file dialog not showing network locations

5 New Member
I am doing setup project in VS 2008. I used custom action to select file from local drives. On the button click of custom action form, I am launching Open file dialog as

ofdGetNetPath.S howDialog
When I run the setup on Vista, and click the button to open the openFileDialog, it hanged, form becomes non responsive and I have to cancel the setup.

on debugging I got following error
"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your main function has STAThreadAttrib ute marked in it. This exception is only raised if a debugger is attached to the process."

so I used the following code:
Expand|Select|Wrap|Line Numbers
  1. Dim ofdThread As Thread
  2.  
  3. ofdThread = New Thread(New ThreadStart(AddressOf ShowOpenFileDialog))
  4.  
  5. ofdThread.SetApartmentState(ApartmentState.STA)
  6.  
  7. ofdThread.Start()
  8.  
  9. Private Sub ShowOpenFileDialog()
  10.           Me.ofdGetNetPath.ShowDialog()
  11. End Sub
now on button click, OpenFileDialog is shown but it is not showing Mapped drive or Network location... what should I need to do to show the mapped drive or network locations?
Jun 3 '09 #1
2 3436
Frinavale
9,735 Recognized Expert Moderator Expert
This isn't making sense to me.

Why are you using an OpenFileDialog in a thread to begin with?
Jun 3 '09 #2
pandehrushikesh
5 New Member
I have to use thread becouse if I directly launch the open file dialog (ofdGetNetPath. ShowDialog) in the custom action, it gives following error

"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your main function has STAThreadAttrib ute marked in it. This exception is only raised if a debugger is attached to the process."
Jun 4 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1667
by: Bernavich2004 | last post by:
Ok I am going nuts. This problem ONLY happens when I use a Microsoft Office 2003 product like word, or .NET development IDE. WHen I use the Open file dialog and click on a folder to drill down, or up depending it takes 3 to 5 minutes to open a folder. This DOES NOT happen with any otehr product unless its a microsoft product. YOu can imagine how much this sucks when I have to add a refrence that is 7 folders deep. Impossible. ...
2
3292
by: nissiml | last post by:
hi, i'm trying to open a asp.net web page that list files from a Windows application like winword and select a file from it . what do i have to do to make it happen, is it simple ? Thanks in Advance.
9
38592
by: Amit D.Shinde | last post by:
How to enable user for selecting only folders and not the files with the Open File Dialog. i.e. I want only path of the selected folder is to be returned by Open File Dialog. i.e Open File Dialog should work like a Dir List Box in VB 6.0 or any other control is there to act as a Dir List Box Help Me, Thanking You Amit Shinde
0
1298
by: Me | last post by:
I have an application that has a text box. At the end on the text box is the standard elypsis (command button) for launching the Open File Dialog box. I want the user to select a certain executable and have the full path and file name written back into the text box. This is all pretty simple and working well in Windows 2000 and WIndows XP. However, In windows 98, when the user selects the file and the selects the Open button to close the...
3
1888
by: The ants are driving me crazy | last post by:
The open file dialog control in Windows forms has an "Open" button. Is there a way to change the text of the button to something other than "Open"?
2
6157
by: Mattbooty | last post by:
Hello, Not sure if anyone else has seen this bug, but I have a form where the entire form is covered with a picturebox. The picturebox has a mouseup event. I also have an open file dialog for loading images into the picturebox. If you double click the file you want to open in the open file dialog, it somehow interperets one of the clicks as a mouseup on the picturebox and fires the mouseup event for the picturebox. How can I get...
1
8058
by: SAL | last post by:
Hello, Has anyone use the Open File Dialog Box in ASP.net? I know you can add the HTML File Field control to your ASP page and it will open the File Dialog Box for you. However, I would like to add a Button to my ASP page instead that does the same thing. I'm new to ASP.net and C#, so I'm not sure how I can achieve this. If someone has a code snippet that I can looked at that does this that would be great
4
3348
by: nightscorpion | last post by:
Hello Gurus, i implemented the OpenFileDialog in my Windows Form Applications and it worked perfectly fine.However when it was run on a remote desktop i got the below error . rt now im not sure where the problem is . is it something to do with any dll file which i need to include. if yes could u suggest me which dll files are involved in the open file dialog? thank u in advance See the end of this message for...
2
4143
by: pandehrushikesh | last post by:
I am using Vista Business SP1. When I run some application "As Administrator" (even if I am administrator), Open file dialog does not show the mapped drive or network locations. any Idea???
0
9670
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10159
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.