IShellWindows::get_Count的问题?????
//我在主线程中用如下语句获取到了IShellWindows接口指针
CoInitalize(NULL);
//头文件中声明CComPtr<IShellWindows> m_spSHWinds;
//程序类CStudyTimeDlg中给了下面的实现
CoInitialize(NULL);
if (m_spSHWinds.CoCreateInstance((CLSID_ShellWindows)) != S_OK)
{
MessageBox(_T("Failed"));
return FALSE;
}
//在程序类CStudyTimeDlg中新建了一个工作线程
DWORD dwThreadId;
if(m_hThread==NULL)
{
m_hThread=CreateThread(NULL,0,HandleTime,this,0,&dwThreadId); //this为主窗口类指针
}
//线程函数为
DWORD WINAPI CStudyTimeDlg::HandleTime(LPVOID pParam)
{
//
CStudyTimeDlg *pStudyDlg=(CStudyTimeDlg*)pParam;
long nCount=0;
pStudyDlg->m_spSHWinds->get_Count(&nCount);
}
为什么nCount为0呢?请高手能给予指点,我不胜感激!!!!!