添加了之后有当运行时有异常Warning: CreateDlgControls failed during dialog init. CoCreateInstance of OLE control {D27CDB6E-AE6D-11CF-96B8-444553540000} failed. >>> Result code: 0x800401f0 >>> Is the control is properly registered? Warning: CreateDlgControls failed during dialog init.这是什么原因啊?
CoCreateInstance of OLE control {D27CDB6E-AE6D-11CF-96B8-444553540000} failed.
>>> Result code: 0x800401f0
>>> Is the control is properly registered?
Warning: CreateDlgControls failed during dialog init.这是什么原因啊?
{
CWinApp::InitInstance();
AfxEnableControlContainer();
return TRUE;
}
我在这里添加的,对吗?
里面有窗口.代码如下
CMainDlg 就是有flash那个控件
==================================#include "stdafx.h"
#include "ef3.h"
#include "MainDlg.h"#ifdef _DEBUG
#define new DEBUG_NEW
#endif// Cef3AppBEGIN_MESSAGE_MAP(Cef3App, CWinApp)
END_MESSAGE_MAP()
// Cef3App 构造Cef3App::Cef3App()
{
}Cef3App::~Cef3App()
{
}// 唯一的一个 Cef3App 对象Cef3App theApp;
// Cef3App 初始化
BOOL Cef3App::InitInstance()
{
AfxEnableControlContainer();
CWinApp::InitInstance();
return TRUE;
}void LoadDialog( )
{
CMainDlg dlg;
dlg.DoModal();
}================================
我在另外一个EXE里面调用
typedef void (*MyProc)( );
HMODULE hMoudle = LoadLibrary( "Ef3.dll" );
if ( hMoudle != NULL ){
MyProc ab = (MyProc)GetProcAddress( hMoudle , "LoadDialog");
if ( ab != NULL ){
ab( );
}
FreeLibrary( hMoudle );
}============================================
在这里面加上AfxOleInit()试试.
怎么注册这个控件啊?
找到如下:
====================================================================
这是一个系统错误,用Error Lookup察看显示: 尚未调用 CoInitialize。
解决的办法是在初始化时调用CoInitialize。
=====================================================================
变成:BOOL Cef3App::InitInstance()
{
AfxEnableControlContainer();
AfxOleInit();
CoInitialize( NULL );
CWinApp::InitInstance();
return TRUE;
}之后,终于可以了..........
在这里感谢
rageliu,KeSummer这两个帮助.然后看看大家有没有补充,明天结贴.
嘻嘻.