Solved

Using an ActiveX control from a DLL

Posted on 2001-08-02
4
469 Views
Last Modified: 2013-11-20
I have made an MFC DLL, using the Application Wizard.
In that DLL I inserted a dialog, with some common controls and and ActiveX control (a better grid than the one provided by Microsoft).

The problem arises when I call the function that creates the dialog. Apparently the DoModal method fails because of the ActiveX control (if the dialog doesn't have the ActiveX control there is no problem).

As when I use ActiveX control in other applications (.EXE) I inserted this line in the InitInstance member of the DLL.

AfxEnableControlContainer();

Also, I inserted this line in the exported function of the DLL that creates the dialog:

AFX_MANAGE_STATE(AfxGetStaticModuleState());

I think that there is a function call or something that is missing, but I can't find any examples about using an ActiveX control from a DLL.
0
Comment
Question by:pgiusto
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6346141
Did you call 'AfxOleInit()'?
0
 

Author Comment

by:pgiusto
ID: 6346237
Yes, while expecting for a comment, y read in the MSDN about using AfxOleInit() in the dll, but it doesn't work.

Should I tried using AfxOleInit() in the application (.exe)
0
 
LVL 12

Expert Comment

by:migel
ID: 6346264
Hi!
is your control registered in the system?
0
 

Author Comment

by:pgiusto
ID: 6346280
OK. I tried calling the function from the exe instead from the dll and it's work.

Thanks a lot.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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 demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now