Click here to Skip to main content
15,914,419 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ Constructor Pin
act_x12-May-04 9:56
act_x12-May-04 9:56 
GeneralRe: C++ Constructor Pin
act_x12-May-04 10:01
act_x12-May-04 10:01 
GeneralRe: C++ Constructor Pin
toxcct12-May-04 10:05
toxcct12-May-04 10:05 
Generalsound recording & playback Pin
shoonya12-May-04 9:31
shoonya12-May-04 9:31 
GeneralRe: sound recording & playback Pin
Anthony_Yio12-May-04 16:51
Anthony_Yio12-May-04 16:51 
GeneralRe: sound recording & playback Pin
Marcus Spitzmiller12-May-04 17:58
Marcus Spitzmiller12-May-04 17:58 
GeneralRe: sound recording & playback Pin
Joe Woodbury12-May-04 19:57
professionalJoe Woodbury12-May-04 19:57 
GeneralGet the path of a file Pin
Ruben93812-May-04 7:59
Ruben93812-May-04 7:59 
Hi and thanks in advance:

I am trying to create an application that first offers the user to open a file. I am using the function GETOPENFILE, then I my purpose is to check in the same folder, if there is another file (no user interaction there). For that, I was using the variable ofn (OPENFILENAME type) from the previous task, so it should have the information of the path and file name.

I tried, but had troubles to do that.

Here is a part of the code:

<br />
<br />
void CMainFrame::OnButton32794() <br />
{<br />
// TODO: Add your command handler code here<br />
<br />
//The user opens the firs file:<br />
OPENFILENAME ofn;<br />
memset(&ofn, 0, sizeof(ofn));<br />
ofn.lStructSize = sizeof(ofn);<br />
ofn.lpstrFilter = "Tec Files (*.tec)\0*.tec\0All Files (*.*)\0*.*\0\0";<br />
int nResult = ::GetOpenFileName(&ofn);<br />
<br />
//Now check for the second:<br />
CString str;<br />
LPCTSTR azcv;<br />
TCHAR szPath[MAX_PATH];<br />
LPCTSTR lpszFileName;<br />
LPTSTR lpszFilePart;    <br />
WCHAR wszTemp[MAX_PATH];<br />
<br />
lpszFileName = ofn.lpstrFile;<br />
<br />
//That should return the path the user selected..<br />
str = GetFullPathName(lpszFileName, <br />
                       sizeof(szPath) / sizeof(TCHAR), <br />
					   szPath, &lpszFilePart);<br />
<br />
//This is just a check I wanted to put in.<br />
MessageBox(str);<br />
}<br />
<br />

GeneralRe: Get the path of a file Pin
David Crow12-May-04 8:11
David Crow12-May-04 8:11 
GeneralRe: Get the path of a file Pin
Ruben93812-May-04 8:45
Ruben93812-May-04 8:45 
GeneralRe: Get the path of a file Pin
David Crow12-May-04 8:49
David Crow12-May-04 8:49 
GeneralRe: Get the path of a file Pin
Ruben93812-May-04 11:16
Ruben93812-May-04 11:16 
GeneralRe: Get the path of a file Pin
David Crow13-May-04 2:09
David Crow13-May-04 2:09 
GeneralRe: Get the path of a file Pin
Ruben93812-May-04 11:16
Ruben93812-May-04 11:16 
GeneralRe: Get the path of a file Pin
David Crow13-May-04 2:11
David Crow13-May-04 2:11 
GeneralRe: Get the path of a file Pin
Christopher Lloyd12-May-04 10:30
Christopher Lloyd12-May-04 10:30 
GeneralRe: Get the path of a file Pin
Ruben93812-May-04 11:22
Ruben93812-May-04 11:22 
GeneralRe: Get the path of a file Pin
Christopher Lloyd13-May-04 2:00
Christopher Lloyd13-May-04 2:00 
GeneralRe: Get the path of a file Pin
Ruben93812-May-04 11:50
Ruben93812-May-04 11:50 
GeneralHexadecimal Pin
Roger H. Art12-May-04 7:34
sussRoger H. Art12-May-04 7:34 
GeneralRe: Hexadecimal Pin
David Crow12-May-04 7:41
David Crow12-May-04 7:41 
GeneralRe: Hexadecimal Pin
toxcct12-May-04 7:44
toxcct12-May-04 7:44 
QuestionHow to set up Windows XP theme for the controls Pin
Truong D. Toan12-May-04 7:07
Truong D. Toan12-May-04 7:07 
AnswerRe: How to set up Windows XP theme for the controls Pin
Joe Woodbury12-May-04 7:11
professionalJoe Woodbury12-May-04 7:11 
AnswerRe: How to set up Windows XP theme for the controls Pin
Prakash Nadar12-May-04 7:14
Prakash Nadar12-May-04 7:14 

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.