473,396 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

FolderBrowserDialog does not display the directory structure.

I am using Microsoft Development Environment 2003 Version 7.1.3088 and .NET
Framework 1.1 Version 1.1.4322 SP1. I have an MFC application that we have
ported to .NET and have added the FolderBrowserDialog dialog to select a
folder. This works fine if we do not preceed the dialog with a CString.Format
call. When we have the call, the folder browser dialog has the buttons but
not the folder tree. I am able to reproduce the problem by generating a
default MFC dialog based application, changing it to use managed extensions,
and adding a button to the default dialog to execute the following code.

..
..
..
#using <mscorlib.dll>
#using <System.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>

using namespace System::Windows::Forms;

..
..
..
void CMFCToDotNetDlg::OnBnClickedButton1()
{

CString Message;
CString Value = "world";

Message.Format("Hello %s", Value);

#pragma push_macro("new")
#undef new

System::Windows::Forms::FolderBrowserDialog *FolderBrowser;
FolderBrowser = new System::Windows::Forms::FolderBrowserDialog;
FolderBrowser->ShowDialog();

#pragma pop_macro("new")

}

If you comment out the "Message.Format" line, it works perfectly.

From researching the newsgroups, I find that managed code has the same
problem when [STAThread] is not specified. I can't seem to figure out the
correct way to accomplish this in a converted MFC application. I need help
getting FolderBrowserDialog to work consistently.

Nov 17 '05 #1
0 1547

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: | last post by:
Hi, The following code shows the FolderBrowserDialog = broken. FolderBrowserDialog folderDialog = new FolderBrowserDialog(); folderDialog.ShowNewFolderButton = false;...
9
by: hhh12347 | last post by:
FolderBrowserDialog crashes on my Windows 2000 computer. Here is a C# test program: using System; using System.Windows.Forms; public class TestForm : Form { FolderBrowserDialog...
0
by: Alpha | last post by:
My FolderBrowserDialog shows just the description on the top then 3 buttons (OK, Cancel, NewFolder) at the buttom of the dialog. It doesn't desplay the directory tree. I even specified not to...
12
by: JohnR | last post by:
I have narrowed a problem down to a simple example. A form with two buttons. One EXIT and one FBD. The exit button does an "END" to end the application. The FBD button does a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...

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.