我想在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.先在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;
}
解决方案 »
- CReBar加入了一个CToolBar,一个CDialogBar,怎样动态的把CDialogBar删除?
- 无法打开包括文件:“afxwin.h“是什么原因啊
- JPEG文件最大可以是多大?
- 视屏聊天系统中,遇到一个奇怪的问题。
- 高分急急请教,怎样在以CDialogBar为基类的对话框工具栏中实现象胶卷底片排列方式的图象浏览窗设计?
- 程序中使用了相对路径,但在文件菜单中打开了不是应用程序当前路径下的文件后,当前路径就改了.请问如何让其不改?
- 上班第一天交给我的任务,怎样通过IE修改硬件的参数?急!!!
- 项目招标: VC++ COM RMB>5000 ,限广州地区
- 连开5帖,紧急求:win2k下,怎么把CMOS里的数据写到文件里,尽量细点,我是菜鸟。
- 如何在windows程序中启动一个含有参数的DOS程序?
- 关于 自绘按扭问题
- 如何得到已经格式化好的时间字符串?
加到你导出函数里面....
还是没有显示出来,对了,我是把dll注入到explorer.exe进程中执行的,会不会是这个原因导致的呢?
还是没有显示出来,对了,我是把dll注入到explorer.exe进程中执行的,会不会是这个原因导致的呢?