1. VC中有没有类似于asp中File控件一类的控件?就是一个TextBox+Button,点击Button弹出“显示文件”的对话框?确定把路径显示在TextBox中;2. 上例中,不要求路径到具体文件,而只是到某一个文件夹的情况;3. 标签页中的点击事件怎样传值到加载标签页的Dialog?4. VC中怎样在程序中创建Access数据库,并且怎样遍历某Access数据库并获得表中的字段和类型?
调试欢乐多
// "*.my" for "MyType Files" and "*.*' for "All Files."
char CChildFrame::szFilters[]=
"MyType Files (*.my)|*.my|All Files (*.*)|*.*||"; // Create an Open dialog; the default file name extension is ".my".
CFileDialog fileDlg (TRUE, "my", "*.my",
OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, szFilters, this);
// Display the file dialog. When user clicks OK, fileDlg.DoModal()
// returns IDOK.
if( fileDlg.DoModal ()==IDOK )
{
CString pathName = fileDlg.GetPathName();
// Implement opening and reading file in here.
...
//Change the window's title to the opened file's title.
CString fileName = fileDlg.GetFileTitle ();
}
char path[MAX_PATH];
BROWSEINFO br;
ITEMIDLIST *item;
br.hwndOwner = this->GetSafeHwnd();
br.iImage = 0;
br.pszDisplayName = 0;
br.lParam = 0;
br.lpfn = 0;
br.lpszTitle = "文件夹";
br.pidlRoot = 0;
br.ulFlags = BIF_RETURNONLYFSDIRS;
item = SHBrowseForFolder(&br);
if (SHGetPathFromIDList(item,path)==TRUE)
{
// path为文件夹路径
}
http://www.vckbase.com/document/viewdoc/?id=7552 枚举表格中的字段
http://www.vckbase.com/document/viewdoc/?id=1098