|
ulFlags
Flags specifying the options for the dialog box. This member can include zero or a combination of the following values: BIF_BROWSEFORCOMPUTER Only return computers. If the user selects anything other than a computer, the OK button is grayed.
BIF_BROWSEFORPRINTER Only return printers. If the user selects anything other than a printer, the OK button is grayed.
BIF_BROWSEINCLUDEFILES Version 4.71. The browse dialog box will display files as well as folders.
BIF_BROWSEINCLUDEURLS Version 5.0. The browse dialog box can display URLs. The BIF_USENEWUI and BIF_BROWSEINCLUDEFILES flags must also be set. If these three flags are not set, the browser dialog box will reject URLs. Even when these flags are set, the browse dialog box will only display URLs if the folder that contains the selected item supports them. When the folder's IShellFolder::GetAttributesOf method is called to request the selected item's attributes, the folder must set the SFGAO_FOLDER attribute flag. Otherwise, the browse dialog box will not display the URL.
BIF_DONTGOBELOWDOMAIN Do not include network folders below the domain level in the dialog box's tree view control.
BIF_EDITBOX Version 4.71. Include an edit control in the browse dialog box that allows the user to type the name of an item.
BIF_NEWDIALOGSTYLE Version 5.0. Use the new user interface. Setting this flag provides the user with a larger dialog box that can be resized. The dialog box has several new capabilities including: drag and drop capability within the dialog box, reordering, shortcut menus, new folders, delete, and other shortcut menu commands. To use this flag, you must call OleInitialize or CoInitialize before calling SHBrowseForFolder.
BIF_NONEWFOLDERBUTTON Do not include the "New Folder" button in the browse dialog box.
BIF_RETURNFSANCESTORS Only return file system ancestors. An ancestor is a subfolder that is beneath the root folder in the namespace hierarchy. If the user selects an ancestor of the root folder that is not part of the file system, the OK button is grayed.
BIF_RETURNONLYFSDIRS Only return file system directories. If the user selects folders that are not part of the file system, the OK button is grayed.
BIF_SHAREABLE Version 5.0. The browse dialog box can display shareable resources on remote systems. It is intended for applications that want to expose remote shares on a local system. The BIF_USENEWUI flag must also be set.
BIF_STATUSTEXT Include a status area in the dialog box. The callback function can set the status text by sending messages to the dialog box.
BIF_UAHINT When combined with BIF_NEWDIALOGSTYLE, adds a usage hint to the dialog box in place of the edit box. BIF_EDITBOX overrides this flag.
BIF_USENEWUI Version 5.0. Use the new user interface, including an edit box. This flag is equivalent to BIF_EDITBOX | BIF_NEWDIALOGSTYLE. To use BIF_USENEWUI, you must call OleInitialize or CoInitialize before calling SHBrowseForFolder.
BIF_VALIDATE
Thats from my MSDN (Oct 01 I think)
Thanks,
ns
|
|
|
|
|
OK. If it doesnt exist how to prevent the new folder button from showing up?
Thanks,
ns
|
|
|
|
|
I did a search of my Platform SDK header files and found,
#define BIF_NONEWFOLDERBUTTON 0x0200 // Do not add the "New Folder" button to the dialog. Only applicable with BIF_NEWDIALOGSTYLE.
Michael
"Time and tide melts the snowman."
-- The Doctor (Doctor Who: Time and the Rani
|
|
|
|
|
Thats great! I have to make sure the NEWDIALOGSTYLE doesnt cause problems on win 98 etc...but the info is terrific!
Thanks,
ns
|
|
|
|
|
I want to make a simple COM component in MFC (without using ATL). I know how to make it. But i want to fire events from this component, and i don't know how to do this. Is there any sample application you know that can do this ?? I searched here at CP but i only find applications that are made with support of ATL.
|
|
|
|
|
I have answered this question already, a day or two ago.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
in vc6, this short program run well
#include "stdafx.h"
#include "windows.h"
int main(int argc, char* argv[])
{
WORD w = 192;
BYTE l;
l = w;
return 0;
}
get l =192;
but the almost same piece of code in VC7, get l=0;
#include "stdafx.h"
#include "windows.h"
int _tmain(int argc, _TCHAR* argv[])
{
WORD w = 192;
BYTE l;
l = w;
return 0;
}
What's wrong? Is only my compiler go mad or all vc7 compiler get the same result?
|
|
|
|
|
Same result for me between VC6 and VC7. BYTE and WORD typedefs haven't changed so there is no good reason for a problem.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Could it be the optimiser saying you don't use 'i' therefore I'm not gonna bother calculating it?
Blade[DMS]
|
|
|
|
|
That's interesting, I get 192 in VC7 and a debug build...
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
The MSDN says:
CListCtrl::SetItemCountEx
This method sets the virtual number of items in a virtual list view control.
What's a virtual list view control?
And, when does I use SetItemCountEx and when SetItemCount?
--
Nice greets, Daniel.
|
|
|
|
|
MSDN:
Virtual list view description
A virtual list view is a list view control that has the LVS_OWNERDATA style. The LVS_OWNERDATA style enables the control to handle an almost infinite number of items. Specifically, the control can support an item count up to a DWORD. This is possible because the overhead of managing item data is placed on the owner. This allows the virtual list view control to lend itself for use with large databases of information, where specific methods of accessing data are already in place.
A virtual list view control maintains very little item information itself. Except for the item selection and focus information, all item information must be managed by the owner of the control. All other item information is requested from the owner using LVN_GETDISPINFO notification messages.
Because this type of list control is intended for large data sets, it is recommended that you cache requested item data to improve retrieval performance. The list view provides a cache-hinting mechanism to assist in optimizing the cache. The hint is implemented in the form of an LVN_ODCACHEHINT notification message.
SetItemCountEx is for virtual list view control
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Hi,
I have a problem with the recv() function.
it seems to hang!!!
There is a provision to exit out of recv() but doesn't seem to help!!!
Here's the extract!!
==========================================================
while ( ii != 0)
{
ii = recv(sd,aa,1000,0);
}
printf("%d %s",ii,aa);
}
===========================================================
Any Help would be appreciated!!!
Brgds,
John :
|
|
|
|
|
MSDN:
Return Values
If no error occurs, recv returns the number of bytes received. If the connection has been gracefully closed, the return value is zero. Otherwise, a value of SOCKET_ERROR is returned, and a specific error code can be retrieved by calling WSAGetLastError.
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Does anyone can help discover way how to start folder dialog
by SHBrowseForFolder function into any folder chosen by me?
=how to set initial directory?
Thank you for your help.
|
|
|
|
|
check BROWSEINFO
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
The BROWEINFO struct has a member lpfn where you define a Callback function. The Callback could the lokk like:
<br />
switch(uMsg) {<br />
case BFFM_INITIALIZED: {<br />
<br />
if(!m_biark.IsEmpty()){<br />
::SendMessage(hwnd,BFFM_SETSELECTION,TRUE,(DWORD) ((LPCTSTR)m_biark));<br />
}<br />
break;<br />
}<br />
<br />
<br />
default:<br />
break;<br />
}<br />
<br />
|
|
|
|
|
Is here any special parameter or something else for
MFC class CFileDialog to make its file dialog in style
as for example open dialogs in Office2000 look like.(with bar on left)
SDK function GetOpenFileName is doing it in WinME or Win2000
without any special flag, but with MFC class CFileDialog it
always looks like in Win95 (without bar .
Thank you for your help.
(I'm programming in VC++ 6.0)
|
|
|
|
|
Use that:
class CFileDialogEx : public CFileDialog
....
#pragma pack(4) // n=4
int CFileDialogEx::DoModal()
{
struct OPENFILENAMEEX
{
OPENFILENAME of;
void * pvReserved;
DWORD dwReserved;
DWORD FlagsEx;
};
OSVERSIONINFO osvi= {sizeof(OSVERSIONINFO)} ;
bool Win2000=false;
#if _MSC_VER < 1300 //В .NET идет станлартная реализация в MFC
Win2000=(GetVersionEx (&osvi)) &&
(((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) && (osvi.dwMajorVersion >= 5)) ||
((osvi.dwPlatformId = VER_PLATFORM_WIN32_WINDOWS) && (osvi.dwMajorVersion >= 4) && (osvi.dwMinorVersion >= 90)));
#endif
if (Win2000)
{
ASSERT_VALID(this);
ASSERT(m_ofn.Flags & OFN_ENABLEHOOK);
ASSERT(m_ofn.lpfnHook != NULL);
ASSERT(AfxIsValidAddress(m_ofn.lpstrFile, m_ofn.nMaxFile));
DWORD nOffset = lstrlen(m_ofn.lpstrFile)+1;
ASSERT(nOffset <= m_ofn.nMaxFile);
memset(m_ofn.lpstrFile+nOffset, 0, (m_ofn.nMaxFile-nOffset)*sizeof(TCHAR));
HWND hWndFocus = ::GetFocus();
BOOL bEnableParent = FALSE;
m_ofn.hwndOwner = PreModal();
AfxUnhookWindowCreate();
if (m_ofn.hwndOwner != NULL && ::IsWindowEnabled(m_ofn.hwndOwner))
{
bEnableParent = TRUE;
::EnableWindow(m_ofn.hwndOwner, FALSE);
}
_AFX_THREAD_STATE* pThreadState = AfxGetThreadState();
ASSERT(pThreadState->m_pAlternateWndInit == NULL);
if (m_ofn.Flags & OFN_EXPLORER)
pThreadState->m_pAlternateWndInit = this;
else
AfxHookWindowCreate(this);
int nResult;
OPENFILENAMEEX ofn_ex={0};
memcpy(&ofn_ex.of,&m_ofn,sizeof(m_ofn));
ofn_ex.of.lStructSize=sizeof(OPENFILENAMEEX);
if (m_bOpenFileDialog)
nResult = ::GetOpenFileName((LPOPENFILENAME)&ofn_ex);
else
nResult = ::GetSaveFileName((LPOPENFILENAME)&ofn_ex);
memcpy(&m_ofn,&ofn_ex.of,sizeof(m_ofn));
if (nResult)
ASSERT(pThreadState->m_pAlternateWndInit == NULL);
pThreadState->m_pAlternateWndInit = NULL;
if (bEnableParent)
::EnableWindow(m_ofn.hwndOwner, TRUE);
if (::IsWindow(hWndFocus))
::SetFocus(hWndFocus);
PostModal();
return nResult ? nResult : IDCANCEL;
}
else
return CFileDialog::DoModal();
}
#pragma pack()
|
|
|
|
|
I've created an mfc extension dll. Initialy, compiling and linking works fine.
But if I add a dialog to the resource using the resource editor, the sources compile but the .lib-files are not created anymore, so the dll cannot be created either (fatal link error).
Is there a good reason for that?
btw. Even if I comment all references to that dialog (simulate the dialog is not there anymore) the sources compile but the library isn't build.
The .obj-files are there, but no .lib-file is made.
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
You have at least two options :
- in your project settings, check the "Force output" box in the Link / Customize tab.
- add a fake exported function, such like __decl(dllexport) void suckmeall(){} , this will force the linker to produce a .lib library.
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
None of your proposed solutions work
The only files produced are these:
- testdlg.obj
- test.obj
- test.pch
- test.res
- stdafx.obj
- vc60.idb
- vc60.pdb
But no test.dll, nor test.lib
Before I added the dialog, it worked. But now, even when I "comment" the references to testdlg, it doesn't. So, it has something to do with that dialog I guess...
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
After completely removing the dialog from the resource, and deleting the dialog's header and source file from the project, the project created a lib- and dll-file again.
There's still a resource in the project (string table and version info).
So, can't we add a dialog into a dll using the resource editor?
Do I have to use mfc-extension dll or regular dll using shared or static mfc-dll?
using: [VISUAL STUDIO 6.0] [WIN98/2]
|
|
|
|
|
Hi, i'm writing an app which will have its own DB that it will add information to
from searches from various databases (so they have a local copy of search results etc)
Now, which database option should i use, bearing in mind that its a stand alone app and the user could be anywhere ?
I'm told there is a free sybase db, i could use the jet engine?
erm what do people recommend?
Bryce
|
|
|
|
|
I want to remove popup menu that popup when I right mouse click on CHtmlView.
First, I try to map message WM_INITMENUPOPUP in CMyHtmlView, but my message handler has not been execute.
I don't know how can I remove the popup menu.
Please help me.
|
|
|
|