Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: hi... Pin
Michel Godfroid3-May-10 21:53
Michel Godfroid3-May-10 21:53 
AnswerRe: hi... Pin
CPallini3-May-10 21:56
mveCPallini3-May-10 21:56 
GeneralRe: hi... Pin
Michel Godfroid3-May-10 22:23
Michel Godfroid3-May-10 22:23 
AnswerRe: hi... Pin
Rajesh R Subramanian3-May-10 22:34
professionalRajesh R Subramanian3-May-10 22:34 
GeneralRe: read excel data using vc++ Pin
kamalilam6-May-10 1:01
kamalilam6-May-10 1:01 
GeneralRe: read excel data using vc++ Pin
Rajesh R Subramanian6-May-10 2:18
professionalRajesh R Subramanian6-May-10 2:18 
AnswerRe: hi... Pin
lpfvip3-May-10 23:06
lpfvip3-May-10 23:06 
QuestionWhy did ParseDisplayName fail ? Pin
Thang3-May-10 20:40
Thang3-May-10 20:40 
Dear gurus,
I'm having a problem in using ParseDisplayName.
1) I have a path of USB drive, such as: G:\
2) I pass this driver path into my function, which will call
ParseDisplayName to get PIDL item, as below:
LPITEMIDLIST CTemp::getItemIDList( CString p_strPath )
{
USES_CONVERSION;

if( p_strPath.IsEmpty() )
{
return NULL;
}

LPITEMIDLIST l_pIDL;
LPSHELLFOLDER pDesktopFolder;

if( ::SHGetDesktopFolder( &pDesktopFolder ) != NOERROR )
{
return NULL;
}

OLECHAR ochPath[MAX_PATH];
ULONG chEaten;
ULONG dwAttributes;
HRESULT hRes;
::MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, W2A(p_strPath), -1, ochPath,
MAX_PATH );
hRes = pDesktopFolder->ParseDisplayName( NULL, NULL, ochPath, &chEaten,
&l_pIDL, &dwAttributes);
pDesktopFolder->Release();
return l_pIDL;
}
3) The hRes result is 0x80070003 指定されたパスが見つかりません.
I don't know why it was failed.

I also try another way to solve this bug and I realize that, if i access to
this USB drive before calling ParseDisplayName, this method ParseDisplayName
always return good result, S_OK, such as:
a) Call the function ParseDisplayName at the first time, right after calling
ParseDisplayName again, the hRes result will be S_OK.
b) Declare a file path variable to one file in USB drive.
Call ParseDisplayName with this file path, then call ParseDisplayName with
the USB drive path, the hRes result will be S_OK.
c) Use while loop to browse each drive after using CSIDL_DRIVES, then
calling ParseDisplayName, the hRes result will be S_OK.

So can you help me to explain two issues:
1) Why does the ParseDisplayName method fail in this case ?
2) Why does the ParseDisplayName method success after accessing the USB
drive at first time?

If anybody here had the same situation like mine, please help me to clarify
the mystery surrounding this phenomenon.
I'm looking forward to seeing your replies.

Best regards,
Jetflower
AnswerRe: Why did ParseDisplayName fail ? Pin
Naveen3-May-10 22:05
Naveen3-May-10 22:05 
GeneralRe: Why did ParseDisplayName fail ? Pin
Michel Godfroid3-May-10 22:28
Michel Godfroid3-May-10 22:28 
AnswerRe: Why did ParseDisplayName fail ? Pin
Michel Godfroid3-May-10 22:18
Michel Godfroid3-May-10 22:18 
QuestionRe: Why did ParseDisplayName fail ? Pin
Randor 4-May-10 6:57
professional Randor 4-May-10 6:57 
QuestionHow To Restrict Dialog Box in an SDI to be With in Application Boundaries [modified] Pin
K ARUN KUMAR3-May-10 19:35
K ARUN KUMAR3-May-10 19:35 
AnswerRe: How To Restrict Dialog Box in an SDI to be With in Application Boundaries Pin
Richard MacCutchan3-May-10 22:38
mveRichard MacCutchan3-May-10 22:38 
GeneralRe: How To Restrict Dialog Box in an SDI to be With in Application Boundaries Pin
K ARUN KUMAR3-May-10 23:28
K ARUN KUMAR3-May-10 23:28 
GeneralRe: How To Restrict Dialog Box in an SDI to be With in Application Boundaries Pin
enhzflep3-May-10 23:58
enhzflep3-May-10 23:58 
GeneralRe: How To Restrict Dialog Box in an SDI to be With in Application Boundaries Pin
K ARUN KUMAR4-May-10 0:10
K ARUN KUMAR4-May-10 0:10 
GeneralRe: How To Restrict Dialog Box in an SDI to be With in Application Boundaries Pin
Richard MacCutchan4-May-10 1:45
mveRichard MacCutchan4-May-10 1:45 
AnswerRe: Use a CFrameWind. Pin
Software_Developer4-May-10 0:16
Software_Developer4-May-10 0:16 
GeneralRe: Use a CFrameWind. Pin
K ARUN KUMAR4-May-10 0:27
K ARUN KUMAR4-May-10 0:27 
GeneralRe: CFormView and Child Dialogs (read thisprevious post) Pin
Software_Developer4-May-10 0:50
Software_Developer4-May-10 0:50 
GeneralRe: CFormView and Child Dialogs (read thisprevious post) Pin
K ARUN KUMAR4-May-10 1:00
K ARUN KUMAR4-May-10 1:00 
AnswerRe: How To Restrict Dialog Box in an SDI to be With in Application Boundaries Pin
David Crow4-May-10 3:00
David Crow4-May-10 3:00 
GeneralRe: How To Restrict Dialog Box in an SDI to be With in Application Boundaries [modified] Pin
K ARUN KUMAR4-May-10 18:21
K ARUN KUMAR4-May-10 18:21 
Questionwin32 debug to win32 release mode in vc6 Pin
Member 36537513-May-10 18:52
Member 36537513-May-10 18:52 

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.