我想在dll中播放一个flash,可是不知道为什么播放不出来?请教高人!代码如下:
1.先在dll的initinstance中打开容器控件并显示一个对话框
BOOL CCreditSpyApp::InitInstance() 
{
// TODO: Add your specialized code here and/or call the base class
AfxEnableControlContainer();
CPlayFlashDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with Cancel
} // Since the dialog has been closed, return FALSE so that we exit the
//  application, rather than start the application's message pump.
return FALSE;
}2.在对话框创建函数中动态创建Flash控件并准备显示
int CPlayFlashDlg::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here
RECT rc;
GetClientRect(&rc); m_ShockwaveFlash.Create("MyFlash",WS_CHILD|WS_VISIBLE,CRect(0,0, //创建FALSH窗口
rc.right,rc.bottom),this,1);
m_ShockwaveFlash.SetMovie("c:\\startup.swf");  // ->问题就是这里,不知道为什么总是显示不出来
m_ShockwaveFlash.Play();
m_ShockwaveFlash.SetLoop(TRUE); return 0;
}

解决方案 »

  1.   

    AFX_MANAGE_STATE(AfxGetStaticModuleState())
    加到你导出函数里面....
      

  2.   

    没看到你在InitInstance的开始调用AfxOleInit()。另外,出错那句的参数改成_T("C:\\startup.swf")试试
      

  3.   


    还是没有显示出来,对了,我是把dll注入到explorer.exe进程中执行的,会不会是这个原因导致的呢?
      

  4.   


    还是没有显示出来,对了,我是把dll注入到explorer.exe进程中执行的,会不会是这个原因导致的呢?