[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

OLE Container in a DLL

Posted on 1997-12-16
4
Medium Priority
?
630 Views
Last Modified: 2013-11-25
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-000000000046} 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(pBindings, dispid, ctlid);

What's the problem?

Thank you in advance.
0
Comment
Question by:opacios
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 300 total points
ID: 1312385
The problem is that control you aretrying to create is not properly registered on your computer. Use regsvr32.exe utility founf in system directory to register control. To do this launch regsvr32.exe with command line as full path to control file. Yuo must get message box that your control registration has been succeeded. You can also use ActiveX controls test container to rister these controls by invoking "Register control" menu and browsing to DBGrid control DBGRID32.OCX if your are working in 32 bit platform or DBGRID16.OCX if you are working in 26 bit platform file.
0
 

Author Comment

by:opacios
ID: 1312386
Thanks for your fast answer.

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.
0
 
LVL 7

Expert Comment

by:galkin
ID: 1312387
If contrls are properly registered be sure that you called AfxOleInit() and AfxEnableControlcontainer() in your application InitInstance function
0
 

Author Comment

by:opacios
ID: 1312388
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.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question