opacios
asked on
OLE Container in a DLL
I'm developing a DLL that simply shows a frame window containing a RemoteData Control and a DBGrid Control. I have initialized my app with AfxEnableOLEContainer and my app runs fine, but the RemoteData and DBGrid controls do not appear. The debug output message is the following:
CoCreateInstance of OLE control {00028C00-0000-0000-0000-0 0000000004 6} failed.
>>> Result code: 0x800401f0
>>> Is the control is properly registered?
Warning: CreateDlgControls failed during form view init.
Detected memory leaks!
Dumping objects ->
occmgr.cpp(646) : {241} normal block at 0x00412580, 28 bytes long.
The line 646 of occmgr.cpp is the following:
pBindings = new CDataBoundProperty(pBindin gs, dispid, ctlid);
What's the problem?
Thank you in advance.
CoCreateInstance of OLE control {00028C00-0000-0000-0000-0
>>> Result code: 0x800401f0
>>> Is the control is properly registered?
Warning: CreateDlgControls failed during form view init.
Detected memory leaks!
Dumping objects ->
occmgr.cpp(646) : {241} normal block at 0x00412580, 28 bytes long.
The line 646 of occmgr.cpp is the following:
pBindings = new CDataBoundProperty(pBindin
What's the problem?
Thank you in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If contrls are properly registered be sure that you called AfxOleInit() and AfxEnableControlcontainer( ) in your application InitInstance function
ASKER
Thanks for your answers.
I was calling AfxOleInit and AfxEnableControlContainer in the DLL application object InitInstance function, but they have to be called from the application that imports the DLL.
I was calling AfxOleInit and AfxEnableControlContainer in the DLL application object InitInstance function, but they have to be called from the application that imports the DLL.
ASKER
I've registered the two controls, and the problem persists. I think that it's not the problem, because these controls work fine in an usual MFC application. The problem only appears when including the controls in a DLL.