Click here to Skip to main content
16,004,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Title Bar Problems Pin
Bob Stanneveld29-Aug-03 4:32
Bob Stanneveld29-Aug-03 4:32 
GeneralNetUserEnum() return value where define Pin
Old Gun28-Aug-03 4:32
Old Gun28-Aug-03 4:32 
GeneralRe: NetUserEnum() return value where define Pin
jhwurmbach28-Aug-03 5:43
jhwurmbach28-Aug-03 5:43 
GeneralRe: NetUserEnum() return value where define Pin
David Crow28-Aug-03 7:09
David Crow28-Aug-03 7:09 
GeneralRe: NetUserEnum() return value where define Pin
Alexander M.,28-Aug-03 12:47
Alexander M.,28-Aug-03 12:47 
GeneralRe: NetUserEnum() return value where define Pin
Old Gun28-Aug-03 18:19
Old Gun28-Aug-03 18:19 
GeneralRe: NetUserEnum() return value where define Pin
jhwurmbach29-Aug-03 4:16
jhwurmbach29-Aug-03 4:16 
Generalpreventative directories Pin
will138328-Aug-03 4:31
will138328-Aug-03 4:31 
Hi All,

I'm implementing a CFileDialog open/save as application using 6.0.

My problem is trying to prevent the user from browsing above a specific directory, but allow them to browse the directories below it.

I've tried many different approaches, but I still can't get it to work. At the moment I'm capturing the OnFolderChange message, which is produced after the user changes the folder he/she is browsing. In that method, I'm checking the current directory, and if it is outside of my directory range, then I thought I could just set the current working directory to what I need it to be, and then force the application to redraw. Here's the code:

<br />
void CLibselformdlg::OnFolderChange() <br />
{<br />
	char buffer[MAX_PATH]="";<br />
	DWORD tmp;<br />
	::GetCurrentDirectory(MAX_PATH,buffer);<br />
	tmp = ::GetLastError();<br />
	IUXLogData("are you ready\n",TRACE1);<br />
	if (strstr(buffer,"C:\\iux\\data") == NULL){<br />
		::SetCurrentDirectory("\\iux\\data");<br />
		tmp = ::GetLastError();<br />
		this->Invalidate();<br />
		// need to reset the list view and the combobox view with the new (original) folder<br />
		//	then refresh the display here.<br />
		//::SendMessage(this->m_hWnd,WM_ERASEBKGND,(WPARAM)::GetDC(this->m_hWnd),NULL);<br />
		//::SendMessage(this->m_hWnd,WM_PAINT,(WPARAM)::GetDC(this->m_hWnd),NULL);<br />
		//this->UpdateWindow();<br />
	}<br />
}<br />


The SetCurrentDirectory I don't think works. The getlasterror returns a 183 after this function is run. You can see the different ways I've been trying to force the window to redraw with the new directory, but I'm not having any luck.

Any Suggestions? Confused | :confused:

Thanks alot!

Dan
GeneralRe: preventative directories Pin
Steve S28-Aug-03 7:04
Steve S28-Aug-03 7:04 
GeneralRe: preventative directories Pin
will138328-Aug-03 7:46
will138328-Aug-03 7:46 
GeneralRe: preventative directories Pin
David Crow28-Aug-03 7:12
David Crow28-Aug-03 7:12 
GeneralRe: preventative directories Pin
will138328-Aug-03 7:50
will138328-Aug-03 7:50 
GeneralRe: preventative directories Pin
David Crow28-Aug-03 8:09
David Crow28-Aug-03 8:09 
GeneralPorting VC++ 6.0 -&gt; VC++.net 2003 Help Requested Pin
Larry J. Siddens28-Aug-03 4:27
Larry J. Siddens28-Aug-03 4:27 
GeneralRe: Porting VC++ 6.0 -&gt; VC++.net 2003 Help Requested Pin
valikac28-Aug-03 6:12
valikac28-Aug-03 6:12 
Generalexcel automation Pin
act_x28-Aug-03 4:21
act_x28-Aug-03 4:21 
GeneralRe: excel automation Pin
will138328-Aug-03 4:33
will138328-Aug-03 4:33 
GeneralRe: excel automation Pin
David Crow28-Aug-03 7:19
David Crow28-Aug-03 7:19 
GeneralRe: excel automation Pin
Malcolm Smart22-Oct-04 11:37
Malcolm Smart22-Oct-04 11:37 
GeneralRe: excel automation Pin
David Crow22-Oct-04 11:42
David Crow22-Oct-04 11:42 
GeneralRe: excel automation Pin
Malcolm Smart28-Oct-04 2:49
Malcolm Smart28-Oct-04 2:49 
GeneralDialog (Modal) based MFC Application, fails to respond properly to 'Minimize-All', 'Restore on click from taskbar-entry', etc Pin
ohadp28-Aug-03 3:34
ohadp28-Aug-03 3:34 
GeneralRe: Dialog (Modal) based MFC Application, fails to respond properly to 'Minimize-All', 'Restore on click from taskbar-entry', etc Pin
David Crow28-Aug-03 3:39
David Crow28-Aug-03 3:39 
GeneralRe: Dialog (Modal) based MFC Application, fails to respond properly to 'Minimize-All', 'Restore on click from taskbar-entry', etc Pin
ohadp28-Aug-03 3:51
ohadp28-Aug-03 3:51 
GeneralCreating and saving to a file Pin
NewHSKid28-Aug-03 2:29
NewHSKid28-Aug-03 2:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.