Click here to Skip to main content
15,918,967 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: System/CreateProcess'd process terminating Pin
mike-o14-Jul-04 10:21
mike-o14-Jul-04 10:21 
GeneralRe: System/CreateProcess'd process terminating Pin
bikram singh14-Jul-04 10:38
bikram singh14-Jul-04 10:38 
GeneralRe: System/CreateProcess'd process terminating Pin
mike-o14-Jul-04 10:43
mike-o14-Jul-04 10:43 
GeneralSetting The Current Directory Pin
sweep12313-Jul-04 5:44
sweep12313-Jul-04 5:44 
GeneralRe: Setting The Current Directory Pin
palbano13-Jul-04 5:52
palbano13-Jul-04 5:52 
GeneralRe: Setting The Current Directory Pin
sweep12313-Jul-04 6:04
sweep12313-Jul-04 6:04 
GeneralRe: Setting The Current Directory Pin
palbano13-Jul-04 6:48
palbano13-Jul-04 6:48 
GeneralRe: Setting The Current Directory Pin
sweep12313-Jul-04 21:51
sweep12313-Jul-04 21:51 
I am still confused!

In the DirTreeCtrl, I try and set the current directory to the on we have navigated to. (See code below)

if ( find.IsDirectory() && !find.IsDots() )<br />
{		<br />
	strDirArray.Add( find.GetFilePath() );<br />
	currentDirectory = find.GetFilePath();<br />
	currentDirectory = currentDirectory.GetBuffer(currentDirectory.GetLength ());<br />
	strcpy(CurrentPathName, currentDirectory);<br />
	SetCurrentDirectory(CurrentPathName);<br />
}


Now when I double-click a file in the current directory, the displayed current directory via AfxMessageBox is the one my program started up in. Not the one I thought I set in the code above.


void CScriptingDlg::OnNMDblclkTree1(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
	/* Now launch the CSL program with the selected file.	*/<br />
<br />
	//SetCurrentDirectory("C:\\CSL");<br />
	char currentdir[255];<br />
	CString messageStr;<br />
	GetCurrentDirectory(sizeof(currentdir), currentdir);<br />
	ShellExecute(0, "open", m_strPath, NULL, "C:\\CSL", SW_SHOWNORMAL);<br />
	messageStr.Format ("Current Directory = %s", currentdir);<br />
	AfxMessageBox(messageStr);<br />
}


If however I use palbano suggestion in the ShellExecute command and specify the directory the script file runs OK.

But the current directory is C:\MyProgram\res and not C:\CSL. This is want I dont understand.
GeneralRe: Setting The Current Directory Pin
bikram singh13-Jul-04 6:13
bikram singh13-Jul-04 6:13 
GeneralRe: Setting The Current Directory Pin
sweep12313-Jul-04 6:26
sweep12313-Jul-04 6:26 
GeneralRe: Setting The Current Directory Pin
bikram singh13-Jul-04 6:54
bikram singh13-Jul-04 6:54 
Generaltitlebar text Pin
Ahmed Kamal Aly13-Jul-04 5:35
Ahmed Kamal Aly13-Jul-04 5:35 
GeneralIntercept WM_NCPAINT Pin
bikram singh13-Jul-04 6:13
bikram singh13-Jul-04 6:13 
GeneralRe: titlebar text Pin
Jens Doose13-Jul-04 6:18
Jens Doose13-Jul-04 6:18 
GeneralInstalling /uninstalling windows service Pin
vipul_vips13-Jul-04 4:36
vipul_vips13-Jul-04 4:36 
GeneralRe: Installing /uninstalling windows service Pin
jmkhael13-Jul-04 4:59
jmkhael13-Jul-04 4:59 
GeneralRe: Installing /uninstalling windows service Pin
David Crow13-Jul-04 5:28
David Crow13-Jul-04 5:28 
GeneralWindows basics Pin
Anonymous13-Jul-04 4:20
Anonymous13-Jul-04 4:20 
GeneralRe: Windows basics Pin
David Crow13-Jul-04 4:28
David Crow13-Jul-04 4:28 
Generalclistctrl variable row height Pin
maxsteel13-Jul-04 3:28
maxsteel13-Jul-04 3:28 
GeneralRe: clistctrl variable row height Pin
Ryan Binns13-Jul-04 18:30
Ryan Binns13-Jul-04 18:30 
GeneralCreate an own User Right in Windows XP Pin
Jens Doose13-Jul-04 3:14
Jens Doose13-Jul-04 3:14 
GeneralRe: Create an own User Right in Windows XP Pin
bikram singh13-Jul-04 6:28
bikram singh13-Jul-04 6:28 
GeneralMFC: frame window without caption bar Pin
Fabrizio Frassa13-Jul-04 3:01
Fabrizio Frassa13-Jul-04 3:01 
GeneralRe: MFC: frame window without caption bar Pin
David Crow13-Jul-04 3:59
David Crow13-Jul-04 3:59 

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.