|
-
April 28th, 1999, 02:52 PM
#1
Need help with this code
What I'm trying to accomplish is to find the selected Item and make sure it's a file not a directory. And if it's a file I get control of the Multimedia control to paly the wave file selected.
What am I doing wrong? If you require more info let me know
Thank you in advance
void CVRSessionView::OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
CFrameWnd* pFrame= GetParentFrame();
if( pFrame != NULL && pFrame->IsKindOf(RUNTIME_CLASS(CMainFrame))) {
CListCtrl &ctlList = GetListCtrl();
CObject *pObject= (CObject *) ctlList.GetItemData( pNMListView->iItem); //ASSERT ERROR HERE
if(pObject->IsKindOf(RUNTIME_CLASS(CFileInfo))){
Cmci mci; //Multimedia control
mci.SetDeviceType("WaveAudio");
//mci.SetFileName(fileToPlay);
mci.SetCommand("open");
}
}
class CFileInfo ublic CObject
{
public:
void SetFileInfo(File &fileInfo);
File GetFileInfo();
CFileInfo();
virtual ~CFileInfo();
DECLARE_DYNAMIC (CFileInfo);
private:
File m_fileInfo;
};
CFileInfo::CFileInfo()
{
}
CFileInfo::~CFileInfo()
{
}
File CFileInfo::GetFileInfo()
{
return m_fileInfo;
}
void CFileInfo::SetFileInfo(File &fileInfo)
{
m_fileInfo = fileInfo;
}
*pResult = 0;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|