|
Again its difficult to guess you said "when you Build it" I cant say anything need to more info.
|
|
|
|
|
I am seeing an unusual behavior with a CListCtrl API on a CFileDialog, only
on VISTA. I have a call like GetItemData on the list control which is
supposed to return the item as a LPCITEMIDLIST but it always returns NULL
only on a VISTA OS. Windows XP is fine.
Can anyone help me on this one?
|
|
|
|
|
BeliefInMe wrote: Can anyone help me on this one?
Without a snippet showing the offending code?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Code's here
LPNMLISTVIEW phdr = NULL;
phdr = reinterpret_cast<LPNMLISTVIEW>(lParam);
CListCtrl lc;
lc.Attach(phdr->hdr.hwndFrom);
LPCITEMIDLIST pidl = (LPCITEMIDLIST) lc.GetItemData(phdr->iItem);
SHGetPathFromIDList(pidl, str);
pidl is NULL. Hence i am not able to get File Path.
if i use GetItemText, i will get only file name without extension.
Any Solution. Or any other way to follow..
This works in XP but not in Vista.
|
|
|
|
|
This is in response to what (notification) message? Are you using a hook with CFileDialog ? Do you have file extensions (in Windows Explorer) turned off?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, you are right..
I am using Hook and OnNotify.
|
|
|
|
|
BeliefInMe wrote: I am using...OnNotify.
Which LVN_xxx notification?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
At the point pidl is NULL , what is the value of phdr->iItem ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
phdr->iItem is showing corect value... The value depends upon which image i select.
|
|
|
|
|
BeliefInMe wrote: phdr->iItem is showing corect value...
Is it ever -1 ?
Are you verifying that phdr->hdr.code is equal to LVN_ITEMCHANGED ?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
ya its like
if (pLVHdr->hdr.code == LVN_ITEMCHANGED && (pLVHdr->uChanged & LVIF_STATE))
and iItem is never -1
|
|
|
|
|
Instead of LPNMLISTVIEW, i used LPLVITEM.
LPLVITEM lv = = reinterpret_cast<LPLVITEM>(lParam);
lv.lParam is also zero.
|
|
|
|
|
BeliefInMe wrote: Instead of LPNMLISTVIEW, i used LPLVITEM.
LPLVITEM lv = = reinterpret_cast<lplvitem>(lParam);
lv.lParam is also zero.
So have you tried casting to a LPNMLISTVIEW instead?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
DavidCrow wrote: So have you tried casting to a LPNMLISTVIEW instead?
I have casted to LPLVITEM.
I think it cannot convert from 'LPNMLISTVIEW' to 'LPLVITEMW'.
|
|
|
|
|
BeliefInMe wrote: I think it cannot convert from 'LPNMLISTVIEW' to 'LPLVITEMW'.
Why would you think this would work? They are two different structures. Use LPNMLISTVIEW like the documentation states.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I am afraid, i am confusing you.. I said instead of
LPNMLISTVIEW pLVHdr = reinterpret_cast<LPNMLISTVIEW>(lParam);
i used
LPLVITEM pLVHdr = reinterpret_cast<LPLVITEM>(lParam);
|
|
|
|
|
But why, since LPNMLISTVIEW and LPLVITEM are two different structures. The documentaton plainly states that the lparam that accompanies the LVN_ITEMCHANGED notificaton is a pointer to a NMLISTVIEW structure, not a pointer to a LVITEM as you are trying to use.
That said, I do not know why your code "works" on Windows XP but not on Vista. I do not have the latter to test on.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I think, i am disturbing you.
Anyways Thank you very much for your time and help.
|
|
|
|
|
pidl = (LPCITEMIDLIST) ctl.GetItemData(pLVHdr->iItem);
SHGetPathFromIDList(pidl, tszBuffer);
pidl is '0x000000'. Hence tszBuffer is "".
|
|
|
|
|
As i said, GetItemData returns NULL, hence i used SendMessage() but in vain.
|
|
|
|
|
BeliefInMe wrote: This works in XP but not in Vista.
That sounds like you were relying on an internal implementation detail of the file dialog. It's no surprise that it broke in a new OS.
|
|
|
|
|
Hello all,
I have made a SDI application.My problem is when i exit this application after 2 sec i get a Don't Send error.
i have placed a AfxMessageBox in exit instance. It is working fine.
I m not getting why i m getting this problem
i have used multithreading in application.Explicitly closed all the thread before exiting and also have used CCriticalSection Lock unclok
Unlocked the protio in exit instance
but still the problem persists
Can anybody help me in this
Thanks in advance
|
|
|
|
|
The problem is with u'r closing of the Threads. Ensure, how the thread r closed.
Come online at:-
jubinc@skype
|
|
|
|
|
Did you try and debug ur code? What errors?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|