Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog

Status
Not open for further replies.

rcraig12

Technical User
Jan 22, 2003
40
GB
Hi guys,

Probably a n00b question. But how do I convince the Common Dialog to accept me selecting nothinh in a given filepath so that I can only collect the path.

I need this for setting project folder roots and so on.

Code:
	OPENFILENAME ofn; char buf[256]; buf[0] = NULL;
	memset(&ofn,0,sizeof(ofn));
	ofn.lStructSize = sizeof(ofn);
	ofn.hwndOwner = Wnd;
	ofn.lpstrFile = buf;
	ofn.nMaxFile = sizeof(buf);
	ofn.lpstrFilter = "Project Files (*.prj)\0*.prj\0All Files(*.*)\0*.*\0";
	ofn.Flags = OFN_HIDEREADONLY;
	if(!GetOpenFileName(&ofn)) return;

I need to use a different call perhaps than GetOpenFileName.

Thanks guys in advance.

cheers.

Kebab
 
Its OK found the solution.

I was using the wrong function all together. For info google SHBrowseForFolder

thanks anyways.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top